How to: Create a Goal
You can add a goal to a model to configure how it should be optimized. For example, you can add a goal to minimize cost or maximize profit.
To add a goal
-
In the Modeling Pane, click the Goals tab.
-
Click New.
-
In the Name field, type a unique name.
-
In the Kind field, choose Minimize or Maximize.
-
In the Expression field, type the OML code to express the goal. The following code example demonstrates a goal. This goal minimizes the cost of the aircraft routes by using the Sum and ForEach expressions to calculate the possible routes with different types of aircraft.
Sum[ {iter5, Aircraft}, Plus[Foreach[ {iter6, Routes}, Cost[iter5, iter6] * Allocation[iter5, iter6] ], Foreach[ {iter7, Routes}, Bumped[iter7] * RefundAmount[iter7] ]] ] -
(Optional) In the Description field, type a comment that describes the goal.
Note
|
|---|
|
This example is based on the stochastic model in the Excel Samples for Solver Foundation that demonstrates how to allocate aircraft to different routes. |
Note