Optimizer.AddConstraint(String, Variable, Variable, Variable, Variable) Method

Top 

Description

Creates a new lower bound, upper bound, scale, and cycle range entry in the Optimizer.Constraints array associated with the specified label.

 

Timing Precision Mode

This page describes functionality in nanosecond timing precision mode.

Click here to see the documentation for this object in millisecond timing precision mode.

 

Method Signature

Optimizer.AddConstraint(

String label,


Variable lowerBound,


Variable upperBound,


Variable scale,


Variable cyclicRange)

 

 

Arguments

label


Description:

The label for this optimization constraint.

 

 

lowerBound


Description:

Lower bound associated with the state constraint.

 

 

upperBound


Description:

Upper bound associated with the state constraint.

 

 

scale


Description:

The scale used for the optimization constraint.

Valid Range:

scale ≥ 0

 

 

cyclicRange


Description:

Defines the cyclic range of the constraint. For example, an angular constraint in units of degrees could benefit from using a cyclic range of 360. Similarly, a day of week constraint could benefit from using a cyclic range of 7.

Valid Range:

cyclicRange ≥ 0

 

 

 

Return Value

Type:

number

 

 

Returns the updated number of constraints.

 

Syntax

myVariable1 = myOptimizer1.AddConstraint(myString1, myVariable2, myVariable3, myVariable4, myVariable5);

 

 

See also

Optimizer Object

Optimizer.AddConstraint