| java.lang.Object | |||
| ↳ | uk.ac.imperial.presage2.core.environment.EnvironmentService | ||
| ↳ | uk.ac.imperial.presage2.util.location.LocationService | ||
| ↳ | uk.ac.imperial.presage2.util.location.ParticipantLocationService | ||
This is an extension of the LocationService to provide tools
specifically for Participants. This class can also handle the
ParticipantSharedState of Location for the agent using it.
Some functions depend on the environment having an
EnvironmentMembersService available
Agents who have Location to share (implementing HasLocation)
can create shared state which registering with the environment with
#createSharedState(UUID, HasLocation):
ParticipantSharedState<Location> ss = ParticipantLocationService .createSharedState(myID, myLoc);
The environment should provide this service in the
EnvironmentRegistrationResponse:
ParticipantLocationService p = new ParticipantLocationService(participant, sharedState, serviceProvider);
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| membersService | |||||||||||
| myID | |||||||||||
| rangeProvider | |||||||||||
|
[Expand]
Inherited Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
uk.ac.imperial.presage2.core.environment.EnvironmentService
| |||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Create a | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Create the
ParticipantSharedState required for this service. | |||||||||||
Get the location of a given agent specified by it's participant UUID.
| |||||||||||
Get the agents who are visible to me at this time and their
Locations. | |||||||||||
Not available for Participant use!
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
uk.ac.imperial.presage2.util.location.LocationService
| |||||||||||
From class
uk.ac.imperial.presage2.core.environment.EnvironmentService
| |||||||||||
From class
java.lang.Object
| |||||||||||
Create a ParticipantLocationService for Participant p
which has a location provided by hasLoc, perception range provided by
hasRange. The EnvironmentSharedStateAccess is provided by
sharedState. This constructor will create a new
ParticipantSharedState for Location from the given
HasLocation
| hasRange | HasPerceptionRange which provides the range at which
this agent can perceive other agents. |
|---|---|
| sharedState | EnvironmentSharedStateAccess which this
EnvironmentService should use. |
| serviceProvider | EnvironmentServiceProvider for fetching dependencies
|
Create the ParticipantSharedState required for this service.
| pid | UUID of the participant to create sharedstate object for. |
|---|---|
| loc | Location initial location for this participant. |
ParticipantSharedState on the type that this service
uses.
Get the location of a given agent specified by it's participant UUID.
| participantID | UUID of participant to look up |
|---|
Location of participants
Not available for Participant use!