Sequence Graph

 Sequence Graph

The Sequence Graph component is used to plot some user specified value against time.

Appropriate Parent Component

Sequence Graph can be added to any model.

Properties

Properties are the items that appear in the property pane when you click on a component in the project tree. For more information of properties, see here.

Name     Description
File Name If you wish to have the sequence graph data written out to a file in tabular format. You can select write to file and provide a file name here.
Initial X-Axis Size The initial size of the X-Axis.
Initial Y-Axis Size The initial size of the Y-Axis.
Name This is a unique name that identifies this Sequence Graph.
Series The Series property is where you define code that produces the value you want to plot against time. This works much like the Actions editor. The new button allows you to define a new Series, and the combobox allows you to edit any series you have already created. The point style and sequence color comboboxes allow you to set the point style and the color of your series. The Variables and Java Imports sections behave exactly as they do in the Action Editor (Actions). The Source section behaves slightly differently with a series than with actions. For a series, the python code must be return some numeric value. It is this value that is then plotted against the current tick. For example:

counter = 0
for agent as MyAgent in self.agentGroup:
  if(agent.type == 0):
    counter = counter + 1
return counter

This series returns the number of agents that are of type 0. In this way you can calculate and plot averages standard deviations and other statistics easily.

Schedule See the schedule help and tutorial 3 for more information on the schedule property. The schedule property defines the execution schedule of any actions defined in your Data Recorder.

Although there are no user-definable actions associated with the Data Recorder component, Data Recorder implicitly defines two actions:

  1. update. This calculates and plots the next series of points. In effect, this executes the code defined in the Series property, and plots the results against the current clock tick.

  2. writeToFile. This writes the sequence data to a file, if you have chosen to do so in in the File Name property.

The update action should be scheduled at any interval necessary to the model. The writeToFile action should be scheduled at a minimum as the last action in the simulation, but possibly more often. There is a performance penalty for writing the data to a file, so the frequency with which you schedule the write action will largely depend on your particular model.

Title The title that will appear on the Sequence Graph frame.
X-Axis Title The title (legend) for the X-Axis.
Y-Axis Title The title (legend) for the Y-Axis.