Commit 245cea17 authored by Tobias Meuser's avatar Tobias Meuser
Browse files

Moved temporary road network file to user.home

parent 46b4892b
......@@ -58,7 +58,7 @@ import it.polito.appeal.traci.SumoTraciConnection;
*
*/
public class TraciSimulationController implements VehicleController, SimulationSetupExtractor, EdgeController, SimulatorObserver {
private static final File TEMP_FILE = new File(new File(System.getProperty("java.io.tmpdir")), "road_network.tmp");
private static final File TEMP_FILE = new File(new File(System.getProperty("user.home") + "/.simonstrator"), "road_network.tmp");
private static final boolean TRAIN_PATH_PROBABILITIES = true;
......@@ -752,12 +752,14 @@ public class TraciSimulationController implements VehicleController, SimulationS
_roadNetwork = new RoadNetwork(roadNetwork, this, true);
try {
ObjectOutputStream outputStream = new ObjectOutputStream(new FileOutputStream(TEMP_FILE));
if (TEMP_FILE.exists() || TEMP_FILE.getParentFile().mkdirs()) {
ObjectOutputStream outputStream = new ObjectOutputStream(new FileOutputStream(TEMP_FILE));
outputStream.writeObject(new SerializableRoadNetwork(_roadNetwork));
outputStream.writeObject(new SerializableRoadNetwork(_roadNetwork));
outputStream.flush();
outputStream.close();
outputStream.flush();
outputStream.close();
}
} catch (IOException e) {
//Nothing to do
e.printStackTrace();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment