Class AbstractZoneCodeConstraint<Z extends IZoneCode,Q extends IZoneCodeQualification<Z>>
java.lang.Object
com.dna.jopt.member.unit.condition.workinghour.zone.AbstractZoneCodeConstraint<Z,Q>
- All Implemented Interfaces:
IConstraint,IWorkingHoursLevelConstraint,IZoneCodeConstraint<Z,,Q> Serializable
- Direct Known Subclasses:
UKPostCodeConstraint,ZoneNumberConstraint
public abstract class AbstractZoneCodeConstraint<Z extends IZoneCode,Q extends IZoneCodeQualification<Z>>
extends Object
implements IZoneCodeConstraint<Z,Q>
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddZoneCode(Z code) 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.voidvoidsetIsHard(boolean isHard) Sets the constraint tohardif the respective parameter is given or returns anIllegalStateExceptionif this is expected but not the case.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.dna.jopt.member.unit.condition.IConstraint
assessConstraint, getTitleMethods inherited from interface com.dna.jopt.member.unit.condition.workinghour.zone.IZoneCodeConstraint
getNodeZoneQualification, matchCodesAndPenalize, matchZoneCodes
-
Constructor Details
-
AbstractZoneCodeConstraint
public AbstractZoneCodeConstraint()
-
-
Method Details
-
hasMembers
public boolean hasMembers()- Specified by:
hasMembersin interfaceIConstraint
-
setIsHard
public void setIsHard(boolean isHard) Description copied from interface:IConstraintSets the constraint tohardif the respective parameter is given or returns anIllegalStateExceptionif this is expected but not the case.- Specified by:
setIsHardin interfaceIConstraint- Parameters:
isHard- the boolean to be set
-
isHard
public boolean isHard()Description copied from interface:IConstraintChecks the parameter or directly returnstruewhere this must be the case.- Specified by:
isHardin interfaceIConstraint- Returns:
- the value of the checked boolean
-
getZoneCodes
- Specified by:
getZoneCodesin interfaceIZoneCodeConstraint<Z extends IZoneCode,Q extends IZoneCodeQualification<Z>>
-
addZoneCode
- Specified by:
addZoneCodein interfaceIZoneCodeConstraint<Z extends IZoneCode,Q extends IZoneCodeQualification<Z>>
-
setCodes
- Specified by:
setCodesin interfaceIZoneCodeConstraint<Z extends IZoneCode,Q extends IZoneCodeQualification<Z>>
-
isSatisfied
public boolean isSatisfied(com.dna.jopt.assessment.costassessor.IEntityCostAssessor ca, INode node, ILogicEntityRoute route) Description copied from interface:IConstraintFilters 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.- Specified by:
isSatisfiedin interfaceIConstraint- Parameters:
ca- the iEntityCostAssessornode- the iNoderoute- the iLogicEntityRoute- Returns:
- the boolean whether the route is satisfied.
Truemeans no problems detected
-