Viewing values and charts at runtime

You can view current values of all parameters and variables at the model runtime (and optionally modify them, interactively affecting the model behavior).

Viewing values at runtime

At model runtime values of parameters and variables are displayed under their names (this requires the Show name option to be selected in properties of these parameters and variables).



Viewing history of values using plots and charts

You can not only view current values of your parameters and variables but also view the history of parameter/variable values using more visual plots and charts. 

AnyLogic provides two ways of viewing charts: 


Viewing plots using inspect windows

AnyLogic supports various tools for collecting, displaying, and analyzing data during model execution. The simplest way to examine current state and history of a parameter or a variable during model simulation is to use inspect window.

To perform more sophisticated statistical analysis, use charts and analysis data objects from the Analysis palette (they are described below). They allow visualizing variable trends using various charts and histograms and calculating statistical information on collected data, such as mean value, minimum, maximum, etc. 

 To view the plot of parameter/variable in the inspect window

  1. While running the model, click the parameter/variable icon in the presentation window. The yellow popup box - inspect window - will be shown. The window has three modes: one for displaying the current value, another for modifying the value and the last one for displaying the time plot for this parameter/variable. By default the inspect window displays the current value of a parameter/variable.

  1. To switch to the plot mode, click the button in the top part of the inspect window. You will see the plot displaying how the value of the parameter/variable changed recently:
  1. If your variable/parameter is an array, you will see several curves, each one corresponding to some particular element of this array:

  1. Finally, you can close the inspect window by clicking the "cross" button () in the upper right corner of the window.  

The inspect plot is built upon data collected in the data sets automatically created for parameters and variables. New samples are added to these data sets with the specified recurrence time. If plot curves have some breaks and are not smooth enough, it may probably mean that these data sets are updated with new samples not enough frequently.

 To change the update rate for data sets automatically created for variables

  1. Open the Advanced section of the properties of the agent type or experiment where your parameter/variable is located.
  1. Type the new value of the update period in the Recurrence time.
  2. You can also specify here the maximum number of items that AnyLogic will store for every parameter and variable. Select the option Limit the number of data samples and specify the number in the field up to the first ... items

Copying the collected data to the Clipboard

Collected statistics can be exported to external applications providing more comprehensive statistical analysis (e.g. MS Excel).   

 To copy data collected by the inspect window to the clipboard

  1. Right-click (Mac OS: Ctrl+click) in the inspect window and choose Copy from the popup menu. 

Now you can paste data from the Clipboard. 

To paste data, for example, in MS Excel, you should select the cell of the sheet where you want to start inserting values and press Shift+Insert. If you are copying values of one variable/parameter, data will be copied in two columns: the first will contain model time samples, while the second one - the corresponding values of the variable/parameter in these time moments.


Viewing the (history of) parameter/variable values using charts

AnyLogic provides the users with a set of fully functional charts that allow users to dynamicaly visualize data collected during the simulation. The collection of chart types is close to that of MS Excel: bar chartstack chartpie chartplottime plottime stack charttime color charthistogramhistogram 2D.

 To add a chart displaying variable/parameter values

  1. Drag the required chart from the Analysis palette on the diagram of your agent type or experiment.
  2. Click the Add data item button in the Data section of the chart properties and enter the name of the corresponding parameter or variable in the field Value.
  3. In the same way you can add more data items to be displayed on the chart.

Copying the collected data to the Clipboard

The history of parameter/variable samples collected for the chart can be exported to external applications providing more comprehensive statistical analysis (e.g. MS Excel).   

 To copy data collected by the chart to the Clipboard

  1. Right-click (Mac OS: Ctrl+click) the legend item corresponding to the data item whose history you want to copy and choose Copy selected from the context menu. 
  2. If there are several data items on your diagram, you can copy history of all of them by choosing Copy all from the context menu. 

Now you can paste the copied data in any external application. 

To paste data, for example, in MS Excel, you should select the cell of the sheet, where you want to start inserting values, and press Shift+Insert. If you are copying values of N variables, data will be copied in N+1 columns: the first column will contain model time samples, the second one - the corresponding values of the first variable in these time moments, the third one - values of the second variable and so on, see figure below.