Interface IConstraint

All Superinterfaces:
Serializable
All Known Subinterfaces:
IConstraintResource, IResourceLevelConstraint, IWorkingHoursLevelConstraint, IZoneCodeConstraint<Z,Q>
All Known Implementing Classes:
AbstractResourceConstraint, AbstractZoneCodeConstraint, BannedResourceConstraint, BindingResourceConstraint, ConnectedConstraint, ExcludingResourceConstraint, MandatoryResourceConstraint, NodeNotRedistributableConstraint, PillarLateConstraint, PillarNotReachableConstraint, PillarResourceAttachedConstraint, PreferredResourceConstraint, ResourceLocationConstraint, TypeConstraint, TypeWithExpertiseConstraint, UKPostCodeConstraint, UnPreferredResource, UnPreferredResourceConstraint, ZoneNumberConstraint

public interface IConstraint extends Serializable
Constraints are limits set on the INode which require the servicing IResource to have the fitting IQualification. This interface provides methods to inquire about certain properties of constraints like the title, whether they are hard constraints or methods to set them hard.
Since:
07/01/2019
Version:
04/10/2019
Author:
DNA
  • Method Summary

    Modifier and Type
    Method
    Description
    com.dna.jopt.assessment.costassessorrestriction.restrictionresult.IEntityRestrictionResult
    assessConstraint(IEntity en, ILogicEntityRoute route, INode node, com.dna.jopt.assessment.costadjustment.IEntityCostAdjuster iEntityCostAdjuster, com.dna.jopt.assessment.costassessor.IEntityCostAssessor ca, com.dna.jopt.framework.inputplausibility.properties.IPropertyProvider iPropertyProvider, boolean resultRequested)
    Assesses the route, checking if the appropriate qualifications for the constraints are present.
    Gets the title of the constraint.
    boolean
     
    boolean
    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
    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.
  • Method Details

    • assessConstraint

      com.dna.jopt.assessment.costassessorrestriction.restrictionresult.IEntityRestrictionResult assessConstraint(IEntity en, ILogicEntityRoute route, INode node, com.dna.jopt.assessment.costadjustment.IEntityCostAdjuster iEntityCostAdjuster, com.dna.jopt.assessment.costassessor.IEntityCostAssessor ca, com.dna.jopt.framework.inputplausibility.properties.IPropertyProvider iPropertyProvider, boolean resultRequested)
      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
      ca - ca
      iEntityCostAdjuster - iEntityCostAdjuster
      iPropertyProvider - iPropertyProvider
      resultRequested - the boolean whether to save the results of the route
      Returns:
      Entity Restriction Result
    • setIsHard

      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.
      Parameters:
      isHard - the boolean to be set
    • isHard

      boolean isHard()
      Checks the parameter or directly returns true where this must be the case.
      Returns:
      the value of the checked boolean
    • isSatisfied

      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. The idea is to have only soft constraints problems in the optimisation which can get solved by adding cost.
      Parameters:
      ca - the iEntityCostAssessor
      node - the iNode
      route - the iLogicEntityRoute
      Returns:
      the boolean whether the route is satisfied. True means no problems detected
    • getTitle

      String getTitle()
      Gets the title of the constraint.
      Returns:
      the title
    • hasMembers

      boolean hasMembers()