public class SumoTraciConnection
extends Object
Constructor and Description |
---|
SumoTraciConnection(java.net.SocketAddress sockAddr) |
SumoTraciConnection(String sumo_bin) |
SumoTraciConnection(String configFile,
int randomSeed,
boolean useGeoOffset) |
SumoTraciConnection(String sumo_bin,
String configFile) |
SumoTraciConnection(String sumo_bin,
String net_file,
String route_file) |
SumoTraciConnection(String sumo_bin,
String net_file,
String route_file,
String additional_file) |
SumoTraciConnection(String sumo_bin,
String net_file,
String route_file,
String additional_file,
String gui_settings) |
Modifier and Type | Method and Description |
---|---|
void |
addObserver(java.util.Observer o) |
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_subscription(de.tudresden.sumo.subscription.Subscription cs) |
void |
do_timestep() |
void |
do_timestep(double targetTime) |
boolean |
isClosed()
Returns
true if the connection was closed by the user, or if
an IOException was thrown after the connection was made. |
void |
printSumoError(boolean b) |
void |
printSumoOutput(boolean b) |
void |
runServer()
Runs a SUMO instance and tries to connect at it.
|
public SumoTraciConnection(String sumo_bin)
public SumoTraciConnection(String sumo_bin, String net_file, String route_file)
public SumoTraciConnection(String sumo_bin, String net_file, String route_file, String additional_file)
public SumoTraciConnection(String sumo_bin, String net_file, String route_file, String additional_file, String gui_settings)
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.IOException
InterruptedException
public 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
Exception
public Object do_job_get(SumoCommand cmd) throws Exception
Exception
public void do_timestep() throws Exception
Exception
public void do_timestep(double targetTime) throws Exception
Exception
public void addObserver(java.util.Observer o)
public void do_subscription(de.tudresden.sumo.subscription.Subscription cs) throws Exception
Exception
public void printSumoOutput(boolean b)
public void printSumoError(boolean b)