Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public final class ResourceLeveler
- Object
- ResourceLeveler
Finds where a project asks more of a resource than there is, and proposes delays that take the excess away.
Leveling never shortens or splits a task and never changes a link. It takes the earliest moment a resource is overbooked, keeps the tasks that can least afford to wait and holds one of the others back until a place is free: the one with the most slack first, so the project’s finish moves only when no slack is left, then the one with the lowest priority. A task that is scheduled manually, has a “must” constraint or has priority 1000 is never moved.
This is a heuristic, as it is in every planning tool: the best order is not something that can be computed for a project of any size.
Methods
public static List<ResourceOverallocation> findOverallocations(ProjectModel model) | Every stretch in which a resource is overbooked, ordered by resource and then by time. |
public static float[] loadProfile(ProjectModel model, String resourceId, long from, long to, int buckets) | How much of a resource is asked for over time: the most units in use at once in each of the buckets equal slices of [from, to). |
public static LevelingResult level(ProjectModel model) | Proposes leveling delays for the whole project, starting from none. |
Inherited methods
Method details
findOverallocations
public static List<ResourceOverallocation> findOverallocations(ProjectModel model)loadProfile
public static float[] loadProfile(ProjectModel model, String resourceId, long from, long to, int buckets)buckets equal slices of [from, to). Divide
by the resource’s capacity for a load.level
public static LevelingResult level(ProjectModel model)LevelingResult.apply.