Class MandatoryResourceConstraint
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.MandatoryResourceConstraint
- All Implemented Interfaces:
IConstraint, IConstraintResource, Serializable
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:
-
Field Summary
FieldsFields inherited from class BindingResourceConstraint
MISSING_TYPE_COST_MULTIPLIER -
Constructor Summary
ConstructorsConstructorDescriptionPuts a hard preferred constraint of aResourceon aNodeso that the specifiedResourceis supposed to visit saidNode. -
Method Summary
Methods inherited from class BindingResourceConstraint
assessConstraint, getNodeTypeNoMatchCost, isSatisfied, toStringMethods inherited from class AbstractResourceConstraint
addResource, addResources, getIntialClassInfo, getMaxPriority, getPriority, getResourceIds, getResPriorityMap, hasMembers, isHard, removeResource, setIsHard, setMaxPriority, setResPriorityMapMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface IConstraint
hasMembers, isHard, setIsHardMethods inherited from interface IConstraintResource
addResource, addResources, getIntialClassInfo, getMaxPriority, getPriority, getResourceIds, getResPriorityMap, removeResource
-
Field Details
-
MY_TITLE
- See Also:
-
-
Constructor Details
-
MandatoryResourceConstraint
public MandatoryResourceConstraint()Puts a hard preferred constraint of aResourceon aNodeso that the specifiedResourceis supposed to visit saidNode.Implementation example:
For aCapacityResource 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);soft constraintplease usePreferredResourceConstraint.
-
-
Method Details
-
getTitle
Description copied from interface:IConstraintGets the title of the constraint.- Specified by:
getTitlein interfaceIConstraint- Overrides:
getTitlein classBindingResourceConstraint- Returns:
- the title
-