Class MandatoryResourceConstraint

All Implemented Interfaces:
IConstraint, IConstraintResource, Serializable

public class MandatoryResourceConstraint extends BindingResourceConstraint
This class puts a hard preferred constraint of a Resource on a Node so that the specified Resource is supposed to visit said Node.

For a soft constraint please use PreferredResourceConstraint.

Since:
13/08/2019
Version:
23/01/2020
Author:
DNA
See Also:
  • Constructor Details

    • MandatoryResourceConstraint

      public MandatoryResourceConstraint()
      Puts a hard preferred constraint of a Resource on a Node so that the specified Resource is supposed to visit said Node.

      Implementation example:

      
       CapacityResource resource =
               new CapacityResource(
                   "Jack", 50.775346, 6.083887, maxWorkingTime, maxDistanceKmW, workingHours);
      
       IConstraintResource jackMandatoryConstraint = new MandatoryResourceConstraint();
           jackMandatoryConstraint.addResource("Jack", 10);
      
        TimeWindowGeoNode aachen =
               new TimeWindowGeoNode("Aachen", 50.775346, 6.083887, weeklyOpeningHours, visitDuration, 1);
               aachen.addConstraint(jackMandConstraint);
           this.addElement(aachen);
      
       
      For a soft constraint please use PreferredResourceConstraint.