java.lang.Object
com.dna.jopt.member.unit.condition.workinghour.zone.AbstractZoneCodeConstraint<ZoneNumber,ZoneNumberQualification>
com.dna.jopt.member.unit.condition.workinghour.zone.zonenumber.ZoneNumberConstraint
All Implemented Interfaces:
IConstraint, IWorkingHoursLevelConstraint, IZoneCodeConstraint<ZoneNumber,ZoneNumberQualification>, Serializable

public class ZoneNumberConstraint extends AbstractZoneCodeConstraint<ZoneNumber,ZoneNumberQualification>
See Also:
  • Field Details

  • Constructor Details

    • ZoneNumberConstraint

      public ZoneNumberConstraint()
  • Method Details

    • getTitle

      public String getTitle()
      Description copied from interface: IConstraint
      Gets the title of the constraint.
      Returns:
      the title
    • isNumericProximityEnabled

      public boolean isNumericProximityEnabled()
    • setNumericProximityEnabled

      public void setNumericProximityEnabled(boolean numericProximityEnabled)
    • matchZoneCodes

      public boolean matchZoneCodes(ZoneNumberQualification quali, List<ZoneNumber> masterCodes)
    • getNodeZoneQualification

      public Optional<ZoneNumberQualification> getNodeZoneQualification(INode node)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setNoMatchCost

      public static Optional<IViolation> setNoMatchCost(ILogicEntityRoute route, com.dna.jopt.assessment.costadjustment.IEntityCostAdjuster cad, com.dna.jopt.framework.inputplausibility.properties.IPropertyProvider propertyProvider, int zoneNumberDelta, boolean resultRequested)
      Cost and violation for a true mismatch: the node sits in no allowed zone. The delta is a zone-number distance, not a priority difference.
    • setPriorityCost

      public static void setPriorityCost(ILogicEntityRoute route, com.dna.jopt.assessment.costadjustment.IEntityCostAdjuster cad, com.dna.jopt.framework.inputplausibility.properties.IPropertyProvider propertyProvider, int priorityDelta)
      Cost for a matched zone with lower than top priority. The node is allowed, so this is a soft preference: it adds cost only and never raises a violation.
    • matchCodesAndPenalize

      public Optional<IViolation> matchCodesAndPenalize(ZoneNumberQualification quali, List<ZoneNumber> masterCodes, ILogicEntityRoute route, com.dna.jopt.assessment.costadjustment.IEntityCostAdjuster cad, com.dna.jopt.framework.inputplausibility.properties.IPropertyProvider propertyProvider, boolean resultRequested)
    • 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: IConstraint
      Assesses the route, checking if the appropriate qualifications for the constraints are present.

      The boolean true saves the data.

      Parameters:
      en - entity
      route - the iLogicEntityRoute
      node - node
      cad - iEntityCostAdjuster
      ca - ca
      propertyProvider - iPropertyProvider
      resultRequested - the boolean whether to save the results of the route
      Returns:
      Entity Restriction Result