public final class RealTimePlatform extends Platform
Typical use of this platform is shown below:
import org.arl.fjage.*; Platform platform = new RealTimePlatform(); Container container = new Container(platform); container.add("myAgent", new myAgent()); // add appropriate agents platform.start();
containers, running
Constructor and Description |
---|
RealTimePlatform() |
Modifier and Type | Method and Description |
---|---|
long |
currentTimeMillis()
Gets the current platform time in milliseconds.
|
void |
delay(long millis)
Delays execution by a specified number of milliseconds of platform time.
|
void |
idle()
Internal method called by a container when all agents are idle.
|
long |
nanoTime()
Gets the current platform time in nanoseconds.
|
void |
schedule(java.util.TimerTask task,
long millis)
Schedules a task to be executed at a given platform time.
|
addContainer, getBuildVersion, getContainers, getHostname, getNetworkInterface, isIdle, isRunning, setHostname, setNetworkInterface, setNetworkInterface, shutdown, start
public long currentTimeMillis()
Platform
currentTimeMillis
in interface TimestampProvider
currentTimeMillis
in class Platform
public long nanoTime()
Platform
nanoTime
in interface TimestampProvider
nanoTime
in class Platform
public void schedule(java.util.TimerTask task, long millis)
Platform
public void idle()
Platform
public void delay(long millis)
Platform
This method should not be called by an agent directly, as it may deadlock.
An agent should use Agent.delay(long)
instead.