Write Message To Blackboard

by ondrej on March 31st, 2007

The Rinda multi-agent system environment is already running, so the next step is to write a message to the blackboard with an agent.

The following functionalities will be shown:

  • Creation of an agent.
  • Locating the blackboard.
  • Writing a message.

The agent source code is stored in the write.rb file:

require 'rinda/ring'


ts = Rinda::RingFinger.primary

ts.write [:message, 'Hi there!']

puts 'Message was sent.'

Firstly, start the rinda.rb code (for more details see the post about starting multi-agent system environment) and then, in a separate console, type:

ruby write.rb

The agent connects to the blackboard and writes a message Hi there!.

Files to download: rinda.rb and write.rb.

For running more processes it is necessary to open more consoles. Applications like screen or konsole on KDE can help you — I use konsole with more sessions.

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS