Project#suggestAssignments#
Proposes resources for requirement slots of a Project. It fills empty slots, repairs broken ones and rebalances valid ones, and scores each step like evaluate. The project isn't modified: the proposal comes back as a change set. Needs a solved project.
Signature#
public SuggestResult
Synchronous and CPU-only. Not synchronized: serialize calls on one Project instance.
Parameters#
| Name | Type | Description |
|---|---|---|
slots |
Vec<Slot> |
The slots to fill or rebalance. To build them from skills and requirements, use SkillLayer.slots. To build your own, read the accepted state with roster. Not null |
options |
SuggestOptions |
Targets, fixed assignments, new-resource penalty, passes and leveling stage. Not null; new SuggestOptions() for defaults |
Behavior#
- Greedy: it visits slots one at a time. Later slots build on earlier picks.
- It never removes an assignment. It adds one per filled slot and changes the resource of a repaired or rebalanced one.
- Commit the proposal with
apply(result.changes), thensolve(null, ...), orlevelwith the same leveling options whenoptions.levelwas set. - With
options.levelset, the call doesn't return when an assignment asks for more units than its resource can ever supply, the same bug aslevel.
Returns#
A SuggestResult with the proposed changes and a step log.
Errors#
All engine exceptions are unchecked.
| Error | When |
|---|---|
ProjectException NO_BASELINE |
The project is unsolved, including after apply |
ProjectException STALE_BASELINE |
options.baselineId doesn't name the current baseline |
InputException |
Invalid options (paths newResourcePenalty, passes, targets[i], fixed[i], or invalid level options); a cyclic accepted state (path is null); an invalid slot (paths under slots[i]) |
NullPointerException |
slots or options is null |
Options are checked before slots. The accepted values are on the SuggestOptions and Slot pages.
Collection overload#
public SuggestResult
Copies slots into a Vec and calls the main form, so List.of(...) works. Same behavior and errors.
Example#
Fill an open position on task C, then commit the proposal.
;
;
Related#
Slot- a requirement slot to fillSuggestOptions- targets, fixed assignments and passesSuggestResult- the proposed change set and step logSkillLayer.slots- builds slots from skills and requirements- Suggesting assignments - how picks are made and committing the proposal