Commit 1a267da0 authored by Chan Yong Lee's avatar Chan Yong Lee
Browse files

fixed run.sh for cli-simulation in linux environment

parent 5dfbd3aa
Pipeline #473348 passed with stage
in 1 minute and 11 seconds
......@@ -10,7 +10,8 @@
"cwd": "${workspaceFolder}/install",
"classPaths": [
"${workspaceFolder}/install/basic-simulator.jar"
]
],
//"args": "/home/bradreelee/BA/git/basic-simulator/install/scenarios/cppautopilot_direct.json"
}
]
}
\ No newline at end of file
......@@ -4,5 +4,5 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
pushd $DIR
java -jar basic-simulator.jar $*
java -jar basic-simulator.jar $DIR $1
popd
\ No newline at end of file
......@@ -20,6 +20,7 @@ import javax.swing.*;
import java.io.File;
import java.io.IOException;
import java.nio.file.Paths;
public class App
{
......@@ -61,9 +62,10 @@ public class App
FileSystem fileSystem = new FileSystem(LibraryService.getWorkingDirectory());
if (args.length > 0){
String scenario_name = args[0];
String current_directory = args[0];
String scenario_name = args[1];
System.out.println("Starting simulation with scenario: " + scenario_name);
runSimulation(scenario_name);
runSimulation(current_directory, scenario_name);
return;
}
......@@ -77,12 +79,12 @@ public class App
}
protected static void runSimulation(String path){
protected static void runSimulation(String currentDirectory, String scenarioName){
try {
// Create simulator from scenario file
File scenarioFile = new File(path);
File scenarioFile = new File(currentDirectory + "/scenarios/" + scenarioName);
SimulationConfig config = SimulationConfig.fromFile(scenarioFile);
File mapPath = new File(config.map_name + ".osm");
File mapPath = new File(currentDirectory + "/maps/" + config.map_name + ".osm");
OsmMap map = new OsmMap(config.map_name, mapPath);
World world = new OsmToWorldLoader(map).getWorld();
Pathfinding pathfinding = new PathfindingImpl(world);
......
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