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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addZoneCode
(Z code) 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
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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.dna.jopt.member.unit.condition.IConstraint
assessConstraint, getTitle
Methods 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:
hasMembers
in interfaceIConstraint
-
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
-
getZoneCodes
- Specified by:
getZoneCodes
in interfaceIZoneCodeConstraint<Z extends IZoneCode,
Q extends IZoneCodeQualification<Z>>
-
addZoneCode
- Specified by:
addZoneCode
in interfaceIZoneCodeConstraint<Z extends IZoneCode,
Q extends IZoneCodeQualification<Z>>
-
setCodes
- Specified by:
setCodes
in 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: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
-