Functions
Core Functions
Members
Operators
Members
Logical Operators
Logical operators allow comparison between values. They are typically used in Query terms but may be used in Evaluate actions as well.
Not
Equal
Identical
Greater
Lesser
Greater or Equal
Lesser or Equal
True
False
Identity
Different
Numeric Operators
Numeric operators support all of the basic operators used in evaluations.
Negative Value
Add
Subtract
Multiply
Divide
Power
Modulo
Increment
Incremented numeric value by 1 unit. Not transformative of initial value like C!
Decrement
Decrement numeric value by 1 unit.
Unit Value
The value of one common unit, e.g. 1.
Zero Value
The value of no units, e.g. zero.
Original Value
The original value, e.g. the value for the value client at time 0.
Spatial
Spatial functions provide the core functionality for Agent Models. Spatial functions are polymorphic, which basically means that they don't care what space they are operating on as long as that space is suitable for them. Spatial functions are designed to collaborate with one another. For example, by intersecting the "Neighbor", "Available" and "Toward" functions, we can design a rule that causes the agent to move to the next neighboring cell that get's it closer to some target agent. See the function details for more information.
Nearest
Represents the nearest agents (including gird cells) or locations to this agent. If more than one agent or location is the same distance away they will all be considered. Note that while this function is defined for the selection of an agent, the result of this function is defined by the context within which it is used. If the selection specifies another agent within a space, this function will represent the nearest agent in that space. If the selection specifies a Cell within a grid space, this function will represent that cell.
Toward
Represents a location that is on the shortest path to a particular agent or location from the source agent (that is, the selection's selection's agent). This function collaborates with the within and neighbor functions to allow the agent to move in a particular direction towards some objective.
Within
Represents a limit to the distance of a spatial search. When used in combination with other spatial functions such as "nearest" requires that all agents or locations must be within the distance specified by the input value.
Neighbor
Represents any agents that are nearest neighbors to the agent, that is nominally of distance 1. This function is only relevant in discrete spaces -- grids and networks -- where there are immediate neighboring cells as defined by the geometry of the selection's space.
Include Self
Specifies whether the agent that we are searching from -- that is, the agent of the selection for this Query Action's selection -- is included in the results of the search.
Within 2D Boundary
Represents agents or locations that exist within the boundary specified by the inputs.
Here
Represents the location of the searching agent. For example, if a selection is defined for an agent cell, and that selection's selection's agent is an occupant of a cell, the cell that the agent is occupying will be used.
Available
Represents cells which are not currently occupied. This function is only relevant for grids which are not multi-occupant.
Distance
The distance between the source agent and an agent represented by this selection. If more than one agent is represented by the other functions in the selection, this function will the distance to an arbitrary (randomly selected) agent as defined by those other functions.
Away
Represents a location that is on the path that will take the source agent (that is, the selection's selection's agent) the farthest distance from the agent(s) represented by the search. This function collaborates with the within and neighbor functions to allow the agent to move in a particular direction away from some location or agent.
Minimize
Finds the agent with the lowest value for the specified input. For example, if we created a Select for HeatCell, created a Minimize Query Term with Heat as the input Query Term, created Neighbor and Available Query Terms and set an Intersect as the target for all of those Queries, the result would be the the neighboring available cell with the lowest heat level.
Maximize
Finds the agent with the highest value for the specified input. For example, if we created a Select for HeatCell, created a Maximize Query Term with Heat as the input Query Term, created Neighbor and Available Query Terms and set an Intersect as the target for all of those Queries, the result would be the the neighboring available cell with the highest heat level.
Location 2D
Represents the location of the current agent for use in subsequent selections.
Boundary 2D
Represents a two-dimensional boundary within a space. (Not currently relevant for any general usages.)
All
Causes all agents that meet the other query terms to be included in a selection. Without this query term, a single random agent is picked out of all agents matching the query terms.
Random
Random functions are especially significant for agent models. Of particular interest are the weighted membership and random state and boolean value functions. You should be familiar with these functions so that you don't have to create more complex Action flows to accomplish the same thing.
Note that we only have support for uniform distributions as of this release. We're working on a collaborative design for evaluations that allow easy mixing and matching of random functions and distributions.
Random In Range
A pseudo-random value within that numeric range specified as drawn from a uniform distribution. The minimum values are inclusive. The maximum values are inclusive for integer inputs and exclusive for Real inputs.
Random To Limit
A pseudo-random value between zero and the value specified by the (non-zero) input and drawn from a uniform range. That value is inclusive for Integers and exclusive for Reals. (Note that as with the random in range function in the context of real numbers the distinction between an exclusive and inclusive limit is essentially meaningless.)
Random Unit
A pseudo-random Real value between 0 and 1 drawn from a uniform distribution. (The distinction between inclusive and exclusive range is essentially meaningless in this context and we can assume that the result will never be greater or equal to 1.)
Random Boolean
A value that is randomly true or false, i.e. a fair coin toss.
Random Weighted
An indexed value weighted against a probability distribution. The total probability must sum to 1.0. For example, an input of {.1,.2,.7} under a uniform distribution would would have 10% probability of producing "0" , 20% for "1" and 70% for "2". This function can then be used with Item to return a biased result from another list.
Random Member
Represents a random value drawn from the set of Real values specified.
Random State
A random specified value (option) from the specified state.
Graphic
Graphic functions are combined within Style Evaluate Actions to determine how to draw an agent within a visualization. One nice aspect of this approach is that the same style definition can be used in multiple places without changing any code. For example, the same style could be used to draw an agent on a two-dimensional grid within Escape, a three-dimensional shape within Escape, a Java Swing based visualization in Ascape, and an XML configured visualizaiton in Repast Simphony.
To define a graphic style for an agent, design a flow in which you create Evaluate Actions for color and shape, and then create an Evaluate Action with the graphic fill or outline function as a target of these.
Shape Oval
Draw a generic oval.
Shape Rectangle
Draws a rectangular shape.
Shape Inset
Shrinks the current shape by the input amount. (The overall scale is currently unspecified, but in most implementations should be 20.)
Shape Marker
Draw a marker, that is a graphical indicator that can be used to add an additional que about the object state. For example, in a two-dimensional graphics representation this might be a small shape drawn inset at the corner of the larger shape.
Shape Marker 2
Represents a marker placed in a different location from the other shape markers.
Shape Marker 3
Represents a marker placed in a different location from the other shape markers.
Color RGB
A color specified by the three inputs for Red, Green and Blue color components. Those inputs are expected to be in the range 0..1.
Color Red
The color red.
Color Yellow
The color yellow.
Color Blue
The color blue.
Color Orange
The color orange.
Color Green
The color green.
Color Purple
The color purple.
Color Black
The color black.
Color White
The color white.
Color Gray
The color gray.
Graphic Outline
Draws an outline of the last evaluated shape, using the last specified color or the default color (usually black) if none has been specified.
Graphic Fill
Fills the last evaluated shape with the last specified color or the default color (usually black) if none has been specified.
Time
Time functions return values related to model execution time.
Now
The current simulation period, that is the number of iterations that the model has gone through, or in the case of models with callibrarted time, the number of iterations added to the model's nominal start time.
Math
The math functions use the extremely well specified and tested routines form the Java Math library. (Because of copyright restrictions, we aren't able to include the exact definitions here. Click on the links to get more details on each function.)
Sine
Cosine
Tangent
Arc Sine
Arc Cosine
Arc Tangent
Convert Degree to Radians
Convert Radians to Degrees
Exp
Log
Log b10
Square Root
Cube Root
Remainder
Ceiling
Floor
Rount
Arc Tangent Rectangular
Power
Absolute Value
Maximum
Minimum
ULP
Sign
Hyperbolic Sine
Hyperbolic Cosine
Hyperbolic Tan
Hypotuneuse
Expm1
Log1p
List
List functions are used for working with arrays and other functions that have lists as output.
Item
Returns the item at the specified index from the list of items provided. Those items will typically be input primitives such as Integer or Real values.
Length
The number of items in the provided list of items.
Distribution
One of the most common tasks in the Agent Modeling process is the creation of agents with particular states drawn from a distribution. For example, you might want to create a number of agents with wealth randomly distributed between some minimum and maximum values. The distribution functions greatly ease the process of setting up those initializations and their associated parameters.
Uniform Cross Distribution
A random number taken from a distribution of values as defined by a cross of all values. (See Cross Distribution.) This funciton then returns a value drawn from the minimum and maximum values as determined by the current agent state. In the cross distribution, each of the values is treated independently so that an input attribute is created for every potential combination of states.
Uniform Additive Distribution
A random number taken from a distribution of values in which each of the minimum and maximum values are added to determine a total minimum and maximum value. (See Additive Distribution.) In the additive distribution, each of the values is treated as dependent on the others so that an input attribute is only created for each seperate state.
Cross Distribution
A value taken from a set of (auto-generated) attributes based on the value of each state included. For example, if the multi-values included a state X with values A and B and a state Y with values I and II, this distribution would create separate input attributes for AI, AII, BI and BII. Then for an agent with States A and II this function would return the value specified by the AII input attribute.
Additive Distribution
A value taken from a set of (auto-generated) attributes based on the combined values of the states provided. For example, if the multi-values included a state X with values A and B and a state Y with values I and II, this distribution would create input attributes for A, B, I and II. Those values would then be added together, so that for an Agent with state A and II this function would return A + II.
Parameters
True (int, default: true)
False (int, default: false)
Zero (int, default: 0)
The value 0.
Unit (int, default: 1)
The unit value, e.g. 1.
Path ([Undefined], default: )
Self ([Undefined], default: )
Projections
Generated by AMF.