Skill#
One skill a Worker has, with its value. Use 0/1 for a skill a worker either has or doesn't, and an integer grade for a skill with levels. Create one with new Skill() and the withId / withValue setters, then put it in Worker.skills.
A SkillMatch compares this value when SkillLayer.slots picks candidates. A skill the worker doesn't list counts as 0 there.
Declaration#
;
Every field is public and mutable, and has a withX(value) setter that assigns it and returns this. equals, hashCode and toString come from ValueRecord and compare id and value.
Constructors#
Skill()#
public
Creates a skill with id = null and value = 1.0. Set id before use.
Fields#
| Field | Type | Default | Description |
|---|---|---|---|
id |
Id |
null |
Skill id. Must be unique within one worker's skills. |
value |
double |
1.0 |
Skill value: 0/1 for a yes/no skill, an integer grade otherwise. Must be finite. |
public Id id;
public double value;
public Skill
public Skill
SkillLayer.slots and SkillLayer.validatePool reject a duplicate id or a non-finite value with a MatchException.Invalid at pool.workers[i].skills[j].id or .value. See Errors.
Methods#
deepClone#
public Skill
Returns a new skill with the same id and value.
copy#
public Skill
Returns a shallow copy. A skill holds only an immutable Id and a double, so the result equals deepClone().
Example#
;
;
Related#
Worker- holds the skills of one resourceSkillMatch- the condition that compares skill valuesSkillLayer.slots- the call that matches skills- Skills and requirements - yes/no and graded skills