本文へ移動

@eightkk/vue-weave / core / levelResources

Function: levelResources() ​

Call Signature ​

levelResources(input, options?): LevelResourcesResult

Defined in: src/core/leveling.ts:367

Delay tasks so that assigned load stays within resource capacity, using a deterministic priority-based serial heuristic. Each task is placed as soon as dependencies, constraints, calendars and remaining capacity allow; mode is ignored. The returned dates are those of scheduleTasks applied to the returned leveledTasks.

Manual tasks are never moved: their capacity is reserved first, at their manual dates, and one that finds too little capacity there is listed in unresolvedTaskIds. Inactive tasks and their assignments are ignored.

Capacity follows a resource's capacityPeriods, as in calculateResourceLoad, and an assignment with workOffset or workDuration takes capacity only during its part of the task's work at each candidate placement.

Summary tasks are never placed themselves: their dates roll up from their leveled subtasks, assignments to them take no capacity, and they are not listed in delays.

With { explain: true }, a successful result also has a trace. It holds the latest reasons of the horizon that leveling may not pass and the leveling reasons recorded while capacity was reserved, including the resources, intervals and holding tasks that delayed or split a task. It does not explain the replayed scheduleTasks run.

Parameters ​

input ​

LevelResourcesInput

options? ​

ScheduleOptions & object

Returns ​

LevelResourcesResult

Call Signature ​

levelResources(input, options): ExplainedLevelResourcesResult

Defined in: src/core/leveling.ts:368

Delay tasks so that assigned load stays within resource capacity, using a deterministic priority-based serial heuristic. Each task is placed as soon as dependencies, constraints, calendars and remaining capacity allow; mode is ignored. The returned dates are those of scheduleTasks applied to the returned leveledTasks.

Manual tasks are never moved: their capacity is reserved first, at their manual dates, and one that finds too little capacity there is listed in unresolvedTaskIds. Inactive tasks and their assignments are ignored.

Capacity follows a resource's capacityPeriods, as in calculateResourceLoad, and an assignment with workOffset or workDuration takes capacity only during its part of the task's work at each candidate placement.

Summary tasks are never placed themselves: their dates roll up from their leveled subtasks, assignments to them take no capacity, and they are not listed in delays.

With { explain: true }, a successful result also has a trace. It holds the latest reasons of the horizon that leveling may not pass and the leveling reasons recorded while capacity was reserved, including the resources, intervals and holding tasks that delayed or split a task. It does not explain the replayed scheduleTasks run.

Parameters ​

input ​

LevelResourcesInput

options ​

ScheduleOptions & object

Returns ​

ExplainedLevelResourcesResult

Call Signature ​

levelResources(input, options?): { code: "cycle"; cycles: readonly ScheduleCycle[]; ok: false; } | { code: "infeasible"; constraints: readonly ScheduleConstraintName[]; dependencyIds: readonly string[]; ok: false; taskId: string; } | LevelResourcesSuccess | ExplainedLevelResourcesSuccess

Defined in: src/core/leveling.ts:369

Delay tasks so that assigned load stays within resource capacity, using a deterministic priority-based serial heuristic. Each task is placed as soon as dependencies, constraints, calendars and remaining capacity allow; mode is ignored. The returned dates are those of scheduleTasks applied to the returned leveledTasks.

Manual tasks are never moved: their capacity is reserved first, at their manual dates, and one that finds too little capacity there is listed in unresolvedTaskIds. Inactive tasks and their assignments are ignored.

Capacity follows a resource's capacityPeriods, as in calculateResourceLoad, and an assignment with workOffset or workDuration takes capacity only during its part of the task's work at each candidate placement.

Summary tasks are never placed themselves: their dates roll up from their leveled subtasks, assignments to them take no capacity, and they are not listed in delays.

With { explain: true }, a successful result also has a trace. It holds the latest reasons of the horizon that leveling may not pass and the leveling reasons recorded while capacity was reserved, including the resources, intervals and holding tasks that delayed or split a task. It does not explain the replayed scheduleTasks run.

Parameters ​

input ​

LevelResourcesInput

options? ​

ScheduleOptions

Returns ​

Type Literal ​

{ code: "cycle"; cycles: readonly ScheduleCycle[]; ok: false; }


Type Literal ​

{ code: "infeasible"; constraints: readonly ScheduleConstraintName[]; dependencyIds: readonly string[]; ok: false; taskId: string; }

code ​

code: "infeasible"

constraints ​

constraints: readonly ScheduleConstraintName[]

Binding bounds of the task that conflict, in a fixed order.

dependencyIds ​

dependencyIds: readonly string[]

Binding dependencies of the task that conflict, in input order.

ok ​

ok: false

taskId ​

taskId: string


LevelResourcesSuccess


ExplainedLevelResourcesSuccess

MIT ライセンスで公開しています。