public class

LocationService

extends EnvironmentService
java.lang.Object
   ↳ uk.ac.imperial.presage2.core.environment.EnvironmentService
     ↳ uk.ac.imperial.presage2.util.location.LocationService
Known Direct Subclasses

Class Overview

An EnvironmentService to provide information on the locations of agents.

Usage

Add as a global environment service in the environment

Summary

[Expand]
Inherited Fields
From class uk.ac.imperial.presage2.core.environment.EnvironmentService
Public Constructors
LocationService(EnvironmentSharedStateAccess sharedState, EnvironmentServiceProvider serviceProvider)
Public Methods
Location getAgentLocation(UUID participantID)
Get the location of a given agent specified by it's participant UUID.
void registerParticipant(EnvironmentRegistrationRequest req)
If any participant's location shared state is a 'Cell', we insert it into the global shared state via AreaService.
void setAgentLocation(UUID participantID, Location l)
Update this agent's location to l.
Protected Methods
AreaService getAreaService()
[Expand]
Inherited Methods
From class uk.ac.imperial.presage2.core.environment.EnvironmentService
From class java.lang.Object

Public Constructors

public LocationService (EnvironmentSharedStateAccess sharedState, EnvironmentServiceProvider serviceProvider)

Public Methods

public Location getAgentLocation (UUID participantID)

Get the location of a given agent specified by it's participant UUID.

Parameters
participantID UUID of participant to look up
Returns

public void registerParticipant (EnvironmentRegistrationRequest req)

If any participant's location shared state is a 'Cell', we insert it into the global shared state via AreaService.

public void setAgentLocation (UUID participantID, Location l)

Update this agent's location to l. If l is a Cell we update the information in the AreaService.

Protected Methods

protected AreaService getAreaService ()