public class

ConstrainedNetworkController

extends NetworkController
java.lang.Object
   ↳ uk.ac.imperial.presage2.core.network.NetworkController
     ↳ uk.ac.imperial.presage2.core.network.ConstrainedNetworkController

Class Overview

A NetworkController which allows the use of NetworkConstraint s.

NetworkConstraints may modify messages when they are received from the sender, or block the sending of a message at the point of delivery to an individual.

Summary

Fields
protected Set<NetworkConstraint> constraints
[Expand]
Inherited Fields
From class uk.ac.imperial.presage2.core.network.NetworkController
Public Constructors
ConstrainedNetworkController(Time time, EnvironmentSharedStateAccess environment, Scenario s)
Public Methods
void addConstaints(Set<NetworkConstraint> cons)
void addConstraint(NetworkConstraint c)
void incrementTime()
Protected Methods
void deliverMessageTo(NetworkAddress to, Message m)
Deliver a message m to recipient to.
Pong getPong(Ping p)
Return a Pong for the given Ping.
void handleMessage(Message m)
[Expand]
Inherited Methods
From class uk.ac.imperial.presage2.core.network.NetworkController
From class java.lang.Object
From interface uk.ac.imperial.presage2.core.TimeDriven
From interface uk.ac.imperial.presage2.core.network.NetworkChannel
From interface uk.ac.imperial.presage2.core.network.RequiresRegistration

Fields

protected Set<NetworkConstraint> constraints

Public Constructors

public ConstrainedNetworkController (Time time, EnvironmentSharedStateAccess environment, Scenario s)

Public Methods

public void addConstaints (Set<NetworkConstraint> cons)

public void addConstraint (NetworkConstraint c)

public void incrementTime ()

Protected Methods

protected void deliverMessageTo (NetworkAddress to, Message m)

Deliver a message m to recipient to.

protected Pong getPong (Ping p)

Return a Pong for the given Ping. This is a message containing the set of NetworkAddresses of devices we're connected with.

Returns
  • Pong

protected void handleMessage (Message m)