Difference between revisions of "Component Guide 1: Overview; Atomic Components"

From Nova Documentation
Jump to: navigation, search
(Atomic Components)
(Atomic Components)
Line 55: Line 55:
 
*'''Local Variable'''. When checked, the Stock becomes a Local Variable
 
*'''Local Variable'''. When checked, the Stock becomes a Local Variable
  
<gallery>
+
<gallery widths=300px>
 
File:stockfig.png|Stock showing 1 inflow and 1 outflow
 
File:stockfig.png|Stock showing 1 inflow and 1 outflow
 
File:sequencefig.png|Sequence with single inflow
 
File:sequencefig.png|Sequence with single inflow
 
</gallery>
 
</gallery>

Revision as of 17:16, 10 December 2014

Overview

Nova models are constructed out of components, which are visual tokens that are placed on the Model Canvas.

To place a component on the model canvas:

  • Click the desired component on the component pallet; components are identified by their icons and tool tips that appear when the mouse hovers over a component.
  • Click on the model canvas at the location chosen for this component; do not drag the component from the component pallet.
  • When prompted, provide a component name (a default name will be provided if you choose not to provide one).

A new component requires two actions to integrate it into the model:

  • Connections must be made to components with which this component will interact; and
  • The new component must be programmed; in the simplest case, this involves providing a component equation that defines the value represented by this component. Specific programming tasks for each component type will be described below.

Component Types

Atomic Components
Tranditional systems dynamic components Stock, Flow, Term (called converters in Stella); along with Sequence, Local Variable, DataInput, DataOutput, and Command
Containers
Nova containers consist of Chips and aggregators; the latter hold multiple instances of one or more Capsule types. (Capsules, also called submodels are described here.) Each aggregator type implements a different topology for its elements. The aggregator components are AgentVector, CellMatrix, NodeNetwork, SimWorld and NetWorld.
Controls and Displays
These include Table, Graph, Slider and Spinner. They appear in the Dashboard and as stubs in the Model Canvas.
Special
These are special purpose components consisting of Code Chip and Label.
Plugins
These are extensions to the component set and have various functions. They appear in the Dashboard and as stubs in the Model Canvas.

Component Properties

Each component has an associated properties window that provides the means for programming the component (and in some cases specifying connections.) The Properties Window is opened by right-clicking along the edge of the component. Components appearing in the Dashboard, with stubs in the Model Canvas (i.e., controls, displays and plugins), may open a different Properties Window depending on which is clicked. Properties Windows allow you to define the value represented by a component, set pin connections, determine what is displayed (in the case of Graphs and Tables), calibrate (in the case of Sliders and Spinners) and set any other property required by the component.

Help comp atomic stock prop.png

System Component Properties: The Stock, Flow, Term, Sequence, Local Variable, Command, DaatInput and DataOutput all open similar Properties Windows (the Stock Properties Window is shown here). Each of these components requires a component equation to specify its value (in the case of Stock, Sequence and Local Variable components, the value specified is an initial value.) This equation is a NovaScript expression typed into the Equation Window. To assist in constructing this expression are the Connections, Primops and Properties windows. Clicking on any entry in these windows will copy the entry at the insertion point in the Equation window.

The Connections window shows all input controls and all components connected to this component, either with arrows or pin connections. The Primops window is a list of all primitive operators (primops), and the Properties window is a list of all primitive properties (i.e., symbols representing fixed values).

Finally, the Comment window is provided for documentation purposes. It does not affect the simulation in any way.

The other properties shown here (History, etc.) are specific to Stocks. Such properties will be defined in the Component descriptions given below.

Atomic Components

Stock

Help comp atomic stock.png

A Stock represents a value that is changing over time. Changes to the stock are specified using one or more Flows, which are connected to it. Flows are either inflows or outflows, which respectively represent values being added to or subtracted from the current stock value. The value of a Stock at the end of each time step is equal to the value at the previous time step, plus the total inflow (i.e. the total flow value flowing into the stock) minus the total outflow (i.e., the total flow value flowing out of the stock). Stock values must be numerical.

Help comp atomic seq.png

A Sequence is a type of Stock to which only a single inflow is connected. In this case the inflow's value replaces rather than adds to the current stock value. A sequence value may be any legal NovaScript data type.

Help comp atomic var.png

A Local Variable is a type of Stock without flows. It is used to hold values that may not require updating at each timestep of the simulation. Local Variables are used by Commands and Code Chips to store values across simulation timesteps. A Local Variable may be any legal NovaScript data type.

Properties
  • Initial Value. The initial value can be a number, or an expression (equation).
  • History. Specifies how long values are retained by this Stock. If set to 0, values are kept for the length of the simulation.
  • Interactive Graph. Determines the type of graph displayed during Interactive Mode.*
  • Non-Negative. If this box is checked, the value of the Stock will never go below zero. If a flow connected to the Stock removes more objects than the Stock has, the value of the Stock will simply be set to 0.
  • Sequence. When checked, the Stock becomes a Sequence.
  • Local Variable. When checked, the Stock becomes a Local Variable