Class UKPostCodeConstraint
java.lang.Object
com.dna.jopt.member.unit.condition.workinghour.zone.AbstractZoneCodeConstraint<UKPostCode,UKPostCodeQualification>
com.dna.jopt.member.unit.condition.workinghour.zone.ukpostcode.UKPostCodeConstraint
- All Implemented Interfaces:
IConstraint,IWorkingHoursLevelConstraint,IZoneCodeConstraint<UKPostCode,,UKPostCodeQualification> Serializable
public class UKPostCodeConstraint
extends AbstractZoneCodeConstraint<UKPostCode,UKPostCodeQualification>
This class allows to add
Constraints to Nodes so that only Resources from
certain UK postcode areas are allowed to give them service.- Since:
- 13/09/2019
- Version:
- 13/09/2019
- Author:
- DNA
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.dna.jopt.assessment.costassessorrestriction.restrictionresult.IEntityRestrictionResultassessConstraint(IEntity en, ILogicEntityRoute route, INode node, com.dna.jopt.assessment.costadjustment.IEntityCostAdjuster cad, com.dna.jopt.assessment.costassessor.IEntityCostAssessor ca, com.dna.jopt.framework.inputplausibility.properties.IPropertyProvider propertyProvider, boolean resultRequested) Assesses the route, checking if the appropriatequalificationsfor theconstraintsare present.getTitle()Gets the title of the constraint.matchCodesAndPenalize(UKPostCodeQualification quali, List<UKPostCode> masterCodes, ILogicEntityRoute route, com.dna.jopt.assessment.costadjustment.IEntityCostAdjuster cad, com.dna.jopt.framework.inputplausibility.properties.IPropertyProvider propertyProvider, boolean resultRequested) booleanmatchZoneCodes(UKPostCodeQualification quali, List<UKPostCode> masterCodes) Methods inherited from class com.dna.jopt.member.unit.condition.workinghour.zone.AbstractZoneCodeConstraint
addZoneCode, getZoneCodes, hasMembers, isHard, isSatisfied, setCodes, setIsHard
-
Field Details
-
MY_TITLE
- See Also:
-
MAX_ASSUMED_SECTOR_DELTA
public static final int MAX_ASSUMED_SECTOR_DELTA- See Also:
-
MAX_ASSUMED_DISTRICT_DELTA
public static final int MAX_ASSUMED_DISTRICT_DELTA- See Also:
-
-
Constructor Details
-
UKPostCodeConstraint
public UKPostCodeConstraint()
-
-
Method Details
-
getTitle
Description copied from interface:IConstraintGets the title of the constraint.- Returns:
- the title
-
assessConstraint
public com.dna.jopt.assessment.costassessorrestriction.restrictionresult.IEntityRestrictionResult assessConstraint(IEntity en, ILogicEntityRoute route, INode node, com.dna.jopt.assessment.costadjustment.IEntityCostAdjuster cad, com.dna.jopt.assessment.costassessor.IEntityCostAssessor ca, com.dna.jopt.framework.inputplausibility.properties.IPropertyProvider propertyProvider, boolean resultRequested) Description copied from interface:IConstraintAssesses the route, checking if the appropriatequalificationsfor theconstraintsare present.The
boolean truesaves the data.- Parameters:
en- entityroute- the iLogicEntityRoutenode- nodecad- iEntityCostAdjusterca- capropertyProvider- iPropertyProviderresultRequested- the boolean whether to save the results of the route- Returns:
- Entity Restriction Result
-
matchZoneCodes
-
matchCodesAndPenalize
public Optional<IViolation> matchCodesAndPenalize(UKPostCodeQualification quali, List<UKPostCode> masterCodes, ILogicEntityRoute route, com.dna.jopt.assessment.costadjustment.IEntityCostAdjuster cad, com.dna.jopt.framework.inputplausibility.properties.IPropertyProvider propertyProvider, boolean resultRequested) -
getNodeZoneQualification
-