communication

how to do the announcements of messages among the agents?

how does the agent A say to the agent B something and B responds? that the agent A sends it a string to B and vice versa

the docs present these instructions:

1. self observe instance controller for-notification "New Object" with-method "notify-of-new-object".

2. + to notify-of-new-object from-instance announcer (object) with-message message (string):
print "I got the message $message from $announcer!".

Can you help me with a simple code example?

thanks!!!

the missing step...

The missing step is to say:

agentA announce message "notify-of-new-object".

Message announcements aren't necessarily the best way to do two-way communication however -- they're more for one-way communication. So the other option is to just call the method in the target object directly so that it can give back a return value.

- jon

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.