public class PreferredResourceConstraint extends BindingResourceConstraint
IResource
on a INode
.
For a hard resource constraint
please use MandatoryResourceConstraint
.
MY_TITLE
Constructor and Description |
---|
PreferredResourceConstraint()
|
assessConstraint, getTitle, isSatisfied, toString
addResource, addResources, getMaxPriority, getPriority, getResourceIds, getResPriorityMap, hasMembers, isHard, removeResource, setIsHard, setMaxPriority, setResPriorityMap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addResource, addResources, getMaxPriority, getPriority, getResourceIds, getResPriorityMap, removeResource
hasMembers, isHard, setIsHard
public PreferredResourceConstraint()
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
.Copyright © 2017–2023 DNA Evolutions GmbH. All rights reserved.