Lesson 3 Challenge

Hi,

The solution for the Advent SysML v2, Lesson 3 challenge show this part def for an Elf.

part def Elf {

            attribute skillType : SkillType default := SkillType::TBD;

            attribute skillLevel : Real default := 0.0;

    }

I’m confused about the use of both default and := in the skillLevel attribute, seems incorrect. Given that this is a part def, I would expect the line to be:

attribute skillLevel : Real default 0.0;

Since I’m learning, would be happy to get confirmation from someone if my understand is correct and if not, learn what I got wrong.

Hi Maurice,

This is covered in detail in Lesson 11. The “:=” means that this is a default initial value (effective only at the start of an Elf instance).

In any case, thanks for the feedback! There might be mistakes in the models, and we appreciate if you help us find and fix them :slight_smile: