OptimisationConstraintCollection

A collection of variable constraints.

Example

app = cf.GetApplication()
project = app:NewProject()
search = project.Optimisation.Searches:Add(cf.Enums.OptimisationMethodTypeEnum.GridSearch)

    -- Get the number of variable constraints in the collection

count = search.Parameters.Constraints.Count

Usage locations (collections)

The following objects contain the OptimisationConstraintCollection collection:

Property List

Count
The number of OptimisationConstraint items in the collection. (Read only number)

Method List

Add (leftvariable Variable, relationenum OptimisationConstraintRelationEnum, rightvariable Variable)
Add an OptimisationConstraint that defines the relationship between OptimisationVariables.
Item (index number)
Returns the OptimisationConstraint at the given index. (Returns a OptimisationConstraint object.)
Modify (index number, enabled boolean, leftvariable Variable, relationenum OptimisationConstraintRelationEnum, rightvariable Variable)
Modify an OptimisationConstraint.
Remove (index number)
Removes an OptimisationConstraint.

Index List

[number]
Returns the OptimisationConstraint at the given index in the collection. (Read OptimisationConstraint)

Property Details

Count
The number of OptimisationConstraint items in the collection.
Type
number
Access
Read only

Method Details

Add (leftvariable Variable, relationenum OptimisationConstraintRelationEnum, rightvariable Variable)
Add an OptimisationConstraint that defines the relationship between OptimisationVariables.
Input Parameters
leftvariable(Variable)
Left variable.
relationenum(OptimisationConstraintRelationEnum)
Relation.
rightvariable(Variable)
Right variable.
Item (index number)
Returns the OptimisationConstraint at the given index.
Input Parameters
index(number)
The index of the OptimisationConstraint.
Return
OptimisationConstraint
The OptimisationConstraint at the given index.
Modify (index number, enabled boolean, leftvariable Variable, relationenum OptimisationConstraintRelationEnum, rightvariable Variable)
Modify an OptimisationConstraint.
Input Parameters
index(number)
Index.
enabled(boolean)
Enabled.
leftvariable(Variable)
Left variable.
relationenum(OptimisationConstraintRelationEnum)
Relation.
rightvariable(Variable)
Right variable.
Remove (index number)
Removes an OptimisationConstraint.
Input Parameters
index(number)
Index.