public class SimulatorProxy extends AbstractKernelComponent
Constructor and Description |
---|
SimulatorProxy(java.lang.String name,
int id,
Connection c)
Construct a new simulator.
|
Modifier and Type | Method and Description |
---|---|
ChangeSet |
getUpdates(int time)
Get updates from this simulator.
|
void |
sendAgentCommands(int time,
java.util.Collection<? extends Command> commands)
Send a set of agent commands to this simulator.
|
void |
sendUpdate(int time,
ChangeSet update)
Send an update message to this simulator.
|
void |
setEntityIDGenerator(EntityIDGenerator generator)
Set the EntityIDGenerator.
|
java.lang.String |
toString() |
protected void |
updateReceived(int time,
ChangeSet changes)
Register an update from the simulator.
|
getConnection, getName, send, send, shutdown
public SimulatorProxy(java.lang.String name, int id, Connection c)
name
- The name of the simulator.id
- The ID of the simulator.c
- The connection this simulator is using.public ChangeSet getUpdates(int time) throws java.lang.InterruptedException
time
- The timestep to get updates for.java.lang.InterruptedException
- If this thread is interrupted while waiting for updates.public void sendUpdate(int time, ChangeSet update)
time
- The simulation time.update
- The updated entities.public void sendAgentCommands(int time, java.util.Collection<? extends Command> commands)
time
- The current time.commands
- The agent commands to send.public java.lang.String toString()
toString
in class java.lang.Object
public void setEntityIDGenerator(EntityIDGenerator generator)
generator
- The new EntityIDGenerator.protected void updateReceived(int time, ChangeSet changes)
time
- The timestep of the update.changes
- The set of changes.