Multi-Scenario Attributes#

These are the attributes for setting and querying multiple scenarios (refer to this section for additional information on multi-scenario optimization).

ScenNLB#

  • Type: double

  • Modifiable: Yes

When the model has multiple scenarios, this attribute is used to query or modify changes of the variable lower bounds in scenario \(n\) w.r.t. the base model. You set \(n\) using the ScenarioNumber parameter.

If an element of this array attribute is set to the undefined value (GRB_UNDEFINED in C and C++, or GRB.UNDEFINED in Java, .NET, and Python), it means that the corresponding value in the scenario is identical to the one in the base model.

The number of scenarios in the model can be queried (or modified) using the NumScenarios attribute.

Please refer to the Multiple Scenarios discussion for more information.

For examples of how to query or modify attributes, refer to our Attribute Examples.

ScenNUB#

  • Type: double

  • Modifiable: Yes

When the model has multiple scenarios, this attribute is used to query or modify changes of the variable upper bounds in scenario \(n\) w.r.t. the base model. You set \(n\) using the ScenarioNumber parameter.

If an element of this array attribute is set to the undefined value (GRB_UNDEFINED in C and C++, or GRB.UNDEFINED in Java, .NET, and Python), it means that the corresponding value in the scenario is identical to the one in the base model.

The number of scenarios in the model can be queried (or modified) using the NumScenarios attribute.

Please refer to the Multiple Scenarios discussion for more information.

For examples of how to query or modify attributes, refer to our Attribute Examples.

ScenNObj#

  • Type: double

  • Modifiable: Yes

When the model has multiple scenarios, this attribute is used to query or modify changes of the variable objective coefficients in scenario \(n\) w.r.t. the base model. You set \(n\) using the ScenarioNumber parameter.

If an element of this array attribute is set to the undefined value (GRB_UNDEFINED in C and C++, or GRB.UNDEFINED in Java, .NET, and Python), it means that the corresponding value in the scenario is identical to the one in the base model.

The number of scenarios in the model can be queried (or modified) using the NumScenarios attribute.

Please refer to the Multiple Scenarios discussion for more information.

For examples of how to query or modify attributes, refer to our Attribute Examples.

ScenNRHS#

  • Type: double

  • Modifiable: Yes

When the model has multiple scenarios, this attribute is used to query or modify changes of the linear constraint right-hand sides in scenario \(n\) w.r.t. the base model. You set \(n\) using the ScenarioNumber parameter.

If an element of this array attribute is set to the undefined value (GRB_UNDEFINED in C and C++, or GRB.UNDEFINED in Java, .NET, and Python), it means that the corresponding value in the scenario is identical to the one in the base model.

The number of scenarios in the model can be queried (or modified) using the NumScenarios attribute.

Please refer to the Multiple Scenarios discussion for more information.

For examples of how to query or modify attributes, refer to our Attribute Examples.

ScenNName#

  • Type: string

  • Modifiable: Yes

When the model has multiple scenarios, this attribute is used to query or modify the name for scenario \(n\). You set \(n\) using the ScenarioNumber parameter.

The number of scenarios in the model can be queried (or modified) using the NumScenarios attribute.

Please refer to the Multiple Scenarios discussion for more information.

For examples of how to query or modify attributes, refer to our Attribute Examples.

ScenNObjBound#

  • Type: double

  • Modifiable: No

When the model has multiple scenarios, this attribute is used to query the objective bound for scenario \(n\). You set \(n\) using the ScenarioNumber parameter.

The number of scenarios in the model can be queried (or modified) using the NumScenarios attribute.

Please refer to the Multiple Scenarios discussion for more information.

For examples of how to query or modify attributes, refer to our Attribute Examples.

ScenNObjVal#

  • Type: double

  • Modifiable: No

When the model has multiple scenarios, this attribute is used to query the objective value of the current solution for scenario \(n\). You set \(n\) using the ScenarioNumber parameter. If no solution is available, this returns GRB_INFINITY (for a minimization objective).

The number of scenarios in the model can be queried (or modified) using the NumScenarios attribute.

Please refer to the Multiple Scenarios discussion for more information.

For examples of how to query or modify attributes, refer to our Attribute Examples.

ScenNX#

  • Type: double

  • Modifiable: No

When the model has multiple scenarios, this attribute is used to query the variable value in the current solution of scenario \(n\). You set \(n\) using the ScenarioNumber parameter.

The number of scenarios in the model can be queried (or modified) using the NumScenarios attribute.

Please refer to the Multiple Scenarios discussion for more information.

For examples of how to query or modify attributes, refer to our Attribute Examples.

NumScenarios#

  • Type: int

  • Modifiable: Yes

Number of scenarios in the model. Modifying this attribute changes the number: decreasing it discards existing scenarios; increasing it creates new scenarios (initialized to have no changes w.r.t. the base model); setting it to 0 discards all scenarios so that the base model is no longer a multi-scenario model.

You can use the ScenarioNumber parameter, in conjunction with multi-scenario attributes (ScenNLB, ScenNUB, ScenNObj, ScenNRHS, ScenNName, etc.), to query or modify attributes for different scenarios. The value of ScenarioNumber should always be less than NumScenarios.

Please refer to the Multiple Scenarios discussion for more information.

For examples of how to query or modify attributes, refer to our Attribute Examples.