Simulation result definition


<< Click to show table of contents >>

Navigation:  Connection to Plant Simulation >

Simulation result definition


Simulation results are gathered and encoded for transfer within [SimJSONCtrl.]SimJSONResult.

The preferred way to define simulation results would be within the subclass within SimUIObjects_Public to have the settings transferable to other plant simulation models.

Within the main workflow, the simulation model is gathering results. At the end of the simulation run these results can be transferred to the SimUI-Frontend.

Besides result tables, the Plant Simulation Model can also define how table results are visualized.

This can be done within a normalized form:

•Results are transferred within tables (at least 1 column and 1 row, have to be with column index in Plant Simulation)

•Visualization is structured in sections and widgets

•A widget is a visualization from for a result data table (type=”dataGrid”), which can be

oData table visualization

oBar chart visualization based on result table

oOther visualizations…

oSeveral widgets can reference the same result data table (“node”)

•A Section is group for widgets

•Both sections and widgets are expandable in the frontend

 

Contents

1. Registering of simulation result tables

2. Definition of simulation result view sections and widgets

 2.1 Widget definition

 2.2 HTML-Result definition

 

 

1. Registering of simulation result tables

Result tables can be statically defined within tblStatisticDataTableDef with following attributes:

•nodeName: unique result data (table) node name

•active: table will be exported for results

•category: stattable (static)

•statisticsTable: string-path to either a table object within a frame or a valid subtable path (incl. [..]) within a table object

•adjustUserMethod: object path to a user method to be executed after transfer into the result frame SimJSONResult

 

Besides static definition, a flexible way of adding simulation results would be through the interface method m_AddStatisticTableDef with parameter for the same table columns.

In the workflow to dynamically add a statistic table, the statistic table node should be added before the widget definition which references to the result table node.

 

 

2. Definition of simulation result view sections and widgets

Result view sections are defined within the table tblResultViewSectionDef. Within this table following definitions are set:

•class: unique simulation result section id

•title_localization_key: localization id for the title (within SimJSONResult.t_Localization)

•text_localization_key: localization id for the subtitle (within SimJSONResult.t_Localization)

•widgets: sub-table with definition of widgets:

oclass: unique widget overall in result view

otitle_localization_key: title of widget with key to localization table

otitle_localization_table: title as a table with columns for the different languages (for very flexible statistic widgets addings)

onodeName: nodeName of the corresponding result table node with its entries

owidgetDefinitionID:

▪refers to a widget definition within tblResultViewWidgetDef;

▪enables the standardization of widgets to be used for many different data visualizations of the same type with the same result data structure

•showFromBeginning: indicate that a section should be open directly at loading the result page within the frontend

 

Widgets per Section can be defined in the subtable structure or via interface methods:

•m_AddWidgetToSection: adds a result view widget to an already defined result section

•(legacy: m_AddResultViewSectionDef: adds a result view section definition with above mentioned data)

 

 

2.1 Widget definition

General widget types (and referred to by the above mentioned widgetDefinitionID) can be defined within tblResultViewWidgetDef with the following columns:

•widgetDefinitionID: id for the widget

•type: widget type

obar [chart]

oline [chart]

ostackedBar

odataGrid: table visualization

opivotGrid: dataGrid with integrated comparison between alternatives

ospecial data preparation needed

ohtml: html data visualization within one specific result view node

otimeline: represents the visualization commonly referred to as “Gantt”; (“Gantt” is within the underlying visualization technology devextreme similar to a project plan)

•seriesColumn: the column in the result table to reference the data series (also displayed in the legend on the right-hand side)

•xAxisColumn: column in the result table for the x-axis; please note that currently a datetime x-Axis is not automatically implemented; therefore, values should be encoded in result tables in string the ways they should be displayed

•xAxisSorting: e.g. “natural”, indicates the sorting of the x-axis; possible application: histogram with x-axis to be sorted like “[0,5], ]5,10] …”

•yAxisColumn: column in the result table for the y-axis (value-axis)

•yAxisSorting: sorting for y-axis

•titleColumn: only for type: ”timeline”, column for the title for a line entry

•startDateColumn: only for type: “timeline”, column for the start date time for a line entry (underlying result table column has to be of type datetime; this will automatically be encoded to the correct JSON format)

•endDateColumn: only for type: “endDateColumn”, column for the end date time for a line entry (underlying result table column has to be of type datetime; this will automatically be encoded to the correct JSON format)

•htmlTemplate: only for type: “html”; optional, can be used when a template should be applied to a given html result data within a result table

•optionsID: id for JSON options for this widget definition, refers to an entry within tblResultViewOptionsDef; e.g. general options for a widget like maximum value for y-axis, background, tick marks etc.

•seriesOptionsID: id for JSON series options for this widget definition, applied to data series defined within the column referred to in seriesColumn, refers to an entry within tblResultViewSeriesOptionsDef; e.g. for visualization options for every entry of the data series “working” with a green visualization

•showFromBeginning: open the widget when opening the result view in the frontend, similar to the option of the whole section

 

Necessary columns for exemplary widget definition within:

•dataGrid:

ooptionsID optional

•bar/line:

oseriesColumn

oxAxisColumn

oyAxisColumn

ooptionsID optional

oseriesOptionsID optional

•html:

ohtmlTemplate optional

•timeline:

oseriesColumn

oyAxisColumn

otitleColumn

ostartDateColumn

oendDateColumn

oseriesOptionsID optional

 

 

2.2 HTML-Result definition

Two possible ways to define a html-result node within the result view:

•(1) a single html-valid result data node within a result table

•(2) a result table with column values to fill placeholder within a htmlTemplate

 

Variant 1):

Define a result table with one column (column-name “html”) and one row. Fill this single cell with a valid html-definition. The corresponding widget would only have the definition for type=”html”, no html-template is needed.

 

Variant 2):

Define a result widget with type =”html” and a html-template, e.g.

 

<h1 style='color:{{headlineColor}}'>{{headlineText}}</h1><ul> 

 <li>{{text_1}}</li><li>{{text_2}}</li></ul>

 

The corresponding result table needs a column index with column names corresponding to every placeholder, indicated by “{{..}}”.

So in given example define a table with 4 columns (:string):

•headlineColor

•headlineText

•text_1

•text_2

 

The values of the first row of each column will be placed at the placeholder in the html at the frontend.

With this template mechanism you can define a result node in html and load certain table values for different alternatives.

 

 


© SimPlan AG - Hanau District Court, Commercial Register (Part B) 6845 - info@simplan.de - www.simplan.de