To query Optimization Engine results, you have two three options:
Table of Contents |
---|
Using
...
an Evaluator
An evaluation logic is used to access model results from outside of the model itself, for example in another module. The evaluation logics are defined in the Model Class:
...
To query the evaluation, the first step is to use api.model("ModelName")
to get the model and then use the function method evaluate
on it to retrieve an answer based on the given parameters. The code needed to get these results is :
...
The accepted inputs and the corresponding returned results may change, depending on the evaluation logic.
Using Analytics Data Analyzer
By default, the optimization engine creates some tables inside the model. They are:
...
Result tables provide the criteria values and states. Their names are
Result_<Name of the space>_<Name of the criterion>
.Solution tables provide the value finders values and states. Their names are
Solution_<Name of the space>_<Name of the value finder>
.Simulation tables the values of the computed variables, only if the computed variable was marked as exposed in the problem description. Their names are
Simulation_<Name of the space>_<Name of the variable>
.
Fetching the Model Tables
All the model tables described above are accessible from outside of the model itself. It is a way to fetch specific model data from any place in Pricefx. The commands are:
Code Block | ||
---|---|---|
| ||
def myModel = api.model("TheModelUniqueName")
def myTable = myModel.table("TheTableName") |