class type [#core
] t = object end
The class of a Swarm object. The type parameter 'a
refers
to the type of core residents, which must extend the class core
above. The harness interacts with the Swarm through the interface
presented here.
method run : unit -> unit
Start the Swarm activity: finding matches, executing
bindings, clicking residents, etc.
method break : unit -> unit
Stop the Swarm activity.
method is_running : unit -> bool
Returns true
if the Swarm is active, false
otherwise.
method shelter : (#core as 'a) -> 'a resident
Add a new resident to the Swarm. shelter c
creates a new
resident around the core c
and returns the resident, which
can be used as a parameter to the other methods below. The
resident added which is initially unbound on all its
projections.
method get_core : 'a resident -> 'a
Return the object used to create the resident to begin with.
method remove : 'a resident -> unit
remove r
removes resident r
from the Swarm. The
resident is first released from all its bindings and
stopped.
method start_all : unit -> unit
Call the start
method on all the residents in the
Swarm.
method stop_all : unit -> unit
Call the stop
method on all the residents in the
Swarm.
method start_resident : 'a resident -> unit
Call start
on the specified resident.
method stop_resident : 'a resident -> unit
Call stop
on the specified resident.
method wake : 'a resident -> unit
Take the specified resident out of hibernation. This may
be useful in case a proprietary method of the resident was
called, which affects its internal state.
method list_residents : 'a resident list
Return a list of all the residents in the Swarm.