|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.org.arlott.simon.hw.f24.lbsta.NetworkSimulation
public class NetworkSimulation
Simulation handler.
| Nested Class Summary | |
|---|---|
private class |
NetworkSimulation.Task
The simulation task. |
| Field Summary | |
|---|---|
private java.lang.Boolean |
active
Simulation active flag. |
private double |
aimSpeed
The speed to aim for. |
static int |
DEFAULT_SPEED
The default speed of the simulation. |
private java.lang.String |
lastScriptState
The last script state string. |
static int |
MAXIMUM_SPEED
The maximum speed of the simulation. |
static int |
MINIMUM_SPEED
The minimum speed of the simulation. |
private Network |
network
The Network to simulate on. |
private NetworkView |
networkView
The NetworkView to update. |
private double |
oldSpeed
The previous speed. |
private java.lang.Boolean |
running
Simulation should be running flag. |
private Script |
script
The Script to simulate with. |
private java.util.Timer |
simulation
The simulation timer. |
private double |
speed
The current speed. |
private boolean |
steppingMode
Whether or not stepping mode is being used. |
| Constructor Summary | |
|---|---|
NetworkSimulation(Network network,
NetworkView networkView,
Script script)
Creates a new network simulation handler. |
|
| Method Summary | |
|---|---|
void |
restart()
Restarts the simulation. |
void |
setSpeed(int speed)
Changes the speed of the simulation. |
void |
start(boolean steppingMode)
Starts the simulation. |
void |
stop(boolean block)
Stops the simulation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MINIMUM_SPEED
public static final int MAXIMUM_SPEED
public static final int DEFAULT_SPEED
private java.util.Timer simulation
private Network network
Network to simulate on.
private NetworkView networkView
NetworkView to update.
private Script script
Script to simulate with.
private double aimSpeed
private double speed
private double oldSpeed
private java.lang.Boolean active
private java.lang.Boolean running
private boolean steppingMode
private java.lang.String lastScriptState
| Constructor Detail |
|---|
public NetworkSimulation(Network network,
NetworkView networkView,
Script script)
network - The Network.networkView - The NetworkView.script - The Script.| Method Detail |
|---|
public void restart()
public void start(boolean steppingMode)
steppingMode - Use stepping mode.public void stop(boolean block)
block - Wait until the simulation is stopped before returning.public void setSpeed(int speed)
speed - The new speed to aim for.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||