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 Details

    • AbstractZoneCodeConstraint

      public AbstractZoneCodeConstraint()
  • Method Details

    • hasMembers

      public boolean hasMembers()
      Specified by:
      hasMembers in interface IConstraint
    • setIsHard

      public void setIsHard(boolean isHard)
      Description copied from interface: IConstraint
      Sets the constraint to hard if the respective parameter is given or returns an IllegalStateException if this is expected but not the case.
      Specified by:
      setIsHard in interface IConstraint
      Parameters:
      isHard - the boolean to be set
    • isHard

      public boolean isHard()
      Description copied from interface: IConstraint
      Checks the parameter or directly returns true where this must be the case.
      Specified by:
      isHard in interface IConstraint
      Returns:
      the value of the checked boolean
    • getZoneCodes

      public List<Z> getZoneCodes()
      Specified by:
      getZoneCodes in interface IZoneCodeConstraint<Z extends IZoneCode,Q extends IZoneCodeQualification<Z>>
    • addZoneCode

      public void addZoneCode(Z code)
      Specified by:
      addZoneCode in interface IZoneCodeConstraint<Z extends IZoneCode,Q extends IZoneCodeQualification<Z>>
    • setCodes

      public void setCodes(List<Z> codes)
      Specified by:
      setCodes in interface IZoneCodeConstraint<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 a 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.
      Specified by:
      isSatisfied in interface IConstraint
      Parameters:
      ca - the iEntityCostAssessor
      node - the iNode
      route - the iLogicEntityRoute
      Returns:
      the boolean whether the route is satisfied. True means no problems detected