Class COptQuestOrConstraint

java.lang.Object
com.opttek.optquest.COptQuestCompoundConstraint
com.opttek.optquest.COptQuestOrConstraint

public class COptQuestOrConstraint extends COptQuestCompoundConstraint
The COptQuestOrConstraint class allows you to define a logical "or" relationship among COptQuestConstraint objects. Any number of COptQuestConstraint objects can be added to the COptQuestOrConstraint object.

The COptQuestConstraint objects are added to the the COptQuestOrConstraint object, and the COptQuestOrConstraint object is added to the COptQuestOptimization object using the AddConstraint(COptQuestCompoundConstraint) method. If a solution satisfies any of the constraints in the COptQuestOrConstraint, the solution is constraint feasible for that constraint. If a user has added multiple constraints to an optimization problem, the constraints are ANDed together to determine the feasibility of a solution.
  • Constructor Details

    • COptQuestOrConstraint

      public COptQuestOrConstraint()
      Default constructor
    • COptQuestOrConstraint

      public COptQuestOrConstraint(String name)
      Constructor that assigns a name to the COptQuestOrConstraint
  • Method Details

    • SetName

      public void SetName(String name)
      Assigns a name to the COptQuestOrConstraint
    • GetName

      public String GetName()
      Returns the name assigned to the COptQuestOrConstraint.
    • AddConstraint

      public void AddConstraint(COptQuestConstraint constraint)
      Adds a COptQuestConstraint object to the COptQuestOrConstraint. COptQuestConstraint objects are added to the COptQuestOrConstraint and then the COptQuestOrConstraint object is added to the COptQuestOptimization object. The COptQuestOrConstraint is true (feasible) if Constraint1 or Constraint2 ... or ConstraintN is true.
      Parameters:
      constraint - a COptQuestConstraint object
    • GetNumberOfConstraints

      public int GetNumberOfConstraints()
      Returns the number of COptQuestConstraint objects that were added by calls to AddConstraint(COptQuestConstraint).
      Returns:
      the number of COptQuestConstraint objects in the COptQuestOrConstraint.
    • GetConstraintAt

      public COptQuestConstraint GetConstraintAt(int index)
      Returns the COptQuestConstraint object at the specified index.
      Parameters:
      index - 0 based index
      Returns:
      - COptQuestConstraint object at the specified index