Component Guide: Plug-ins

In Nova plug-ins are used to extend the basic component platform with special functionality. In order for plug-ins to function properly we must distinguish 3 different types:

Plug-in type is determined by the plug-in designer and cannot be changed.

Adding a plug-in to your model: Plug-ins appear on the Plug-in Pallet, which has the same form as the Component Pallet. To add a plug-in follow the procedure for adding components to your model.

A plug-in instance in a model work like Graph and Table displays. The Model Canvas contains the plug-in's stub, which includes input and output pins for connecting the plug-in to the rest of the model. On the dashboard the plug-in's face displays any visualization and/or control elements required for it to function. Plug-ins that have no such elements (e.g., Averager) still appear on the Dashboard as small tiles.

Communicating with Plug-ins: Right-clicking on the plug-in stub opens a Connector Dialog, like the ones used by Containers. See Connecting Container Pins for details.

Plug-in menus: Right-clicking on the plug-in's dashboard component generally opens a menu that contains selections for configuring the plug–in (in some cases no configuration is required, and so no such menu appears). The most common menu entry, Properties, opens a dialog in which a set of properties can be selected.

In some cases property or control settings may affect the configuration of input and output pins on the stub.

Standard Plug-ins

The following plug-ins are included with the Nova distribution. Images show both the plug-in face on the Dashboard and the stub on the Model Canvas.

AgentViewerX

Description: The AgentViewerX (AVX) plug-in is the standard component for viewing the dynamic behavior of an AgentVector or SimWorld. (While it can be used for CellMatrices, the Raster plug-in is preferred). The AVX displays 2 layers; the first, called the matrix layer, is equivalent to the Raster plug-in, showing a cartesian array or hexagonal array (depending on the mode of the input Container) of tiles with each tile corresponding to a cell of the SimWorld's internal CellMatrix, using its row-column mapping. Tile colors correspond to some state parameter of the represented cell's submodel.

The second, agent layer, displays the agents of the SimWorld's internal AgentVector as individual tokens, mapping each agent's current location to the equivalent location in the tile array. The origin of the mapping is in the upper left corner, with positive values extending rightward and downward. Each tile represents a unit distance in horizontal and vertical distance. Values outside the represented space are disregarded unless the SimWorld is operating as a torus, in which case they wrap accordingly. Each agent can display a state value as a color or be randomly colored. An agent can also display a state value through the size of the token.

The user may specify up to 8 colors and corresponding values for coloring cells and agent tokens. Linear interpolation on the color's RGB components is used to determine colors for a value between 2 selectioned colors.

When operating in Interactive Mode the tile and token colors can be set using mouse gestures. These selections can be used to initialize the states of the corresponding cells and agents in advance of a simulation run. Selections are recorded and redisplayed each time the simulation is reset.

Plug-in Menu
Properties:

I. General

II. Agent

III. Cell

Plug-in menu
Reset: In Interactive Mode, removes all agent and cell selections made through mouse gestures.

Pins
Input:

  1. AgentColorIn: Connects to the AgentVector/SimWorld pin of the agent output to be displayed as token color.
  2. CellColorIn: Connects to the CellMatrix/SimWorld pin of the cell output to be displayed as tile color.
  3. AgentSizeIn: Connects to the AgentVector/SimWorld pin of the agent output to be displayed as token size.
  4. AgentDataIn: Connects to the AgentVector/SimWorld AData pin, conveying agent position and life cycle data.
Output:
  1. AgentColorOut: During Interactive Mode, connects to the AgentVector/SimWorld pin of the agent input to be displayed as token color.
  2. CellColorOut: During Interactive Mode, connects to the CellMatrix/SimWorld pin of the cell input to be displayed as tile color.
  3. AgentSizeOut: During Interactive Mode, connects to the AgentVector/SimWorld pin of the agent input to be displayed as token size.
  4. AgentDataOut: During Interactive Mode, connects to the AgentVector/SimWorld Init_Count pin, conveying initial agent position data.

Interactive Mode

Averager

Description: When connected to an output pin of an aggregator, the Averager plug-in computes and outputs the running average of the pin's value over the elements of the aggregator.

Properties: No user-settable properties.

Pins
Input: The single input pin In must be connected to an aggregator pin.
Output: The output pin Out is the running average of the input over the elements of the aggregator.

Bar Graph Maker

Description: The Bar Graph Maker inputs a single model value x over a time sequence and converts it to n outputs, each representing the average of that sequence during m timesteps. Those outputs are expected to be connected to a Graph component and displayed as a bar graph. For example, if n = 6 and m = 5, then x's value over the first 30 time intervals will be condensed into 6 output values. The first 5 x values will be averaged to produce the first output value; then the next 5 x values will be averaged to produce the second output value, etc.

Controls: Size and Width spinners on the plug-in determine, respectively, n (the number of outputs) and m (the number of time intervals averaged for each output).

Properties: No user-settable properties.

Pins
Input: Single input pin In connected to some value-producing component.
Output: The number of output pins Out_00 - Out_XX equals the value of Size.

Raster

Description: The Raster plug-in is the standard component for viewing the dynamic behavior of a CellMatrix. It displays a cartesian or hexagonal array (depending on the mode of the CellMatrix) of tiles with each tile corresponding to a cell of the CellMatrix, using its row-column mapping. Tile colors correspond to some state parameter of the represented cell's submodel.

The user may specify up to 8 colors and corresponding values for coloring cells Linear interpolation on the color's RGB components is used to determine colors for a value between 2 selectioned colors.

When operating in Interactive Mode the tile colors can be set using mouse gestures. These selections can be used to initialize the states of the corresponding cells in advance of a simulation run. Selections are recorded and redisplayed each time the simulation is reset.

Plug-in Menu
Properties:

Plug-in menu
Reset: In Interactive Mode, removes all agent and cell selections made through mouse gestures.

Pins
Input: In connects to the CellMatrix pin of the cell output to be displayed as tile color.
Output: During Interactive Mode, Out connects to the CellMatrix/SimWorld pin of the cell input to be displayed as tile color.

Interactive Mode: To change a tile's color left-click on that tile; successive left-clicks will cause the colors to rotate through the Cell Colors pallet defined in Properties. Alternatively, pressing the mouse on a tile and dragging across the matrix will cause the colors of dragged-over tiles to change to the color of the original tile.