java.lang.Object | |
↳ | uk.ac.imperial.presage2.util.participant.AbstractParticipant |
This implements the core of a Participant
to manage the majority of
the mundane functions allowing the user to start writing the agent's
behaviours sooner. It implements EnvironmentServiceProvider
to
provide an interface to EnvironmentService
s that are available to the
agent
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AbstractParticipant.State<T> |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
authkey | This Participant's authkey obtained when registering with the environment. | ||||||||||
environment | Connector to the environment the participant is in. | ||||||||||
inputQueue | FIFO queue of inputs to be processed. | ||||||||||
logger | Logger for this agent. | ||||||||||
persist | Persistence of this agent into the database. | ||||||||||
services | Set of EnvironmentService s available to the agent. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Basic Participant constructor. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds a new input to be processed by this participant.
| |||||||||||
Adds multiple new inputs to be processed by this participant.
| |||||||||||
Returns the participant's unique ID.
| |||||||||||
Returns a unique string identifier for this participant.
| |||||||||||
The initialisation process for the AbstractParticipant involves the following:
| |||||||||||
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Get the set of shared states that this Participant has.
| |||||||||||
Initialises
inputQueue which will be a FIFO
queue for Inputs received by the Participant. | |||||||||||
Process the |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
uk.ac.imperial.presage2.core.environment.EnvironmentServiceProvider
| |||||||||||
From interface
uk.ac.imperial.presage2.core.participant.Participant
|
This Participant's authkey obtained when registering with the environment.
Connector to the environment the participant is in.
Persistence of this agent into the database.
Set of EnvironmentService
s available to the agent.
Basic Participant constructor.
Requires environment & network to be injected by field injection. This can be done either by creating this object with a guice injector or by using on-demand injection:
Injector injector = Guice.createInjector(...); RealParticipant participant = new RealParticipant(...); injector.injectMembers(participant);
Adds a new input to be processed by this participant.
Adds multiple new inputs to be processed by this participant.
UnavailableServiceException |
---|
Returns the participant's unique ID.
Returns a unique string identifier for this participant. This is used purely for a human readable identifier of the agent so the unique requirement is not mandatory. However it is convenient.
The initialisation process for the AbstractParticipant involves the following:
Get the set of shared states that this Participant has. Used for the environment registration request for this participant.
Initialises inputQueue
which will be a FIFO
queue for Inputs received by the Participant.
Process the EnvironmentService
s from environment registration.
This will probably involve looking for ones you can use, pulling them out, and casting them to the correct type.