Reactive-C - Meije
The Prey-Hunter Demo (January 98)


One considers nodes, called rooms in which two kinds of agents, called preys and hunters, interact. Basically, preys run away when they detect hunters close to them and hunters pursue preys and kill them when they can catch them. Preys are shown on screen as little green circles and hunters are shown as red circles. They are created at random positions by the user, by clicking on two buttons.

To avoid to be caught, preys can migrate to an other room, when they are on the point to be killed. In their basic version, hunters do not have the possibility to migrate; thus, preys have a chance to live for ever by migrating to a room where there is no hunter in it. In their extended version, hunters can also migrate and pursue preys over the network.

A more friendly version of preys exists: it this version a prey which is threaten by a hunter shouts out to warn others preys against the hunter, so that prejudiced preys can immediately migrate.


Rooms

There are two rooms named room0 and room1 which look like this:
 



Objects are created at random positions, when clicking on the colored buttons on the left:

The following objets have possibility to migrate from a room to the other: Finally, the quit button exits from the demo.


Implementation

The demo is implemented with Reactive Scripts which are commands describing actions to be executed at some delimited instants, where some events may either be present or absent.

The Reactive Scripts interpreter used is rem-rsi-tk (for remote reactive script interpreter on top of Tk), an implementation of Reactive Scripts with Tcl/Tk as language of external statements and expressions. This interpreter is implemented in Reactive-C and runs on several Unix platforms. Reactive-C and Reactive Scripts are developed in the RC project and are free software available on the Web.


Installation

First, the rem-rsi-tk interpreter must be installed. It runs on sunos4, solaris, linux, dec-alpha, and hp Unix platforms. Click here to get it.

Second, the code for the demo must be loaded. In the demo directory, there is a makefile to help the user.

If you choose the simple demo, without migration, just type make simple. It will launch the rsi-tk interpreter which is not linked to the network. The file start is automatically loaded and run.

For simplicity, in the demo with migrationwe use two windows which are both on the same machine. First,  run the Reactive-C name server by make nameserver. Second,  type make room0 to get the first room. Finally, to get the second room,  type make room1 in the other window.


Please, feel free to send comments, criticisms, and/or suggestions to Frederic.Boussinot@sophia.inria.fr