Package com.opttek.optquest
Class COptQuestOrConstraint
java.lang.Object
com.opttek.optquest.COptQuestCompoundConstraint
com.opttek.optquest.COptQuestOrConstraint
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
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 Summary
ConstructorDescriptionDefault constructorCOptQuestOrConstraint
(String name) Constructor that assigns a name to the COptQuestOrConstraint -
Method Summary
Modifier and TypeMethodDescriptionvoid
AddConstraint
(COptQuestConstraint constraint) Adds aCOptQuestConstraint
object to the COptQuestOrConstraint.GetConstraintAt
(int index) Returns the COptQuestConstraint object at the specified index.GetName()
Returns the name assigned to the COptQuestOrConstraint.int
Returns the number of COptQuestConstraint objects that were added by calls toAddConstraint(COptQuestConstraint)
.void
Assigns a name to the COptQuestOrConstraint
-
Constructor Details
-
COptQuestOrConstraint
public COptQuestOrConstraint()Default constructor -
COptQuestOrConstraint
Constructor that assigns a name to the COptQuestOrConstraint
-
-
Method Details
-
SetName
Assigns a name to the COptQuestOrConstraint -
GetName
Returns the name assigned to the COptQuestOrConstraint. -
AddConstraint
Adds aCOptQuestConstraint
object to the COptQuestOrConstraint. COptQuestConstraint objects are added to the COptQuestOrConstraint and then the COptQuestOrConstraint object is added to theCOptQuestOptimization
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 toAddConstraint(COptQuestConstraint)
.- Returns:
- the number of COptQuestConstraint objects in the COptQuestOrConstraint.
-
GetConstraintAt
Returns the COptQuestConstraint object at the specified index.- Parameters:
index
- 0 based index- Returns:
- - COptQuestConstraint object at the specified index
-