Class COptQuestRequirement

java.lang.Object
com.opttek.optquest.COptQuestRequirement
Direct Known Subclasses:
COptQuestDualRequirement, COptQuestLowerRequirement, COptQuestUpperRequirement

public abstract class COptQuestRequirement extends Object
The COptQuestRequirement class is a pure virtual class that you use to define a non-linear constraint. You compute the value of the requirement and the OptQuest Engine checks for feasibility using the value you computed and the bounds you defined. The requirement is feasible if the value you computed is between the lower bound and upper bound of the requirement.

You would compute a value for the COptQuestRequirement object in the Evaluate(COptQuestSolution) method and then set the value using the SetRequirementValue(COptQuestRequirement, double) method.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor
    COptQuestRequirement(double lower, double upper)
    Constructor that sets the lower and upper bound of the requirement.
    COptQuestRequirement(String name, double lower, double upper)
    Constructor that assigns a name to the requirement and sets the lower and upper bound of the requirement.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    double
    Returns the value of the requirement's lower bound
    Returns the name of the requirement
    double
    Returns the acceptable error set by the call to SetReplicationConfidence(), as a fraction of the mean of the replications.
    int
    Returns the confidence level set by the call to SetReplicationConfidence().
    int
    Returns the statistic defined by the SetReplicationStatistic() method.
    double
    Returns the statistic value defined by the SetReplicationStatistic() method.
    double
    Returns the value of the requirement's upper bound
    int
     
    boolean
     
    boolean
    Returns true if the requirement has been set as a goal rather than a hard requirement.
    void
    SetGoal(boolean goalValue)
    Makes the requirement a goal where the solution is not marked as infeasible.
    void
    setHasUserVariables(boolean hasUserVariables)
     
    void
    SetLowerBound(double lowerBound)
    Sets the lower bound to the input value
    void
    Assigns a name to the requirement
    void
    SetReplicationConfidence(int level, double errPercent)
    Sets the values used for confidence testing.
    void
    SetReplicationStatistic(int statistic, double statisticValue)
    When running multiple replications, you can define a statistic which is used to calculate the requirement value using the values of the replications.
    void
    SetTolerance(double tolerance)
     
    void
    SetUpperBound(double upperBound)
    Sets the upper bound to the input value

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • COptQuestRequirement

      public COptQuestRequirement(double lower, double upper)
      Constructor that sets the lower and upper bound of the requirement.
      Parameters:
      lower - a value between -pow(2,31) and +pow(2,31)-1
      upper - a value between -pow(2,31) and +pow(2,31)-1
    • COptQuestRequirement

      public COptQuestRequirement(String name, double lower, double upper)
      Constructor that assigns a name to the requirement and sets the lower and upper bound of the requirement.
      Parameters:
      name - - alphanumeric name
      lower - a value between -pow(2,31) and +pow(2,31)-1
      upper - a value between -pow(2,31) and +pow(2,31)-1
    • COptQuestRequirement

      public COptQuestRequirement()
      Default constructor
  • Method Details

    • SetName

      public void SetName(String name)
      Assigns a name to the requirement
      Parameters:
      name - alphanumeric name
    • GetName

      public String GetName()
      Returns the name of the requirement
      Returns:
      alphanumeric name assigned to the requirement
    • SetGoal

      public void SetGoal(boolean goalValue)
      Makes the requirement a goal where the solution is not marked as infeasible. A solution that satisfies the bounds of the requirement is considered better than a solution that violates the bounds.
    • IsGoal

      public boolean IsGoal()
      Returns true if the requirement has been set as a goal rather than a hard requirement.
      Returns:
      true if the requirement bound is a target goal.
    • hasUserVariables

      public boolean hasUserVariables()
    • setHasUserVariables

      public void setHasUserVariables(boolean hasUserVariables)
    • SetLowerBound

      public void SetLowerBound(double lowerBound)
      Sets the lower bound to the input value
      Parameters:
      lowerBound - a value between -pow(2,31) and +pow(2,31)-1
    • SetUpperBound

      public void SetUpperBound(double upperBound)
      Sets the upper bound to the input value
      Parameters:
      upperBound - a value between -pow(2,31) and +pow(2,31)-1
    • GetLowerBound

      public double GetLowerBound()
      Returns the value of the requirement's lower bound
      Returns:
      the value of the lower bound
    • GetUpperBound

      public double GetUpperBound()
      Returns the value of the requirement's upper bound
      Returns:
      the value of the upper bound
    • SetReplicationStatistic

      public void SetReplicationStatistic(int statistic, double statisticValue) throws COptQuestException
      When running multiple replications, you can define a statistic which is used to calculate the requirement value using the values of the replications. The statistic OCLP_PERCENTILE requires the statisticValue to be set. This value is ignored for all other statistics.
      Parameters:
      statistic -
      • OCLP_MEAN = 1
      • OCLP_MEDIAN = 2
      • OCLP_PERCENTILE = 3
      • OCLP_STDDEV = 4
      • OCLP_VARIANCE = 6
      • OCLP_COEFFOFVAR = 8
      • OCLP_MIN = 14
      • OCLP_MAX = 15
      • OCLP_SUM = 16
      statisticValue - - target value for OCLP_PERCENTILE
      Throws:
      COptQuestException - if a problem is encountered
    • GetReplicationStatistic

      public int GetReplicationStatistic()
      Returns the statistic defined by the SetReplicationStatistic() method.
      Returns:
      statistic
      • OCLP_MEAN = 1
      • OCLP_MEDIAN = 2
      • OCLP_PERCENTILE = 3
      • OCLP_STDDEV = 4
      • OCLP_VARIANCE = 6
      • OCLP_COEFFOFVAR = 8
      • OCLP_MIN = 14
      • OCLP_MAX = 15
      • OCLP_SUM = 16
    • GetReplicationStatisticValue

      public double GetReplicationStatisticValue()
      Returns the statistic value defined by the SetReplicationStatistic() method. The statistic OCLP_PERCENTILE requires the statisticValue to be set.
      Returns:
      the target value for OCLP_PERCENTILE. Returns 0 for all other statistics.
    • GetReplicationConfidenceLevel

      public int GetReplicationConfidenceLevel()
      Returns the confidence level set by the call to SetReplicationConfidence().
      Returns:
      1 = 80%, 2 = 90%, 3 - 95%, 4 = 98%, 5 = 99%, 6 = 99.9%
    • GetReplicationConfidenceErrorPercent

      public double GetReplicationConfidenceErrorPercent()
      Returns the acceptable error set by the call to SetReplicationConfidence(), as a fraction of the mean of the replications.
      Returns:
      a fraction greater than 0 and less than 1.
    • SetTolerance

      public void SetTolerance(double tolerance)
    • SetReplicationConfidence

      public void SetReplicationConfidence(int level, double errPercent)
      Sets the values used for confidence testing. Confidence testing is only available when the replication statistic is the mean value, COptQuestOptimization.OCLP_MEAN For a requirement, the confidence type 1 is always used (stop replications after minimum replications when confidence level or maximum replications is reached).
      Parameters:
      level -
      • 1 = 80%
      • 2 = 90%
      • 3 - 95%
      • 4 = 98%
      • 5 = 99%
      • 6 = 99.9%
      errPercent - the acceptable error, as a fraction of the mean of the replications. It must be greater than 0 and less than 1. For 5 percent, pass 0.05.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object