Technical User Reference (Optimization - Price List Impact Simulation)
This project is not yet an accelerator, meaning that you need to manually deploy the logics and ensure that the Price Setting Type (PLPGTT) configuration is correct. The code is available in the Price Setting Simulation repository: https://gitlab.pricefx.eu/accelerators/price-setting-simulation/
This section details the ModelClass and the logics that define the Price List Impact Simulation feature. For each step, its aim, outputs, and the main reasons to modify the logics are explained.
In this section:
Model Class Structure
The Price Setting Simulation (PSS) Model Class organizes a list of logics to create the model architecture. It is a JSON file that refers to some logics and it is transformed into an optimized UI in the Pricefx platform. See Models and Model Classes for more information.
The general architecture of the Price Setting Simulation Model Class is:
It defines two steps:
Input – Settings of the simulation.
Results – Simulation itself and its results.
There are two types of logics: calculation
, which writes tables in the model, and evaluation
, whose purpose is only to display some results. The standard Model Class definition is documented in Model Class (MC).
The logics of the Model Class follow a naming convention. They are all prefixed by PSS_All_
, then their type is indicated by Eval
or Calc
. The configurations are suffixed by _Configurator
.
Library
The logic is PSS_Lib.
Input Step
There is no calculation logic in this step, and there is one tab with related configurator logic PSS_All_Eval_Price_List_Configurator.
Results Step
This step performs first a sequence of calculations:
The aggregation of the data is done by PSS_All_Calc_Aggregating.
The data is checked by PSS_All_Calc_Check_Data.
The tables that are required to instantiate the Optimization Engine are stored by the logic PSS_All_Calc_Store_Problem.
The Optimization Engine is set and triggered by PSS_All_Calc_Run_Simulation.
After its run, some postprocessing tasks are done to provide good inputs to the dashboards, in PSS_All_Calc_Prepare_Results.
Then, three tabs are displayed, based on these logics:
The Impact tab is based on PSS_All_Eval_Impact.
The Details tab is based on PSS_All_Eval_Details.
The Analysis tab is based on PSS_All_Eval_Analysis and PSS_All_Eval_Analysis_Configurator.
Calculation: Aggregating
The logic is PSS_All_Calc_Aggregating.
Calculation: Check Data
The logic is PSS_All_Calc_Check_Data.
Calculation: Store Problem Tables
The logic is PSS_All_Calc_Store_Problem.
Calculation: Run Simulation
The logic is PSS_All_Calc_Run_Simulation.
Calculation: Prepare Results
The logic is PSS_All_Calc_Prepare_Results.
Impact Tab
The logic is PSS_All_Eval_Impact.
Details Tab
The logic is PSS_All_Eval_Details.
Analysis Tab
The logics are PSS_All_Eval_Analysis and PSS_All_Eval_Analysis_Configurator.
Configuration in PLPGTT
In order to enable the simulation for a PL/LPG, we need to link them together. This is done by setting a specific “Contextual Actions Configuration” in the correct Price Setting Type.
The field is named contextualActions
and is a JSON following this model:
[
{
"targetPage": "newModelPage",
"targetPageEntityType": "PriceSettingSimulation",
"targetPageTarget": "drawer",
"targetPageInputs": {
"input": {
"price_list": {
"SourceTypedId": "{typedId}",
"secondaryKeyColumnName": "Country"
}
}
}
}
]
It defines:
The Model Class to use for the simulation in the
targetPageEntityType
.The view type of its first step for configuration from the PL/LPG list in the
targetPageTarget
– here it is a"drawer"
.Matching between the PL information and the automatic setting of the inputs in the drawer in the
targetPageInputs
. Here we set the inputsSourceTypedId
andsecondaryKeyColumnName
of the tabprice_list
, which is the only tab of the first step of the Model Class.
Creation from a Model Object List
Finally, note that the Simulation can be instantiated from the Model Objects list, allowing the creation of several simulations per a Price List and making the development and debugging easier. To do so, simply create a new Model Object using the correct Model Class (more details in Models). The first step will then allow configuring the input to use for the simulation (PL, LPG and optional secondary keys). Be sure that when you add inputs in the first step, they are both usable from the Models view and from the drawer in the PL/LPG simulation option and auto-filled with the PL data when needed. For that two actions are needed:
Updating the logic building the user inputs (refer to Input Step).
Updating the mapping in the drawer (refer to the previous paragraph Configuration in PLPGTT).