Navigation Bar AgentSheets Education R&D Support About Us Manuals Tutorial Movies FAQ Books Classes

Map Action

Definition: The Map action maps the value of an agent's Attribute, a Simulation Property, or a Visual AgenTalk Formula to a Color that lies between two user-specified colors along the color line. The range of the attribute's values to be mapped to a color is specified with numbers or Visual AgenTalk Formulae.

To understand how this action works, you must first understand a little about color cubes and about how humans see color. In general, humans see colors in a three-dimensional color space. Humans have receptors that see red, green, and blue pigments.

You can create any color visible to a human by mixing different spectrums of red, green, and blue pigments together to form a color. Thus, a color cube has x, y, and z axes which represent amounts of red, green, and blue pigment.

Points in a color cube represent colors containing different amounts of red, green, and blue pigment. Black is the color we see when there is no red, no green, and no blue pigment present. White is the color we see when the maximum amount of pigment our eyes can detect is present for red, green, and blue pigments. An image of a color cube is shown below.

A user specifies points in a color cube using the Color parameter. The two points/colors become endpoints for a color line that stretches between them in the color cube.

A user also specifies minimum and maximum numerical values for the attribute to be mapped using numbers or Visual AgenTalk Formulae. These values are mapped to the color endpoints previously mentioned.

As the values of the chosen attribute pass through the user-specified numerical range, the Map action colorizes the agent with a color that corresponds to a point along the color line between the two color endpoints.

Parameters: attribute, color, formula
Example: The Ground agent in the Ultimate Pacman simulation colorizes the diffusion values. Negative values get mapped to a shade of blue, positive values get mapped to a shade of red.


reference manual | ©2010 AgentSheets, Inc. | contact us