anthill.nest
Interface Manager

All Superinterfaces:
Clearable
All Known Implementing Classes:
LocalManager, Manager

public interface Manager
extends Clearable

The aim of a Manager is to control the execution of the ants receveid by other nests or generated locally. Manager is one of the components of a nest; the other are managers (interface Gate), RequestSet, Storage and Trail. The Manager interface enable the insertion of new ants in the manager, and to force the execution of the ant code. Classes implementing this interface may provide different semantics for execution; for example, classes implementing Manager used during the off-line simulation should be single-threaded, while "real" implementation will be multi-threaded.

Manager is one of the components of a nest; the other are Gate), RequestSet, Storage and Trail.

Manager methods are invoked by AntView objects to implement method addAnt(). The exact behavior of this method depends on the implementation of Manager.

Version:
$Revision: 1.5 $
Author:
Alberto Montresor

Field Summary
static String NAME
          Identifier used in the configuration files
 
Method Summary
 void add(AntView view)
          Add an ant to the queue of ants to be executed.
 void execute()
          Force the execution of one of the ants waiting to be executed and stored in this Manager.
 
Methods inherited from interface anthill.util.Clearable
clear
 

Field Detail

NAME

public static final String NAME
Identifier used in the configuration files

See Also:
Constant Field Values
Method Detail

add

public void add(AntView view)
Add an ant to the queue of ants to be executed. The ant is added by passing an AntView object, which encapsulate both the ant and the environment it can view.

Parameters:
view - the ant to be added, together with its environment

execute

public void execute()
Force the execution of one of the ants waiting to be executed and stored in this Manager.