Class PreferredResourceConstraint
java.lang.Object
com.dna.jopt.member.unit.condition.resource.AbstractResourceConstraint
com.dna.jopt.member.unit.condition.resource.BindingResourceConstraint
com.dna.jopt.member.unit.condition.resource.PreferredResourceConstraint
- All Implemented Interfaces:
IConstraint
,IConstraintResource
,Serializable
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:
-
Field Summary
Fields inherited from class com.dna.jopt.member.unit.condition.resource.BindingResourceConstraint
MY_TITLE
-
Constructor Summary
ConstructorDescription -
Method Summary
Methods inherited from class com.dna.jopt.member.unit.condition.resource.BindingResourceConstraint
assessConstraint, getTitle, isSatisfied, toString
Methods inherited from class com.dna.jopt.member.unit.condition.resource.AbstractResourceConstraint
addResource, addResources, getMaxPriority, getPriority, getResourceIds, getResPriorityMap, hasMembers, isHard, removeResource, setIsHard, setMaxPriority, setResPriorityMap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.dna.jopt.member.unit.condition.IConstraint
hasMembers, isHard, setIsHard
Methods inherited from interface com.dna.jopt.member.unit.condition.resource.IConstraintResource
addResource, addResources, getMaxPriority, getPriority, getResourceIds, getResPriorityMap, removeResource
-
Constructor Details
-
PreferredResourceConstraint
public PreferredResourceConstraint()Puts a preferred constraint of aIResource
on aINode
.Implementation example:
For a hard// 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);
resource constraint
please useMandatoryResourceConstraint
.
-