Class BitTypeWithExpertiseConstraint

java.lang.Object
com.dna.jopt.member.unit.condition.autodict.GenericAbstractAutoDictItemWithMap<TypeLevelRequirement>
com.dna.jopt.member.unit.condition.bittypewithexpertise.BitTypeWithExpertiseConstraint
All Implemented Interfaces:
IAutoDict, IAutoDictWithMap<TypeLevelRequirement>, IConstraint, Serializable

public class BitTypeWithExpertiseConstraint extends GenericAbstractAutoDictItemWithMap<TypeLevelRequirement> implements IConstraint
See Also:
  • Field Details

  • Constructor Details

    • BitTypeWithExpertiseConstraint

      public BitTypeWithExpertiseConstraint()
    • BitTypeWithExpertiseConstraint

      public BitTypeWithExpertiseConstraint(BitSet reqSkills, BitSet reqSkillsWithExpertise, Map<Integer,TypeLevelRequirement> skillExpertiseLevels)
  • Method Details

    • getExtendedClass

      public Class<?> getExtendedClass()
      Specified by:
      getExtendedClass in interface IAutoDict
    • getTitle

      public String getTitle()
      Description copied from interface: IConstraint
      Gets the title of the constraint.
      Specified by:
      getTitle in interface IConstraint
      Returns:
      the title
    • 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
    • isHardLevel

      public boolean isHardLevel()
    • 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
    • setIsHardLevel

      public void setIsHardLevel(boolean isHardLevel)
    • getSkillExpertiseLevels

      public Map<Integer,TypeLevelRequirement> getSkillExpertiseLevels()
    • setSkillCostingModel

      public void setSkillCostingModel(TypeLevelRequirement.SkillInfoCostModel model)
    • getSkillCostingModel

      public TypeLevelRequirement.SkillInfoCostModel getSkillCostingModel()
    • 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
    • isSatisfiedHelper

      public static boolean isSatisfiedHelper(BitSet requiredSkills, Map<Integer,TypeLevelRequirement> skillExpertiseLevels, boolean isHard, boolean isHardLevel, boolean evaluateWithLevels, com.dna.jopt.assessment.costassessor.IEntityCostAssessor ca, INode node, ILogicEntityRoute route)
    • extractMissingBits

      public static List<Integer> extractMissingBits(BitSet required, BitSet actual)
    • 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.

      Specified by:
      assessConstraint in interface IConstraint
      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
    • assessConstraintHelper

      public static com.dna.jopt.assessment.costassessorrestriction.restrictionresult.IEntityRestrictionResult assessConstraintHelper(BitSet requiredSkills, Map<Integer,TypeLevelRequirement> skillExpertiseLevels, boolean isHard, boolean isHardLevel, boolean evaluateWithLevels, Function<List<Integer>,String> violationFunc, TypeLevelRequirement.SkillInfoCostModel myCostingModel, 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)
    • getLevelDelta

      public static int getLevelDelta(TypeLevelOffering info, TypeLevelRequirement requiredInfo)
    • getLevelDeltaMatchCost

      public static double getLevelDeltaMatchCost(TypeLevelOffering info, boolean isMin, int delta, TypeLevelRequirement.SkillInfoCostModel model, com.dna.jopt.framework.inputplausibility.properties.IPropertyProvider propertyProvider, INode node, ILogicEntityRoute route, double globalMaxLevel)
    • toString

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

      public BitSet getTypes()
    • getTypesWithExpertise

      public BitSet getTypesWithExpertise()
    • setTypes

      public void setTypes(BitSet types)
    • hasMembers

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

      public void invokeTypesFromDict(ITypeDictionary dic, Set<String> myDictTypes, Map<String,TypeLevelRequirement> dictTypeMap)
      Specified by:
      invokeTypesFromDict in interface IAutoDictWithMap<TypeLevelRequirement>
    • resetBitTypeNature

      public void resetBitTypeNature()
      Specified by:
      resetBitTypeNature in interface IAutoDict
      Overrides:
      resetBitTypeNature in class GenericAbstractAutoDictItemWithMap<TypeLevelRequirement>