AnyLogic
Expand
Font size

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 view the history of parameter/variable values using more visual plots and charts.

AnyLogic provides two ways of viewing charts:

  • Using inspect windows. Simply clicking the parameter/variable icon at model runtime you can open the inspect window displaying the plot for this parameter/variable. Please note that it is the simplest and effortless way to examine history of a parameter or a variable during model simulation, but it only may give you the general idea on parameter/variable dynamics. To perform more sophisticated statistical analysis, use charts and analysis data objects from the Analysis palette (they are described below).

  • Using charts. AnyLogic provides the users with a set of fully functional charts that allow users to dynamically visualize data collected during the simulation. The collection of chart types is close to that of MS Excel: bar chart, stack chart, pie chart, plot, time plot, time stack chart, time color chart, histogram, histogram 2D.

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 model window. The light brown 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 inspect window displays the current value of a parameter/variable.

  2. To switch to the plot mode, hover the mouse over the title of the inspect window and click the button there. You will see the plot displaying how the value of the parameter/variable changed recently:

  3. If your variable/parameter is an array, you will see several curves, each one corresponding to some particular element of this array:

  4. Finally, you can close the inspect window. Hover the mouse over the inspect window and click the "cross" button in the upper right corner of the inspect 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.
  2. Type the new value of the update period in the Recurrence time.
  3. 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. Hover the mouse over the inspect window and click the “copy” button in the upper right corner.

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 dynamically visualize data collected during the simulation. The collection of chart types is close to that of MS Excel: bar chart, stack chart, pie chart, plot, time plot, time stack chart, time color chart, histogram, histogram 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 (macOS: 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.

How can we improve this article?