Difference between revisions of "Message-In-Stack Action"

From AgentCubes
Jump to navigation Jump to search
imported>Mike
imported>Mike
Line 7: Line 7:
 
|-
 
|-
 
| width="80" valign="top" align="left" | '''Parameters:'''  
 
| width="80" valign="top" align="left" | '''Parameters:'''  
| width="100%" valign="top" align="left" | [[Method parameter|method]], [[Message In Stack parameter|message_in_stack]]
+
| width="100%" valign="top" align="left" | [[Method parameter|method]], [[Message In Stack parameter|agents_in_stack]]: The method parameter specifies which method needs to be called.&nbsp; The agents_in_stack parameter specifies which other agents in this agent's stack should receive the spcified message.&nbsp; <br>
|-
 
| width="80" valign="top" align="left" | '''Example 1:'''
 
| width="100%" valign="top" align="left" |
 
'''Move after 2 second: '''This agent has two methods delayed_move and move, when it receives a delayed_move message it will wait 2 second then call its own move method which will move it randomly. &nbsp;  
 
 
 
[[Image:Delayed-message2.png]]
 
 
 
<br>  
 
 
 
 
|}
 
|}
  
 
[[Category:AgentCubes_Actions]]
 
[[Category:AgentCubes_Actions]]

Revision as of 22:43, 4 April 2012

150px

Definition: The delayed-message action will trigger a message in this agent after a specified amount of time. Note that it is not possible to send delayed messages to other agents. 
Parameters: method, agents_in_stack: The method parameter specifies which method needs to be called.  The agents_in_stack parameter specifies which other agents in this agent's stack should receive the spcified message.