Class ResourceLocationConstraint
java.lang.Object
com.dna.jopt.member.unit.condition.resource.ResourceLocationConstraint
- All Implemented Interfaces:
IConstraint
,IResourceLevelConstraint
,Serializable
- See Also:
-
Constructor Summary
ConstructorDescriptionResourceLocationConstraint
(Duration maxRadiusTime) ResourceLocationConstraint
(javax.measure.Quantity<javax.measure.quantity.Length> maxRadiusDistance) ResourceLocationConstraint
(javax.measure.Quantity<javax.measure.quantity.Length> maxRadiusDistance, Duration maxRadiusTime) -
Method Summary
Modifier and TypeMethodDescriptioncom.dna.jopt.assessment.costassessorrestriction.restrictionresult.IEntityRestrictionResult
assessConstraint
(IEntity en, ILogicEntityRoute route, INode node, com.dna.jopt.assessment.costadjustment.IEntityCostAdjuster costAdjuster, com.dna.jopt.assessment.costassessor.IEntityCostAssessor ca, com.dna.jopt.framework.inputplausibility.properties.IPropertyProvider propertyProvider, boolean resultRequested) Assesses the route, checking if the appropriatequalifications
for theconstraints
are present.static com.dna.jopt.assessment.costassessorrestriction.restrictionresult.EntityRestrictionResult
assessMaxRadius
(ILogicEntityRoute route, IOptimizationElement node, IOptimizationElement anchorNode, double maxRadiusDistanceMeter, String distanceViolationPrefix, long maxRadiusTimeMillis, String timeViolationPrefix, com.dna.jopt.assessment.costadjustment.IEntityCostAdjuster costAdjuster, com.dna.jopt.assessment.costassessor.IEntityCostAssessor ca, com.dna.jopt.framework.inputplausibility.properties.IPropertyProvider propertyProvider, boolean resultRequested) Optional<javax.measure.Quantity<javax.measure.quantity.Length>>
getTitle()
Gets the title of the constraint.boolean
boolean
isHard()
Checks the parameter or directly returnstrue
where this must be the case.boolean
isSatisfied
(com.dna.jopt.assessment.costassessor.IEntityCostAssessor ca, INode node, ILogicEntityRoute route) Filters out hard constraint mismatches by checking whether aNode
demands aQualification
as ahard constraint
but theResource
does not provide this one.void
setIsHard
(boolean isHard) Sets the constraint tohard
if the respective parameter is given or returns anIllegalStateException
if this is expected but not the case.
-
Constructor Details
-
ResourceLocationConstraint
public ResourceLocationConstraint(javax.measure.Quantity<javax.measure.quantity.Length> maxRadiusDistance) -
ResourceLocationConstraint
-
ResourceLocationConstraint
public ResourceLocationConstraint(javax.measure.Quantity<javax.measure.quantity.Length> maxRadiusDistance, Duration maxRadiusTime)
-
-
Method Details
-
getMaxRadiusDistance
-
getMaxRadiusTime
-
assessMaxRadius
public static com.dna.jopt.assessment.costassessorrestriction.restrictionresult.EntityRestrictionResult assessMaxRadius(ILogicEntityRoute route, IOptimizationElement node, IOptimizationElement anchorNode, double maxRadiusDistanceMeter, String distanceViolationPrefix, long maxRadiusTimeMillis, String timeViolationPrefix, com.dna.jopt.assessment.costadjustment.IEntityCostAdjuster costAdjuster, com.dna.jopt.assessment.costassessor.IEntityCostAssessor ca, com.dna.jopt.framework.inputplausibility.properties.IPropertyProvider propertyProvider, boolean resultRequested) -
assessConstraint
public com.dna.jopt.assessment.costassessorrestriction.restrictionresult.IEntityRestrictionResult assessConstraint(IEntity en, ILogicEntityRoute route, INode node, com.dna.jopt.assessment.costadjustment.IEntityCostAdjuster costAdjuster, com.dna.jopt.assessment.costassessor.IEntityCostAssessor ca, com.dna.jopt.framework.inputplausibility.properties.IPropertyProvider propertyProvider, boolean resultRequested) Description copied from interface:IConstraint
Assesses the route, checking if the appropriatequalifications
for theconstraints
are present.The
boolean true
saves the data.- Specified by:
assessConstraint
in interfaceIConstraint
- Parameters:
en
- entityroute
- the iLogicEntityRoutenode
- nodecostAdjuster
- iEntityCostAdjusterca
- capropertyProvider
- iPropertyProviderresultRequested
- the boolean whether to save the results of the route- Returns:
- Entity Restriction Result
-
setIsHard
public void setIsHard(boolean isHard) Description copied from interface:IConstraint
Sets the constraint tohard
if the respective parameter is given or returns anIllegalStateException
if this is expected but not the case.- Specified by:
setIsHard
in interfaceIConstraint
- Parameters:
isHard
- the boolean to be set
-
isHard
public boolean isHard()Description copied from interface:IConstraint
Checks the parameter or directly returnstrue
where this must be the case.- Specified by:
isHard
in interfaceIConstraint
- Returns:
- the value of the checked boolean
-
isSatisfied
public boolean isSatisfied(com.dna.jopt.assessment.costassessor.IEntityCostAssessor ca, INode node, ILogicEntityRoute route) Description copied from interface:IConstraint
Filters out hard constraint mismatches by checking whether aNode
demands aQualification
as ahard constraint
but theResource
does not provide this one. The idea is to have onlysoft constraints
problems in the optimisation which can get solved by adding cost.- Specified by:
isSatisfied
in interfaceIConstraint
- Parameters:
ca
- the iEntityCostAssessornode
- the iNoderoute
- the iLogicEntityRoute- Returns:
- the boolean whether the route is satisfied.
True
means no problems detected
-
getTitle
Description copied from interface:IConstraint
Gets the title of the constraint.- Specified by:
getTitle
in interfaceIConstraint
- Returns:
- the title
-
hasMembers
public boolean hasMembers()- Specified by:
hasMembers
in interfaceIConstraint
-