Setting Up the Optimization Model
When setting up an optimization model in the RASON Modeling language, your model will typically contain
these essential segments:
- modelName: RASON supports both named and unnamed models. A named model includes the modelName: "name" property in the text. A model name must be a string that can be URL-encoded and must be unique among models within a user's account. It is strongly recommended that a model be named to allow for easy recognition and retrieval when multiple models, instances and versions exist in a user's account. See the chapter Using the REST API for more information on named and unnamed models.
- modelType: This property defines the model type as optimization, simulation, datamining or calculation within the RASON script and is used in three ways.
- data: Where arrays to be used in the calculation of constraints and the objective function will be defined. In this example we define 6 arrays to hold data for our objective function (the profit array) and our constraints (the remaining arrays: chassis, lcdScreen, speaker, powerSupply and electronics).
- variables: Where the decision variables will be defined. In this example, we will define three variables in the X array, each with a lower bound of 0.
- objective: Where the objective function to be maximized or minimized will be defined. In this example, we will maximize profit by multiplying the decision variables by the profit margin for each product.
Note: The optional "variableBounds" section allows subsets of a variable block to be designated as integer, binary, all different or semi-continuous; enhancing the flexibility and applicability of optimization models in RASON. See the Variable Bounds section within the RASON Reference Guide for more details.
- constraints: Where the constraints will be defined. In this example, we define five constraints to ensure that the number of parts used are less than the number of parts in inventory.
Within this overall framework, you have a great deal of flexibility in choosing how to define and calculate your objective function and constraints. For example, the objective function will ultimately depend on the decision variable cells, but you don't have to calculate the entire function all at once. You can use any number of calculations in the data section to compute intermediate results and use these to calculate the objective function or the constraints.
The RASON modeling language supports all but a few of Excel's functions which means that you can write a linear expression easily with Excel's SUMPRODUCT function, or you can use + and * operators. You can define arrays and use Excel functions that return vector and matrix results and access your data from within Excel or a database.
|