public class SumoTraciConnection
extends Object
| Constructor and Description |
|---|
SumoTraciConnection(java.net.SocketAddress sockAddr) |
SumoTraciConnection(String configFile,
int randomSeed,
boolean useGeoOffset) |
SumoTraciConnection(String sumo_bin,
String configFile) |
SumoTraciConnection(String sumo_bin,
String net_file,
String route_file) |
| Modifier and Type | Method and Description |
|---|---|
void |
addOption(String option,
String value)
Adds a custom option to the SUMO command line before executing it.
|
void |
close()
Closes the connection, quits the simulator, frees any stale
resource and makes all
Vehicle instances inactive. |
Object |
do_job_get(SumoCommand cmd) |
void |
do_job_set(SumoCommand cmd) |
void |
do_timestep() |
boolean |
isClosed()
Returns
true if the connection was closed by the user, or if
an IOException was thrown after the connection was made. |
void |
runServer()
Runs a SUMO instance and tries to connect at it.
|
public SumoTraciConnection(String sumo_bin,
String net_file,
String route_file)
public SumoTraciConnection(String sumo_bin,
String configFile)
public SumoTraciConnection(String configFile,
int randomSeed,
boolean useGeoOffset)
public SumoTraciConnection(java.net.SocketAddress sockAddr)
throws java.io.IOException,
InterruptedException
java.io.IOExceptionInterruptedExceptionpublic void addOption(String option,
String value)
option - the option name, in long form (e.g. "no-warnings"
instead of "W") and without initial dashesvalue - the option value, or null if the option has no
valuepublic void runServer()
throws java.io.IOException
java.io.IOException - if something wrong occurs while starting SUMO or connecting
at it.public void close()
Vehicle instances inactive.public boolean isClosed()
true if the connection was closed by the user, or if
an IOException was thrown after the connection was made.close()public void do_job_set(SumoCommand cmd) throws Exception
Exceptionpublic Object do_job_get(SumoCommand cmd) throws Exception
Exceptionpublic void do_timestep()
throws Exception
Exception