Roster#
The skill-free view of a project's accepted state: its scheduled leaf tasks, its resources and its active assignments. Each list is in model order. Project#roster returns a new instance, and SkillLayer.validatePool takes one. Use it to build your own Slot list for Project#suggestAssignments.
Declaration#
Constructors#
Roster()#
public
Creates a roster with three empty lists.
Fields#
| Field | Type | Default | Description |
|---|---|---|---|
tasks |
Vec<Id> |
empty | IDs of the scheduled leaf tasks. Summary tasks aren't listed. |
resources |
Vec<Id> |
empty | IDs of the resources. |
assignments |
Vec<RosterAssignment> |
empty | The active assignments. |
Each ID is the Id value from the project's input data.
Methods#
withTasks#
public Roster
public Roster
Sets tasks and returns this instance for chaining. The Collection overload copies the items into a new Vec, so List.of(...) works. null stays null.
Returns: this Roster.
withResources#
public Roster
public Roster
Sets resources and returns this instance for chaining. The Collection overload copies the items into a new Vec. null stays null.
Returns: this Roster.
withAssignments#
public Roster
public Roster
Sets assignments and returns this instance for chaining. The Collection overload copies the items into a new Vec. null stays null.
Returns: this Roster.
deepClone#
public Roster
Returns a copy with new tasks, resources and assignments lists. Each RosterAssignment is cloned with its own deepClone(). Id values are immutable and are shared.
Returns: a new Roster.
copy#
public Roster
Returns a shallow copy. The copy and the original share the three lists.
Returns: a new Roster.
equals, hashCode, toString#
public boolean
public int
public String
Inherited from ValueRecord. Two rosters are equal when all three fields are equal. toString() lists the fields, for logging.
RosterAssignment#
One active assignment in a Roster: the assignment ID, its task and its resource.
| Member | Type | Default | Description |
|---|---|---|---|
id |
Id |
null |
Assignment ID. |
task |
Id |
null |
ID of the assigned task. |
resource |
Id |
null |
ID of the booked resource. |
RosterAssignment() |
constructor | Creates an instance with every field null. |
|
withId(Id), withTask(Id), withResource(Id) |
RosterAssignment |
Set the field and return this instance for chaining. | |
deepClone(), copy() |
RosterAssignment |
Return a copy with the same field values. All fields are immutable Id values, so both copies are independent. |
equals, hashCode and toString are inherited from ValueRecord and compare or list all three fields.
Example#
;
;
Related#
Project#roster- the call that returns itSlot- the slots you build from itSkillLayer.slots- builds slots from skills instead- Skills and requirements - building slots from a worker pool