Class PreferredResourceConstraint

All Implemented Interfaces:
IConstraint, IConstraintResource, Serializable

public class PreferredResourceConstraint extends BindingResourceConstraint
This class puts a preferred constraint of a IResource on a INode.

For a hard resource constraint please use MandatoryResourceConstraint.

Since:
09/09/2019
Version:
09/09/2019
Author:
DNA
See Also:
  • Constructor Details

    • PreferredResourceConstraint

      public PreferredResourceConstraint()
      Puts a preferred constraint of a IResource on a INode.

      Implementation example:

      
       // Defining a node
        INode aachen = new TimeWindowGeoNode("Aachen", 50.77577, 6.08177, weeklyOpeningHours, Duration.ofMinutes(20), 1);
          opti.addElement(aachen);
      
       // Defining and adding the constraint
               IConstraintResource constraint = new PreferredResourceConstraint();
               constraint.addResource("JohnLeverkusen", 10);
               dresden.addConstraint(constraint);
       
      For a hard resource constraint please use MandatoryResourceConstraint.