Commit d668add0 authored by Daniel Lehmberg's avatar Daniel Lehmberg
Browse files

adapt Nelder mead tests that appear after bugfixes in commit...

adapt Nelder mead tests that appear after bugfixes in commit 65f369b8 (minor changes)
parent ceb5b820
...@@ -256,12 +256,7 @@ if __name__ == "__main__": ...@@ -256,12 +256,7 @@ if __name__ == "__main__":
if args.scenario is None: if args.scenario is None:
passed_and_failed_scenarios_model = run_all_model_tests() passed_and_failed_scenarios_model = run_all_model_tests()
passed_and_failed_scenarios_optimization = run_all_optimization_tests()
if not result_dict_has_failed_tests(passed_and_failed_scenarios_model):
passed_and_failed_scenarios_optimization = run_all_optimization_tests()
else:
print("Skipping optimization tests...")
passed_and_failed_scenarios_optimization = {"failed": [], "passed": [], "failed_summary": []} # empty
# Make a summery of all scenario files # Make a summery of all scenario files
all_passed_and_failed_scenarios = result_dict_merge(passed_and_failed_scenarios_model, all_passed_and_failed_scenarios = result_dict_merge(passed_and_failed_scenarios_model,
......
...@@ -12,14 +12,14 @@ ...@@ -12,14 +12,14 @@
"expectedResult" : "SUCCESS", "expectedResult" : "SUCCESS",
"optimizationMetricProcessorId" : 2, "optimizationMetricProcessorId" : 2,
"testEvacuationProcessorId" : 3, "testEvacuationProcessorId" : 3,
"maxMeanPointDistance" : 0.07522399192836575, "maxMeanPointDistance" : 0.07720166933228925,
"maxMeanDifferenceFuncValue" : 0.023848826871958207, "maxMeanDifferenceFuncValue" : 0.02530975248920717,
"infoMinPointDistanceL2" : 0.0, "infoMinPointDistanceL2" : 0.0,
"infoMaxPointDistanceL2" : 1.564386140233547, "infoMaxPointDistanceL2" : 1.243960344866288,
"infoMinFuncDifference" : -7.357495880544462E-6, "infoMinFuncDifference" : -6.8591881827728685E-6,
"infoMaxFuncDifference" : 0.33222591981368765, "infoMaxFuncDifference" : 0.2874895188283819,
"infoStddevPointDistance" : 0.09544596760319345, "infoStddevPointDistance" : 0.10083846350068452,
"infoStddevDifferenceFuncValue" : 0.0336543527990736 "infoStddevDifferenceFuncValue" : 0.032918942463911124
} }
}, { }, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianMetricOptimizationProcessor", "type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianMetricOptimizationProcessor",
......
...@@ -12,14 +12,14 @@ ...@@ -12,14 +12,14 @@
"expectedResult" : "SUCCESS", "expectedResult" : "SUCCESS",
"optimizationMetricProcessorId" : 2, "optimizationMetricProcessorId" : 2,
"testEvacuationProcessorId" : 3, "testEvacuationProcessorId" : 3,
"maxMeanPointDistance" : 0.06743253584052734, "maxMeanPointDistance" : 0.0709316978693857,
"maxMeanDifferenceFuncValue" : 0.03762845011019873, "maxMeanDifferenceFuncValue" : 0.034637431592363405,
"infoMinPointDistanceL2" : 0.0, "infoMinPointDistanceL2" : 0.0,
"infoMaxPointDistanceL2" : 1.1908766074958799, "infoMaxPointDistanceL2" : 1.326056350852655,
"infoMinFuncDifference" : -0.007825774248588324, "infoMinFuncDifference" : -0.010140720593533104,
"infoMaxFuncDifference" : 3.1836042315887085, "infoMaxFuncDifference" : 2.113085584226426,
"infoStddevPointDistance" : 0.11888918094737598, "infoStddevPointDistance" : 0.12198739340543781,
"infoStddevDifferenceFuncValue" : 0.14690668533173323 "infoStddevDifferenceFuncValue" : 0.09742478889202222
} }
}, { }, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianMetricOptimizationProcessor", "type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianMetricOptimizationProcessor",
......
...@@ -124,24 +124,26 @@ public final class FootStep { ...@@ -124,24 +124,26 @@ public final class FootStep {
return intersectionTime; return intersectionTime;
} }
static public VPoint interpolateFootStep(FootStep footStep, double time){ static public VPoint interpolateFootStep(final FootStep footStep, final double time){
double startTime = footStep.getStartTime(); final double startTime = footStep.getStartTime();
double endTime = footStep.getEndTime(); final double endTime = footStep.getEndTime();
double duration = footStep.duration(); final double duration = footStep.duration();
if(startTime > time || endTime < time || startTime < 0 ){ if(startTime > time || endTime < time || startTime < 0 ){
throw new IllegalArgumentException("Requested time " + time + " outside of valid region. Outside of " + throw new IllegalArgumentException("Requested time " + time + " outside of valid time " +
"FootStep [start=" + startTime + ", end=" + endTime + "] time (no extrapolation!) or smaller than " + "region (no extrapolation!). Value outside of FootStep " +
"zero;"); "[start=" + startTime + ", end=" + endTime + "] time or smaller than zero. " +
"\n FootStep=" + footStep.toString());
} }
VPoint interpolationResult; VPoint interpolationResult;
if(duration < 1E-14){ if(duration < 1E-14){
// to avoid problems with division by very small number, simply return the start point // to avoid problems with division by "very small number", simply return the start point
interpolationResult = footStep.getStart(); interpolationResult = footStep.getStart();
}else{ }else{
double linearTime = (time - startTime) / duration; double linearTime = (time - startTime) / duration;
VPoint diffPoint = footStep.getEnd().subtract(footStep.getStart()); VPoint diffPoint = footStep.getEnd().subtract(footStep.getStart());
diffPoint.x = diffPoint.x * linearTime; diffPoint.x = diffPoint.x * linearTime;
...@@ -156,7 +158,7 @@ public final class FootStep { ...@@ -156,7 +158,7 @@ public final class FootStep {
@Override @Override
public String toString() { public String toString() {
return start + "->" + end; return "start=" + start + "(t=" + startTime + ")" + "->" + "end=" + end + "(t=" + endTime + ")";
} }
@Override @Override
......
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