Difference between revisions of "Move-Random Action"

From AgentCubes
Jump to navigation Jump to search
imported>Andri
imported>Andri
Line 4: Line 4:
 
<tr>
 
<tr>
 
<td align="left" valign="top" width="80"><b>Definition:</b></td>
 
<td align="left" valign="top" width="80"><b>Definition:</b></td>
<td align="left" valign="top" width="100%">The <strong>Move-Random</strong> action moves an agent randomly any number of cells away.</td>
+
<td align="left" valign="top" width="100%">The <strong>Move-Random</strong> action moves an agent randomly any number of cells away from the original location.</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
 
<td align="left" valign="top" width="80"><b>Parameters:</b></td>
 
<td align="left" valign="top" width="80"><b>Parameters:</b></td>
<td align="left" valign="top" width="100%">[[Direction parameter|direction]]</td>
+
<td align="left" valign="top" width="100%">[[Formula parameter|formula]]</td>
 +
</tr>
 +
<tr>
 +
<td align="left" valign="top" width="80"><b>Additional Parameters:</b></td>
 +
<td align="left" valign="top" width="100%">[[Layer parameter|layer]], [[Animation parameter|animation]], [[Animation time parameter|time]]: the move action can move an agent in a layer other than the current layer the agent resides on; it can animate the movement with accelerated or constant speed; and it can make the movement happen instantly (if time is 0) or it can take any amount of time to perform the animation. The slider() option in the time parameter connects the animation time to the slider located above the world, next to the other world controls.</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
 
<td align="left" valign="top" width="80"><b>Example 1:</b></td>
 
<td align="left" valign="top" width="80"><b>Example 1:</b></td>
 
<td align="left" valign="top" width="100%"><b>move on the same layer</b>: In the Frogger game, the Truck agent moves to the right once every half a second, as long as there is road there (second rule in the behavior below).
 
<td align="left" valign="top" width="100%"><b>move on the same layer</b>: In the Frogger game, the Truck agent moves to the right once every half a second, as long as there is road there (second rule in the behavior below).
[[Image:Move action example.png|500px]]</td>
+
[[Image:Move random action example.png|500px]]</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>

Revision as of 22:57, 17 June 2011

Move random action.png

Definition: The Move-Random action moves an agent randomly any number of cells away from the original location.
Parameters: formula
Additional Parameters: layer, animation, time: the move action can move an agent in a layer other than the current layer the agent resides on; it can animate the movement with accelerated or constant speed; and it can make the movement happen instantly (if time is 0) or it can take any amount of time to perform the animation. The slider() option in the time parameter connects the animation time to the slider located above the world, next to the other world controls.
Example 1: move on the same layer: In the Frogger game, the Truck agent moves to the right once every half a second, as long as there is road there (second rule in the behavior below). 500px
Example 2: move between layers: In the 3D Matrix game, in its "Lift" method, the Nebuchadnezzar agent moves to the layer above it if the shift and up arrow key are pressed together and if at that position in the layer above, there is a Hole agent (first rule). Similarly, it moves to the layer below it if the shift and down arrow key are pressed together and if at that position in the layer above, there is a Hole agent (second rule). Move action example2.png