OptimisationConstraint

Constraint.

Example

application = cf.Application.GetInstance()
project = application:NewProject()

    -- Add an optimisation search with the some variables

startFreq = project.Definitions.Variables:Add("freqStart", 1e6)
endFreq = project.Definitions.Variables:Add("freqEnd", 10e6)
search = project.Optimisation.Searches:Add(cf.Enums.OptimisationMethodTypeEnum.GridSearch)
searchVar = search.Parameters.Variables:append()
searchVar.Variable = startFreq
searchVar.MinimumValue = 1e6
searchVar.MaximumValue = 10e6
searchVar1 = search.Parameters.Variables:append()
searchVar1.Variable = endFreq
searchVar1.MinimumValue = 10e6
searchVar1.MaximumValue = 100e6

    -- Add a variable constraint to the optimisation search

optimisationConstraint = search.Parameters.Constraints:append()
optimisationConstraint.LeftVariable = startFreq
optimisationConstraint.Relation = cf.Enums.OptimisationConstraintRelationEnum.Less
optimisationConstraint.RightVariable = endFreq

    -- Modify the constraint relation between the two variables

search.Parameters.Constraints[1].Relation = cf.Enums.OptimisationConstraintRelationEnum.LessOrEqual

Inheritance

The OptimisationConstraint object is derived from the CompositeValue object.

Usage locations

The OptimisationConstraint object can be accessed from the following locations:

Property List

Enabled
Enables the constraint for use in the optimisation. (Read/Write boolean)
LeftVariable
Left variable. (Read/Write Variable)
Relation
Constraint between two variables. (Read/Write OptimisationConstraintRelationEnum)
RightVariable
Right variable. (Read/Write Variable)

Property Details

Enabled
Enables the constraint for use in the optimisation.
Type
boolean
Access
Read/Write
LeftVariable
Left variable.
Type
Variable
Access
Read/Write
Relation
Constraint between two variables.
Type
OptimisationConstraintRelationEnum
Access
Read/Write
RightVariable
Right variable.
Type
Variable
Access
Read/Write