Class MachineReassignmentConstraintProvider

java.lang.Object
ai.timefold.solver.examples.machinereassignment.score.MachineReassignmentConstraintProvider
All Implemented Interfaces:
ai.timefold.solver.core.api.score.stream.ConstraintProvider

public class MachineReassignmentConstraintProvider extends Object implements ai.timefold.solver.core.api.score.stream.ConstraintProvider
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected ai.timefold.solver.core.api.score.stream.Constraint
    balanceCost(ai.timefold.solver.core.api.score.stream.ConstraintFactory factory)
    availability(r) = capacity(m, r) - usage(m, r) balanceCost = sum(max(0, multiplier * availability(m, r1) - availability(m, r2)))
    ai.timefold.solver.core.api.score.stream.Constraint[]
    defineConstraints(ai.timefold.solver.core.api.score.stream.ConstraintFactory factory)
     
    protected ai.timefold.solver.core.api.score.stream.Constraint
    loadCost(ai.timefold.solver.core.api.score.stream.ConstraintFactory factory)
    Load: The safety capacity for each resource for each machine should not be exceeded.
    protected ai.timefold.solver.core.api.score.stream.Constraint
    machineMoveCost(ai.timefold.solver.core.api.score.stream.ConstraintFactory factory)
    Machine move cost: Moving a process from machine A to machine B has another A-B specific move cost.
    protected ai.timefold.solver.core.api.score.stream.Constraint
    maximumCapacity(ai.timefold.solver.core.api.score.stream.ConstraintFactory factory)
    Maximum capacity: The maximum capacity for each resource for each machine must not be exceeded.
    protected ai.timefold.solver.core.api.score.stream.Constraint
    processMoveCost(ai.timefold.solver.core.api.score.stream.ConstraintFactory factory)
    Process move cost: A process has a move cost.
    protected ai.timefold.solver.core.api.score.stream.Constraint
    serviceConflict(ai.timefold.solver.core.api.score.stream.ConstraintFactory factory)
     
    protected ai.timefold.solver.core.api.score.stream.Constraint
    serviceDependency(ai.timefold.solver.core.api.score.stream.ConstraintFactory factory)
    Dependency: The processes of a service depending on another service must run in the neighborhood of a process of the other service.
    protected ai.timefold.solver.core.api.score.stream.Constraint
    serviceLocationSpread(ai.timefold.solver.core.api.score.stream.ConstraintFactory factory)
    Spread: Processes of the same service must be serviceLocationSpread out across locations.
    protected ai.timefold.solver.core.api.score.stream.Constraint
    serviceMoveCost(ai.timefold.solver.core.api.score.stream.ConstraintFactory factory)
    Service move cost: A service has a move cost.
    protected ai.timefold.solver.core.api.score.stream.Constraint
    transientUsage(ai.timefold.solver.core.api.score.stream.ConstraintFactory factory)
    Transient usage: Some resources are transient and count towards the maximum capacity of both the original machine as the newly assigned machine.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MachineReassignmentConstraintProvider

      public MachineReassignmentConstraintProvider()
  • Method Details

    • defineConstraints

      public ai.timefold.solver.core.api.score.stream.Constraint[] defineConstraints(ai.timefold.solver.core.api.score.stream.ConstraintFactory factory)
      Specified by:
      defineConstraints in interface ai.timefold.solver.core.api.score.stream.ConstraintProvider
    • maximumCapacity

      protected ai.timefold.solver.core.api.score.stream.Constraint maximumCapacity(ai.timefold.solver.core.api.score.stream.ConstraintFactory factory)
      Maximum capacity: The maximum capacity for each resource for each machine must not be exceeded.
    • serviceConflict

      protected ai.timefold.solver.core.api.score.stream.Constraint serviceConflict(ai.timefold.solver.core.api.score.stream.ConstraintFactory factory)
    • serviceLocationSpread

      protected ai.timefold.solver.core.api.score.stream.Constraint serviceLocationSpread(ai.timefold.solver.core.api.score.stream.ConstraintFactory factory)
      Spread: Processes of the same service must be serviceLocationSpread out across locations.
    • serviceDependency

      protected ai.timefold.solver.core.api.score.stream.Constraint serviceDependency(ai.timefold.solver.core.api.score.stream.ConstraintFactory factory)
      Dependency: The processes of a service depending on another service must run in the neighborhood of a process of the other service.
    • transientUsage

      protected ai.timefold.solver.core.api.score.stream.Constraint transientUsage(ai.timefold.solver.core.api.score.stream.ConstraintFactory factory)
      Transient usage: Some resources are transient and count towards the maximum capacity of both the original machine as the newly assigned machine.
    • loadCost

      protected ai.timefold.solver.core.api.score.stream.Constraint loadCost(ai.timefold.solver.core.api.score.stream.ConstraintFactory factory)
      Load: The safety capacity for each resource for each machine should not be exceeded.
    • balanceCost

      protected ai.timefold.solver.core.api.score.stream.Constraint balanceCost(ai.timefold.solver.core.api.score.stream.ConstraintFactory factory)
      availability(r) = capacity(m, r) - usage(m, r) balanceCost = sum(max(0, multiplier * availability(m, r1) - availability(m, r2)))
    • processMoveCost

      protected ai.timefold.solver.core.api.score.stream.Constraint processMoveCost(ai.timefold.solver.core.api.score.stream.ConstraintFactory factory)
      Process move cost: A process has a move cost.
    • serviceMoveCost

      protected ai.timefold.solver.core.api.score.stream.Constraint serviceMoveCost(ai.timefold.solver.core.api.score.stream.ConstraintFactory factory)
      Service move cost: A service has a move cost.
    • machineMoveCost

      protected ai.timefold.solver.core.api.score.stream.Constraint machineMoveCost(ai.timefold.solver.core.api.score.stream.ConstraintFactory factory)
      Machine move cost: Moving a process from machine A to machine B has another A-B specific move cost.