Interface IConstraint
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
IConstraintResource
,IResourceLevelConstraint
,IWorkingHoursLevelConstraint
,IZoneCodeConstraint<Z,
Q>
- All Known Implementing Classes:
AbstractResourceConstraint
,AbstractZoneCodeConstraint
,BannedResourceConstraint
,BindingResourceConstraint
,ConnectedConstraint
,ExcludingResourceConstraint
,MandatoryResourceConstraint
,NodeNotRedistributableConstraint
,PillarLateConstraint
,PillarNotReachableConstraint
,PillarResourceAttachedConstraint
,PreferredResourceConstraint
,ResourceLocationConstraint
,TypeConstraint
,TypeWithExpertiseConstraint
,UKPostCodeConstraint
,UnPreferredResource
,UnPreferredResourceConstraint
,ZoneNumberConstraint
Constraints
are limits set on the INode
which require the servicing IResource
to have the fitting IQualification
. This
interface provides methods to inquire about certain properties of constraints like the title,
whether they are hard constraints or methods to set them hard.- Since:
- 07/01/2019
- Version:
- 04/10/2019
- Author:
- DNA
-
Method Summary
Modifier and TypeMethodDescriptioncom.dna.jopt.assessment.costassessorrestriction.restrictionresult.IEntityRestrictionResult
assessConstraint
(IEntity en, ILogicEntityRoute route, INode node, com.dna.jopt.assessment.costadjustment.IEntityCostAdjuster iEntityCostAdjuster, com.dna.jopt.assessment.costassessor.IEntityCostAssessor ca, com.dna.jopt.framework.inputplausibility.properties.IPropertyProvider iPropertyProvider, boolean resultRequested) Assesses the route, checking if the appropriatequalifications
for theconstraints
are present.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.
-
Method Details
-
assessConstraint
com.dna.jopt.assessment.costassessorrestriction.restrictionresult.IEntityRestrictionResult assessConstraint(IEntity en, ILogicEntityRoute route, INode node, com.dna.jopt.assessment.costadjustment.IEntityCostAdjuster iEntityCostAdjuster, com.dna.jopt.assessment.costassessor.IEntityCostAssessor ca, com.dna.jopt.framework.inputplausibility.properties.IPropertyProvider iPropertyProvider, boolean resultRequested) Assesses the route, checking if the appropriatequalifications
for theconstraints
are present.The
boolean true
saves the data.- Parameters:
en
- entityroute
- the iLogicEntityRoutenode
- nodeca
- caiEntityCostAdjuster
- iEntityCostAdjusteriPropertyProvider
- iPropertyProviderresultRequested
- the boolean whether to save the results of the route- Returns:
- Entity Restriction Result
-
setIsHard
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.- Parameters:
isHard
- the boolean to be set
-
isHard
boolean isHard()Checks the parameter or directly returnstrue
where this must be the case.- Returns:
- the value of the checked boolean
-
isSatisfied
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. The idea is to have onlysoft constraints
problems in the optimisation which can get solved by adding cost.- Parameters:
ca
- the iEntityCostAssessornode
- the iNoderoute
- the iLogicEntityRoute- Returns:
- the boolean whether the route is satisfied.
True
means no problems detected
-
getTitle
String getTitle()Gets the title of the constraint.- Returns:
- the title
-
hasMembers
boolean hasMembers()
-