public abstract class AbstractZoneCodeConstraint<Z extends IZoneCode,Q extends IZoneCodeQualification<Z>> extends Object implements IZoneCodeConstraint<Z,Q>
Constructor and Description |
---|
AbstractZoneCodeConstraint() |
Modifier and Type | Method and Description |
---|---|
void |
addZoneCode(Z code) |
List<Z> |
getZoneCodes() |
boolean |
hasMembers() |
boolean |
isHard()
Checks the parameter or directly returns
true 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 a
Node demands a Qualification as a hard constraint but the Resource does not provide this one. |
void |
setCodes(List<Z> codes) |
void |
setIsHard(boolean isHard)
Sets the constraint to
hard if the respective parameter is given or returns an IllegalStateException if this is expected but not the case. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getNodeZoneQualification, matchCodesAndPenalize, matchZoneCodes
assessConstraint, getTitle
public boolean hasMembers()
hasMembers
in interface IConstraint
public void setIsHard(boolean isHard)
IConstraint
hard
if the respective parameter is given or returns an IllegalStateException
if this is expected but not the case.setIsHard
in interface IConstraint
isHard
- the boolean to be setpublic boolean isHard()
IConstraint
true
where this must be the case.isHard
in interface IConstraint
public List<Z> getZoneCodes()
getZoneCodes
in interface IZoneCodeConstraint<Z extends IZoneCode,Q extends IZoneCodeQualification<Z>>
public void addZoneCode(Z code)
addZoneCode
in interface IZoneCodeConstraint<Z extends IZoneCode,Q extends IZoneCodeQualification<Z>>
public void setCodes(List<Z> codes)
setCodes
in interface IZoneCodeConstraint<Z extends IZoneCode,Q extends IZoneCodeQualification<Z>>
public boolean isSatisfied(com.dna.jopt.assessment.costassessor.IEntityCostAssessor ca, INode node, ILogicEntityRoute route)
IConstraint
Node
demands a Qualification
as a hard constraint
but the Resource
does not provide this one.
The idea is to have only soft constraints
problems in the optimisation which can get
solved by adding cost.isSatisfied
in interface IConstraint
ca
- the iEntityCostAssessornode
- the iNoderoute
- the iLogicEntityRouteTrue
means no problems detectedCopyright © 2017–2023 DNA Evolutions GmbH. All rights reserved.