UseUpperBound: Boolean;
UseUpperBound: boolean;
The UseUpperBound property determines whether to take into account upper constraint for the controlling variable.
Available values:
True. Upper constraint of controlling variable is taken into account. To set constraint value, use the IMsNonLinearControlFormulaTerm.UpperBound property.
False. The default value. Upper constraint of controlling variable is not taken into account.
Executing the example requires that the repository contains a modeling container with the MS identifier. This container must include an optimal control problem with the CONTROL_PROBLEM identifier that is calculated by the quadratic programming method. Controlling variables must be set for the problem.
Add links to the Metabase, Ms system assemblies.
Sub UserProc;
Var
mb: IMetabase;
ms: IMetabaseObjectDescriptor;
probl: IMsProblem;
controlProbl: IMsControlProblem;
controlTerm: IMsNonLinearControlFormulaTerm;
Begin
// Get current repository
mb := MetabaseClass.Active;
// Get modeling container
ms := mb.ItemById("MS");
// Get modeling problem
probl := mb.ItemByIdNamespace("CONTROL_PROBLEM", ms.Key).Edit As IMsProblem;
controlProbl := probl.Details As IMsControlProblem;
// Get the first controlling variable
controlTerm := controlProbl.ControlVariables.Item(0) As IMsNonLinearControlFormulaTerm;
// Set controlling variable limit values
controlTerm.UseLowerBound := True;
controlTerm.LowerBound := -1;
controlTerm.UseUpperBound := True;
controlTerm.UpperBound := 1;
// Save changes
(probl As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the values of the lower and upper constraints are determined for the first controlling variable.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Ms;
…
Public Shared Sub Main(Params: StartParams);
Var
mb: IMetabase;
ms: IMetabaseObjectDescriptor;
probl: IMsProblem;
controlProbl: IMsControlProblem;
controlTerm: IMsNonLinearControlFormulaTerm;
Begin
// Get current repository
mb := Params.Metabase;
// Get modeling container
ms := mb.ItemById["MS"];
// Get modeling problem
probl := mb.ItemByIdNamespace["CONTROL_PROBLEM", ms.Key].Edit() As IMsProblem;
controlProbl := probl.Details As IMsControlProblem;
// Get the first controlling variable
controlTerm := controlProbl.ControlVariables.Item[0] As IMsNonLinearControlFormulaTerm;
// Set controlling variable limit values
controlTerm.UseLowerBound := True;
controlTerm.LowerBound := -1;
controlTerm.UseUpperBound := True;
controlTerm.UpperBound := 1;
// Save changes
(probl As IMetabaseObject).Save();
End Sub;
See also: