Class MachineReassignmentConstraintProvider

java.lang.Object
org.optaplanner.examples.machinereassignment.score.MachineReassignmentConstraintProvider
All Implemented Interfaces:
org.optaplanner.core.api.score.stream.ConstraintProvider

public class MachineReassignmentConstraintProvider extends Object implements org.optaplanner.core.api.score.stream.ConstraintProvider
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.optaplanner.core.api.score.stream.Constraint
    balanceCost(org.optaplanner.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)))
    org.optaplanner.core.api.score.stream.Constraint[]
    defineConstraints(org.optaplanner.core.api.score.stream.ConstraintFactory factory)
     
    protected org.optaplanner.core.api.score.stream.Constraint
    loadCost(org.optaplanner.core.api.score.stream.ConstraintFactory factory)
    Load: The safety capacity for each resource for each machine should not be exceeded.
    protected org.optaplanner.core.api.score.stream.Constraint
    machineMoveCost(org.optaplanner.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 org.optaplanner.core.api.score.stream.Constraint
    maximumCapacity(org.optaplanner.core.api.score.stream.ConstraintFactory factory)
    Maximum capacity: The maximum capacity for each resource for each machine must not be exceeded.
    protected org.optaplanner.core.api.score.stream.Constraint
    processMoveCost(org.optaplanner.core.api.score.stream.ConstraintFactory factory)
    Process move cost: A process has a move cost.
    protected org.optaplanner.core.api.score.stream.Constraint
    serviceConflict(org.optaplanner.core.api.score.stream.ConstraintFactory factory)
     
    protected org.optaplanner.core.api.score.stream.Constraint
    serviceDependency(org.optaplanner.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 org.optaplanner.core.api.score.stream.Constraint
    serviceLocationSpread(org.optaplanner.core.api.score.stream.ConstraintFactory factory)
    Spread: Processes of the same service must be serviceLocationSpread out across locations.
    protected org.optaplanner.core.api.score.stream.Constraint
    serviceMoveCost(org.optaplanner.core.api.score.stream.ConstraintFactory factory)
    Service move cost: A service has a move cost.
    protected org.optaplanner.core.api.score.stream.Constraint
    transientUsage(org.optaplanner.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 org.optaplanner.core.api.score.stream.Constraint[] defineConstraints(org.optaplanner.core.api.score.stream.ConstraintFactory factory)
      Specified by:
      defineConstraints in interface org.optaplanner.core.api.score.stream.ConstraintProvider
    • maximumCapacity

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

      protected org.optaplanner.core.api.score.stream.Constraint serviceConflict(org.optaplanner.core.api.score.stream.ConstraintFactory factory)
    • serviceLocationSpread

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

      protected org.optaplanner.core.api.score.stream.Constraint serviceDependency(org.optaplanner.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 org.optaplanner.core.api.score.stream.Constraint transientUsage(org.optaplanner.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 org.optaplanner.core.api.score.stream.Constraint loadCost(org.optaplanner.core.api.score.stream.ConstraintFactory factory)
      Load: The safety capacity for each resource for each machine should not be exceeded.
    • balanceCost

      protected org.optaplanner.core.api.score.stream.Constraint balanceCost(org.optaplanner.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 org.optaplanner.core.api.score.stream.Constraint processMoveCost(org.optaplanner.core.api.score.stream.ConstraintFactory factory)
      Process move cost: A process has a move cost.
    • serviceMoveCost

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

      protected org.optaplanner.core.api.score.stream.Constraint machineMoveCost(org.optaplanner.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.