public class

CommunicationRangeService

extends EnvironmentService
java.lang.Object
   ↳ uk.ac.imperial.presage2.core.environment.EnvironmentService
     ↳ uk.ac.imperial.presage2.util.environment.CommunicationRangeService

Class Overview

An EnvironmentService to retrieve agents' communication ranges.

Usage

Agents which have communication range to share (implementing HasCommunicationRange) can create shared state when registering with the environment with #createSharedState(UUID, HasCommunicationRange):

 ParticipantSharedState<Double> ss = CommunicationRangeService.createSharedState(myid, commRange);
 

In the environment we add this as a global environment service.

Summary

[Expand]
Inherited Fields
From class uk.ac.imperial.presage2.core.environment.EnvironmentService
Public Constructors
CommunicationRangeService(EnvironmentSharedStateAccess sharedState)
Public Methods
static ParticipantSharedState createSharedState(UUID pid, double range)
Create the shared state required for this service.
double getAgentCommunicationRange(UUID participantID)
[Expand]
Inherited Methods
From class uk.ac.imperial.presage2.core.environment.EnvironmentService
From class java.lang.Object

Public Constructors

public CommunicationRangeService (EnvironmentSharedStateAccess sharedState)

Public Methods

public static ParticipantSharedState createSharedState (UUID pid, double range)

Create the shared state required for this service.

Parameters
pid UUID of the participant to create shared state for.
range initial communication range value for this participant
Returns

public double getAgentCommunicationRange (UUID participantID)