Interface IConstraint
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
IConstraintResource,IResourceLevelConstraint,IWorkingHoursLevelConstraint,IZoneCodeConstraint<Z,Q>
- All Known Implementing Classes:
AbstractResourceConstraint,AbstractZoneCodeConstraint,BannedResourceConstraint,BindingResourceConstraint,BitTypeConstraint,BitTypeWithExpertiseConstraint,ConnectedConstraint,ExcludingResourceConstraint,MagnetoNodeConstraint,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.IEntityRestrictionResultassessConstraint(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 appropriatequalificationsfor theconstraintsare present.getTitle()Gets the title of the constraint.booleanbooleanisHard()Checks the parameter or directly returnstruewhere this must be the case.booleanisSatisfied(com.dna.jopt.assessment.costassessor.IEntityCostAssessor ca, INode node, ILogicEntityRoute route) Filters out hard constraint mismatches by checking whether aNodedemands aQualificationas ahard constraintbut theResourcedoes not provide this one.voidsetIsHard(boolean isHard) Sets the constraint tohardif the respective parameter is given or returns anIllegalStateExceptionif 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 appropriatequalificationsfor theconstraintsare present.The
boolean truesaves 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 tohardif the respective parameter is given or returns anIllegalStateExceptionif this is expected but not the case.- Parameters:
isHard- the boolean to be set
-
isHard
boolean isHard()Checks the parameter or directly returnstruewhere 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 aNodedemands aQualificationas ahard constraintbut theResourcedoes not provide this one. The idea is to have onlysoft constraintsproblems 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.
Truemeans no problems detected
-
getTitle
String getTitle()Gets the title of the constraint.- Returns:
- the title
-
hasMembers
boolean hasMembers()
-