Commit 57d90e93 authored by Marion Goedel's avatar Marion Goedel
Browse files

Merge branch 'develop' of https://gitlab.lrz.de/vadere/vadere into develop

parents 6b8a40a2 c7e0538c
Pipeline #64543 failed with stages
in 44 minutes and 27 seconds
......@@ -27,6 +27,12 @@ VadereModelTests/TestOSM_Group/output/*
VadereModelTests/TestSFM/output/*
VadereModelTests/TestGNM/output/*
VadereModelTests/TestOVM/output/*
VadereModelTests/TestOSM/legacy/*
VadereModelTests/TestOSM_Group/legacy/*
VadereModelTests/TestSFM/legacy/*
VadereModelTests/TestGNM/legacy/*
VadereModelTests/TestOVM/legacy/*
VadereModelTests/TESTOVM/legacy/*
VadereModelTests/TestOSM/processed output/*
VadereModelTests/TestOSM_Group/processed output/*
VadereModelTests/TestSFM/processed output/*
......@@ -44,3 +50,4 @@ VadereGui/output/
#linux deskopt dotfiles
**/.directory
/VadereModelTests/TestStairs/output
/VadereModelTests/TestStairs/legacy
......@@ -44,27 +44,48 @@ def run_scenario_files_with_vadere_console(scenario_files, vadere_console="Vader
total_scenario_files = len(scenario_files)
for i, scenario_file in enumerate(scenario_files):
print("Running scenario file ({}/{}): {}".format(i + 1, total_scenario_files, scenario_file))
# Measure wall time and not cpu because it is the easiest.
wall_time_start = time.time()
# Use timout feature, check return value and capture stdout/stderr to a PIPE (use completed_process.stdout to get it).
completed_process = subprocess.run(args=["java", "-enableassertions", "-jar", vadere_console, scenario_file, output_dir],
timeout=scenario_timeout_in_sec,
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
wall_time_end = time.time()
wall_time_delta = wall_time_end - wall_time_start
passed_scenarios = []
failed_scenarios_with_exception = []
print("Finished scenario file ({:.1f} s): {}".format(wall_time_delta, scenario_file))
for i, scenario_file in enumerate(scenario_files):
try:
print("Running scenario file ({}/{}): {}".format(i + 1, total_scenario_files, scenario_file))
# Measure wall time and not cpu because it is the easiest.
wall_time_start = time.time()
# Use timout feature, check return value and capture stdout/stderr to a PIPE (use completed_process.stdout to get it).
completed_process = subprocess.run(args=["java", "-enableassertions", "-jar", vadere_console, "scenario-run", "-f", scenario_file, "-o", output_dir],
timeout=scenario_timeout_in_sec,
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
wall_time_end = time.time()
wall_time_delta = wall_time_end - wall_time_start
print("Finished scenario file ({:.1f} s): {}".format(wall_time_delta, scenario_file))
passed_scenarios.append(scenario_file)
except subprocess.TimeoutExpired as exception:
print("Scenario file failed: {}".format(scenario_file))
print("-> Reason: timeout after {} s ({})".format(exception.timeout, exception.cmd))
failed_scenarios_with_exception.append((scenario_file, exception))
except subprocess.CalledProcessError as exception:
print("Scenario file failed: {}".format(scenario_file))
print("-> Reason: non-zero return value {} ({})".format(exception.returncode, exception.cmd))
failed_scenarios_with_exception.append((scenario_file, exception))
if os.path.exists(output_dir):
shutil.rmtree(output_dir)
return {"passed": passed_scenarios, "failed": failed_scenarios_with_exception}
if __name__ == "__main__":
scenario_files = find_scenario_files()
run_scenario_files_with_vadere_console(scenario_files)
passed_and_failed_scenarios = run_scenario_files_with_vadere_console(scenario_files)
if len(passed_and_failed_scenarios["failed"]) > 0:
exit(1)
else:
exit(0)
......@@ -11,6 +11,8 @@ import org.vadere.simulator.entrypoints.Version;
import org.vadere.simulator.projects.VadereProject;
import org.vadere.simulator.projects.io.IOVadere;
import org.vadere.simulator.projects.migration.MigrationAssistant;
import org.vadere.simulator.projects.migration.MigrationOptions;
import org.vadere.simulator.projects.migration.MigrationResult;
import javax.swing.*;
import java.awt.event.ActionEvent;
......@@ -54,6 +56,7 @@ public class ActionLoadProject extends AbstractAction {
//TODO: [refactoring]: static call which has side-effect to the following call!
if (isRemigrationLoading) {
MigrationOptions migrationOptions;
Object option = JOptionPane.showInputDialog(null,
Messages.getString("ProjectView.chooseMigrationBaseDialog.text"),
Messages.getString("ProjectView.chooseMigrationBaseDialog.title"),
......@@ -61,17 +64,19 @@ public class ActionLoadProject extends AbstractAction {
options, options[options.length-1]);
if(option.equals(options[options.length-1])) {
MigrationAssistant.setReapplyLatestMigrationFlag();
migrationOptions = MigrationOptions.reapplyWithAutomaticVersionDiscorvery();
}
else {
Version version = (Version)option;
MigrationAssistant.setReapplyLatestMigrationFlag(version);
migrationOptions = MigrationOptions.reapplyFromVersion((Version)option);
}
// 3. load project
loadProjectByPath(model, projectFilePath, migrationOptions);
} else {
// 3. load project
loadProjectByPath(model, projectFilePath);
}
// 3. load project
loadProjectByPath(model, projectFilePath);
} else {
logger.info(String.format("user canceled load project."));
......@@ -97,9 +102,12 @@ public class ActionLoadProject extends AbstractAction {
ProjectView.getMainWindow().updateRecentProjectsMenu();
}
public static void loadProjectByPath(ProjectViewModel projectViewModel, String projectFilePath) {
public static void loadProjectByPath(ProjectViewModel projectViewModel, String projectFilePath){
loadProjectByPath(projectViewModel, projectFilePath, MigrationOptions.defaultOptions());
}
public static void loadProjectByPath(ProjectViewModel projectViewModel, String projectFilePath, MigrationOptions options) {
try {
VadereProject project = IOVadere.readProjectJson(projectFilePath);
VadereProject project = IOVadere.readProjectJson(projectFilePath, options);
projectViewModel.setCurrentProjectPath(projectFilePath);
projectViewModel.setProject(project);
......@@ -118,15 +126,15 @@ public class ActionLoadProject extends AbstractAction {
logger.info(String.format("project '%s' loaded.", projectViewModel.getProject().getName()));
// results from migration assistant if he was active
int[] stats = project.getMigrationStats();
MigrationResult stats = project.getMigrationStats();
if (stats[1] > 0 || stats[2] > 0) { // scenarios: [0] total, [1] legacy'ed, [2] unmigratable
if (stats.legacy > 0 || stats.notmigratable > 0) { // scenarios: [0] total, [1] legacy'ed, [2] unmigratable
SwingWorker<Void, Void> worker = new SwingWorker<Void, Void>() {
@Override
public Void doInBackground() {
int total = stats[0];
int migrated = stats[1];
int nonmigratable = stats[2];
int total = stats.total;
int migrated = stats.legacy;
int nonmigratable = stats.notmigratable;
int untouched = total - migrated - nonmigratable;
// TODO pull this text from the language files
......@@ -148,16 +156,18 @@ public class ActionLoadProject extends AbstractAction {
JOptionPane.showMessageDialog(
ProjectView.getMainWindow(),
message, "Migration assistant",
message, "JoltMigrationAssistant assistant",
JOptionPane.INFORMATION_MESSAGE);
return null;
}
};
worker.execute();
} else {
logger.info("Nothing to migrate all up to date " + stats);
}
} catch (Exception e) {
JOptionPane.showMessageDialog(null, e.getMessage(), "Migration assistant",
JOptionPane.showMessageDialog(null, e.getMessage(), "JoltMigrationAssistant assistant",
JOptionPane.ERROR_MESSAGE);
logger.error("could not load project: " + e.getMessage());
e.printStackTrace();
......
{
"name" : "Neues_Szenario",
"description" : "",
"release" : "0.1",
"release" : "0.3",
"commithash" : "warning: no commit hash",
"processWriters" : {
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
......@@ -227,7 +228,7 @@
"obstacleGridPenalty" : 0.1,
"targetAttractionStrength" : 1.0,
"timeCostAttributes" : {
"standardDerivation" : 0.7,
"standardDeviation" : 0.7,
"type" : "UNIT",
"obstacleDensityWeight" : 3.5,
"pedestrianSameTargetDensityWeight" : 3.5,
......@@ -328,7 +329,6 @@
"targetIds" : [ 1, 2 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
"attributesPedestrian" : {
"radius" : 0.195,
"densityDependentSpeed" : false,
......@@ -338,7 +338,8 @@
"maximumSpeed" : 3.0,
"acceleration" : 2.0
},
"attributesCar" : null
"attributesCar" : null,
"dynamicElements" : [ ]
}
}
}
\ No newline at end of file
{
"name" : "basic_5_1_roadReachTarget_ovm1",
"description" : "",
"release" : "0.2",
"release" : "0.3",
"processWriters" : {
"files" : [ ],
"processors" : [ ],
......@@ -105,6 +105,7 @@
"spawnAtRandomPositions" : false,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 1.0 ],
"dynamicElementType" : "CAR"
} ],
"dynamicElements" : [ ],
......
{
"name" : "basic_5_2_roadReachTarget_ovm1",
"description" : "",
"release" : "0.2",
"release" : "0.3",
"processWriters" : {
"files" : [ ],
"processors" : [ ],
......@@ -122,6 +122,7 @@
"spawnAtRandomPositions" : false,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1, 2 ],
"groupSizeDistribution" : [ 1.0 ],
"dynamicElementType" : "CAR"
} ],
"dynamicElements" : [ ],
......
{
"name" : "testtrafficlight",
"description" : "",
"release" : "0.2",
"release" : "0.3",
"processWriters" : {
"files" : [ ],
"processors" : [ ],
......@@ -10,15 +10,6 @@
"scenario" : {
"mainModel" : "org.vadere.simulator.models.osm.OptimalStepsModel",
"attributesModel" : {
"org.vadere.state.attributes.models.AttributesPotentialCompact" : {
"pedPotentialWidth" : 0.5,
"pedPotentialHeight" : 12.6,
"obstPotentialWidth" : 0.25,
"obstPotentialHeight" : 20.1,
"useHardBodyShell" : false,
"obstDistanceDeviation" : 0.0,
"visionFieldRadius" : 5.0
},
"org.vadere.state.attributes.models.AttributesOSM" : {
"stepCircleResolution" : 18,
"numberOfCircles" : 1,
......@@ -38,13 +29,22 @@
"obstaclePotentialModel" : "org.vadere.simulator.models.potential.PotentialFieldObstacleCompact",
"submodels" : [ ]
},
"org.vadere.state.attributes.models.AttributesPotentialCompact" : {
"pedPotentialWidth" : 0.5,
"pedPotentialHeight" : 12.6,
"obstPotentialWidth" : 0.25,
"obstPotentialHeight" : 20.1,
"useHardBodyShell" : false,
"obstDistanceDeviation" : 0.0,
"visionFieldRadius" : 5.0
},
"org.vadere.state.attributes.models.AttributesFloorField" : {
"createMethod" : "HIGH_ACCURACY_FAST_MARCHING",
"potentialFieldResolution" : 0.1,
"obstacleGridPenalty" : 0.1,
"targetAttractionStrength" : 1.0,
"timeCostAttributes" : {
"standardDerivation" : 0.7,
"standardDeviation" : 0.7,
"type" : "UNIT",
"obstacleDensityWeight" : 3.5,
"pedestrianSameTargetDensityWeight" : 3.5,
......@@ -134,6 +134,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1, 2 ],
"groupSizeDistribution" : [ 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
{
"name" : "basic_1_chicken_gnm1",
"description" : "",
"release" : "0.2",
"release" : "0.3",
"processWriters" : {
"files" : [ ],
"processors" : [ ],
......@@ -10,12 +10,6 @@
"scenario" : {
"mainModel" : "org.vadere.simulator.models.gnm.GradientNavigationModel",
"attributesModel" : {
"org.vadere.state.attributes.models.AttributesPotentialGNM" : {
"pedestrianBodyPotential" : 3.59,
"pedestrianRecognitionDistance" : 0.7,
"obstacleBodyPotential" : 20.1,
"obstacleRepulsionStrength" : 0.25
},
"org.vadere.state.attributes.models.AttributesGNM" : {
"attributesODEIntegrator" : {
"solverType" : "DORMAND_PRINCE_45",
......@@ -35,7 +29,7 @@
"obstacleGridPenalty" : 0.1,
"targetAttractionStrength" : 1.0,
"timeCostAttributes" : {
"standardDerivation" : 0.7,
"standardDeviation" : 0.7,
"type" : "UNIT",
"obstacleDensityWeight" : 3.5,
"pedestrianSameTargetDensityWeight" : 3.5,
......@@ -45,6 +39,12 @@
"pedestrianDynamicWeight" : 6.0,
"loadingType" : "CONSTANT"
}
},
"org.vadere.state.attributes.models.AttributesPotentialGNM" : {
"pedestrianBodyPotential" : 3.59,
"pedestrianRecognitionDistance" : 0.7,
"obstacleBodyPotential" : 20.1,
"obstacleRepulsionStrength" : 0.25
}
},
"attributesSimulation" : {
......@@ -135,6 +135,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
{
"name" : "basic_1_chicken_gnm2",
"description" : "",
"release" : "0.2",
"release" : "0.3",
"processWriters" : {
"files" : [ ],
"processors" : [ ],
......@@ -10,12 +10,6 @@
"scenario" : {
"mainModel" : "org.vadere.simulator.models.gnm.GradientNavigationModel",
"attributesModel" : {
"org.vadere.state.attributes.models.AttributesPotentialGNM" : {
"pedestrianBodyPotential" : 3.59,
"pedestrianRecognitionDistance" : 0.7,
"obstacleBodyPotential" : 20.1,
"obstacleRepulsionStrength" : 0.25
},
"org.vadere.state.attributes.models.AttributesGNM" : {
"attributesODEIntegrator" : {
"solverType" : "DORMAND_PRINCE_45",
......@@ -35,7 +29,7 @@
"obstacleGridPenalty" : 0.1,
"targetAttractionStrength" : 1.0,
"timeCostAttributes" : {
"standardDerivation" : 0.7,
"standardDeviation" : 0.7,
"type" : "UNIT",
"obstacleDensityWeight" : 3.5,
"pedestrianSameTargetDensityWeight" : 3.5,
......@@ -45,6 +39,12 @@
"pedestrianDynamicWeight" : 6.0,
"loadingType" : "CONSTANT"
}
},
"org.vadere.state.attributes.models.AttributesPotentialGNM" : {
"pedestrianBodyPotential" : 3.59,
"pedestrianRecognitionDistance" : 0.7,
"obstacleBodyPotential" : 20.1,
"obstacleRepulsionStrength" : 0.25
}
},
"attributesSimulation" : {
......@@ -135,6 +135,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
{
"name" : "basic_2_density_gnm1",
"description" : "",
"release" : "0.2",
"release" : "0.3",
"processWriters" : {
"files" : [ ],
"processors" : [ ],
......@@ -10,12 +10,6 @@
"scenario" : {
"mainModel" : "org.vadere.simulator.models.gnm.GradientNavigationModel",
"attributesModel" : {
"org.vadere.state.attributes.models.AttributesPotentialGNM" : {
"pedestrianBodyPotential" : 3.59,
"pedestrianRecognitionDistance" : 0.7,
"obstacleBodyPotential" : 20.1,
"obstacleRepulsionStrength" : 0.25
},
"org.vadere.state.attributes.models.AttributesGNM" : {
"attributesODEIntegrator" : {
"solverType" : "DORMAND_PRINCE_45",
......@@ -35,7 +29,7 @@
"obstacleGridPenalty" : 0.1,
"targetAttractionStrength" : 1.0,
"timeCostAttributes" : {
"standardDerivation" : 0.7,
"standardDeviation" : 0.7,
"type" : "UNIT",
"obstacleDensityWeight" : 3.5,
"pedestrianSameTargetDensityWeight" : 3.5,
......@@ -45,6 +39,12 @@
"pedestrianDynamicWeight" : 6.0,
"loadingType" : "CONSTANT"
}
},
"org.vadere.state.attributes.models.AttributesPotentialGNM" : {
"pedestrianBodyPotential" : 3.59,
"pedestrianRecognitionDistance" : 0.7,
"obstacleBodyPotential" : 20.1,
"obstacleRepulsionStrength" : 0.25
}
},
"attributesSimulation" : {
......@@ -144,6 +144,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
{
"name" : "basic_3_1_wall_gnm1",
"description" : "",
"release" : "0.2",
"release" : "0.3",
"processWriters" : {
"files" : [ ],
"processors" : [ ],
......@@ -10,12 +10,6 @@
"scenario" : {
"mainModel" : "org.vadere.simulator.models.gnm.GradientNavigationModel",
"attributesModel" : {
"org.vadere.state.attributes.models.AttributesPotentialGNM" : {
"pedestrianBodyPotential" : 3.59,
"pedestrianRecognitionDistance" : 0.7,
"obstacleBodyPotential" : 20.1,
"obstacleRepulsionStrength" : 0.25
},
"org.vadere.state.attributes.models.AttributesGNM" : {
"attributesODEIntegrator" : {
"solverType" : "DORMAND_PRINCE_45",
......@@ -35,7 +29,7 @@
"obstacleGridPenalty" : 0.1,
"targetAttractionStrength" : 1.0,
"timeCostAttributes" : {
"standardDerivation" : 0.7,
"standardDeviation" : 0.7,
"type" : "UNIT",
"obstacleDensityWeight" : 3.5,
"pedestrianSameTargetDensityWeight" : 3.5,
......@@ -45,6 +39,12 @@
"pedestrianDynamicWeight" : 6.0,
"loadingType" : "CONSTANT"
}
},
"org.vadere.state.attributes.models.AttributesPotentialGNM" : {
"pedestrianBodyPotential" : 3.59,
"pedestrianRecognitionDistance" : 0.7,
"obstacleBodyPotential" : 20.1,
"obstacleRepulsionStrength" : 0.25
}
},
"attributesSimulation" : {
......@@ -117,6 +117,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
{
"name" : "basic_3_2_wall_gnm1",
"description" : "",
"release" : "0.2",
"release" : "0.3",
"processWriters" : {
"files" : [ ],
"processors" : [ ],
......@@ -10,12 +10,6 @@
"scenario" : {
"mainModel" : "org.vadere.simulator.models.gnm.GradientNavigationModel",
"attributesModel" : {
"org.vadere.state.attributes.models.AttributesPotentialGNM" : {
"pedestrianBodyPotential" : 3.59,
"pedestrianRecognitionDistance" : 0.7,
"obstacleBodyPotential" : 20.1,
"obstacleRepulsionStrength" : 0.25
},
"org.vadere.state.attributes.models.AttributesGNM" : {
"attributesODEIntegrator" : {
"solverType" : "DORMAND_PRINCE_45",
......@@ -35,7 +29,7 @@
"obstacleGridPenalty" : 0.1,
"targetAttractionStrength" : 1.0,
"timeCostAttributes" : {
"standardDerivation" : 0.7,
"standardDeviation" : 0.7,
"type" : "UNIT",
"obstacleDensityWeight" : 3.5,
"pedestrianSameTargetDensityWeight" : 3.5,
......@@ -45,6 +39,12 @@
"pedestrianDynamicWeight" : 6.0,
"loadingType" : "CONSTANT"
}
},
"org.vadere.state.attributes.models.AttributesPotentialGNM" : {
"pedestrianBodyPotential" : 3.59,
"pedestrianRecognitionDistance" : 0.7,
"obstacleBodyPotential" : 20.1,
"obstacleRepulsionStrength" : 0.25
}
},
"attributesSimulation" : {
......@@ -117,6 +117,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
{
"name" : "basic_3_3_wall_gnm1",
"description" : "",
"release" : "0.2",
"release" : "0.3",
"processWriters" : {
"files" : [ ],
"processors" : [ ],
......@@ -10,12 +10,6 @@
"scenario" : {
"mainModel" : "org.vadere.simulator.models.gnm.GradientNavigationModel",
"attributesModel" : {
"org.vadere.state.attributes.models.AttributesPotentialGNM" : {
"pedestrianBodyPotential" : 3.59,
"pedestrianRecognitionDistance" : 0.7,
"obstacleBodyPotential" : 20.1,
"obstacleRepulsionStrength" : 0.25
},
"org.vadere.state.attributes.models.AttributesGNM" : {
"attributesODEIntegrator" : {
"solverType" : "DORMAND_PRINCE_45",
......@@ -35,7 +29,7 @@
"obstacleGridPenalty" : 0.1,
"targetAttractionStrength" : 1.0,
"timeCostAttributes" : {
"standardDerivation" : 0.7,
"standardDeviation" : 0.7,
"type" : "UNIT",
"obstacleDensityWeight" : 3.5,
"pedestrianSameTargetDensityWeight" : 3.5,
......@@ -45,6 +39,12 @@
"pedestrianDynamicWeight" : 6.0,
"loadingType" : "CONSTANT"
}
},
"org.vadere.state.attributes.models.AttributesPotentialGNM" : {
"pedestrianBodyPotential" : 3.59,
"pedestrianRecognitionDistance" : 0.7,
"obstacleBodyPotential" : 20.1,
"obstacleRepulsionStrength" : 0.25
}
},
"attributesSimulation" : {
......@@ -117,6 +117,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
{
"name" : "basic_4_1_wall_gnm1",
"description" : "",
"release" : "0.2",