Difference between revisions of "Primitive Operators and Properties"

From Nova Documentation
Jump to: navigation, search
Line 9: Line 9:
 
Notation: ''x, y'' represent values (numbers or string constants or expressions); ''fn'' represents a Javascript function; ''exp'' represents a string expression; [''x, y''] represents one or more optional arguments.
 
Notation: ''x, y'' represent values (numbers or string constants or expressions); ''fn'' represents a Javascript function; ''exp'' represents a string expression; [''x, y''] represents one or more optional arguments.
  
Coming soon
+
==Universal Properties and Primops==
 +
These can be used in any expression in any component.
 +
===Properties===
 +
;Self
 +
:The state object of the enclosing simulator (Capsule, CellMatrix, etc.) Used to look up component values (see the section on state objects, coming soon).

Revision as of 17:10, 12 December 2014

The Properties/Primops list is correct as of Release 12, which became available on March 31, 2014

Nova supports a large set of primitives divided into properties and primitive operators, or primops. A property is an identifier assigned a value at the beginning of a simulation run which is not expected to change. For example, the rows and cols properties of a CellMatrix are fixed at the start of a run and don’t change. A special type of property, called an state object, is used to look up the current values of components.

Primops are functions of zero or more arguments. Some primitives may be used without restriction; others make sense only in specific contexts; for example rows and cols are only useful in spatial contexts such as CellMatrices, AgentVectors and SimWorlds.

Here are the properties and primops supported by the current Nova implementation, organized by type and area of applicability. All properties begin with a lower case letter, state objects begin with a capital letter, and primops are composed entirely of capital letters. Primops are always functions, and therefore require an argument list (even if empty) in order to be invoked.

Notation: x, y represent values (numbers or string constants or expressions); fn represents a Javascript function; exp represents a string expression; [x, y] represents one or more optional arguments.

Universal Properties and Primops

These can be used in any expression in any component.

Properties

Self
The state object of the enclosing simulator (Capsule, CellMatrix, etc.) Used to look up component values (see the section on state objects, coming soon).