Write Message To Blackboard
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'
DRb.start_service
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.