Commit 94b03e24 authored by Daniel Lehmberg's avatar Daniel Lehmberg

minor changes

parent 6799a555
Pipeline #147358 failed with stages
in 61 minutes and 1 second
......@@ -95,7 +95,7 @@
"attributesSimulation" : {
"finishTime" : 50.0,
"simTimeStepLength" : 0.4,
"realTimeSimTimeRatio" : 0.4,
"realTimeSimTimeRatio" : 0.1,
"writeSimulationData" : true,
"visualizationEnabled" : true,
"printFPS" : false,
......
......@@ -9,7 +9,6 @@ import org.vadere.state.simulation.FootStep;
import org.vadere.state.simulation.VTrajectory;
import org.vadere.util.geometry.shapes.VPoint;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
......@@ -58,6 +57,8 @@ public class PedestrianListBuilder {
for(FootStep fs : trajectory){
p.getTrajectory().add(fs);
}
// Set the pedestrian position to the last known position where he started a step.
p.setPosition(p.getTrajectory().getFootSteps().getLast().getStart());
out.add(p);
return this;
......
......@@ -110,10 +110,9 @@ public class Pedestrian extends Agent {
}
public VPoint getInterpolatedFootStepPosition(double time){
if(this.trajectory.getLastFootStepCapacity() <= 0){
throw new RuntimeException("Cannot interpolate foot steps if there is no foot steps storage capacity (see " +
"scenario attribute 'lastFootStepsToStore'");
if(this.trajectory.getLastFootSteps().getCapacity() <= 0){
throw new IllegalArgumentException("Cannot interpolate foot steps if there is no capacity (larger than zero) " +
"for storing foot steps (see 'scenario.attributesPedestrian.footStepsToStore' field)");
}
FootStep currentFootStep = this.trajectory.getLastFootSteps().getYoungestFootStep();
......
......@@ -22,7 +22,6 @@ public class VTrajectory implements Iterable<FootStep> {
}
public VTrajectory(int lastFootStepCapacity){
this.lastFootStepCapacity = lastFootStepCapacity;
footSteps = new LinkedList<>();
lastFootSteps = new LastFootSteps(lastFootStepCapacity);
}
......@@ -32,10 +31,6 @@ public class VTrajectory implements Iterable<FootStep> {
return new LinkedList<>(footSteps);
}
public int getLastFootStepCapacity() {
return lastFootStepCapacity;
}
public LastFootSteps getLastFootSteps() {
return lastFootSteps;
}
......
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