StartIt: onready, ondisconnect

Adam Cheyer (cheyer@ai.sri.com)
Thu, 01 Aug 1996 17:26:08 -0700

All,

I added two new parameters that can be defined in a
StartIt configuration file for an agent:

onready <ICL> when the agent is ready (ie the little light
turns green), the ICL goal (or goals) is
broadcast using solve(ICLGoal, [broadcast])

ondisconnect <ICL> when an agent disconnects, either being killed
by StartIt or by dying in some other fashion,
the ICL goal (or goals) is broadcast using
solve(ICLGoal, [broadcast]).

<ICL> may be a single goal, ex:

onready inform_ui(db, ready)

or a list of goals, ex:

ondisconnect [inform_ui(db, disconnect),update(info)]

The rational for these two new features: there are times when agents
need to perform initialization handshaking with respect to one another.
If one agent is restarted for some reason, other agents might like to
know this information. Although each agent could setup individual
triggers to detect the coming and going of agents it is interested in,
in some cases it is much simpler and cleaner to put these project
level interactions directly in the startit config file, letting
StartIt to the work (it knows already who is connected and what their
state is).

Here's a more complete example:

#---------------------------------------------------------------------
appname Map & Position Database
oaaname db.root
appdir ${OAA_DEMO_DIR}
preline setenv HOST `hostname`
appline ${trace} ./db -oaa_name db robot/db_defs.pl
onready robot(initialize_position)
end
#--------------------------------------------------------------------

In the above example, a map database might contain coordinates for rooms
and for moving objects (robots). If the database is restarted for some
reason, all robots should be informed so that they can resend their
initial positions in the map. In the above, all agents responding
to the robot(initialize_position) solvable will receive this message
when the map database agent is started or restarted.

The new startit executable has been compiled for sun4, and can
be found in /home/trestle4/OAA/demo/startit.

I hope this will be of use to you...

-- Adam.