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 @@ ...@@ -95,7 +95,7 @@
"attributesSimulation" : { "attributesSimulation" : {
"finishTime" : 50.0, "finishTime" : 50.0,
"simTimeStepLength" : 0.4, "simTimeStepLength" : 0.4,
"realTimeSimTimeRatio" : 0.4, "realTimeSimTimeRatio" : 0.1,
"writeSimulationData" : true, "writeSimulationData" : true,
"visualizationEnabled" : true, "visualizationEnabled" : true,
"printFPS" : false, "printFPS" : false,
......
...@@ -9,7 +9,6 @@ import org.vadere.state.simulation.FootStep; ...@@ -9,7 +9,6 @@ import org.vadere.state.simulation.FootStep;
import org.vadere.state.simulation.VTrajectory; import org.vadere.state.simulation.VTrajectory;
import org.vadere.util.geometry.shapes.VPoint; import org.vadere.util.geometry.shapes.VPoint;
import java.lang.reflect.Field;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
...@@ -58,6 +57,8 @@ public class PedestrianListBuilder { ...@@ -58,6 +57,8 @@ public class PedestrianListBuilder {
for(FootStep fs : trajectory){ for(FootStep fs : trajectory){
p.getTrajectory().add(fs); 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); out.add(p);
return this; return this;
......
...@@ -110,10 +110,9 @@ public class Pedestrian extends Agent { ...@@ -110,10 +110,9 @@ public class Pedestrian extends Agent {
} }
public VPoint getInterpolatedFootStepPosition(double time){ public VPoint getInterpolatedFootStepPosition(double time){
if(this.trajectory.getLastFootSteps().getCapacity() <= 0){
if(this.trajectory.getLastFootStepCapacity() <= 0){ throw new IllegalArgumentException("Cannot interpolate foot steps if there is no capacity (larger than zero) " +
throw new RuntimeException("Cannot interpolate foot steps if there is no foot steps storage capacity (see " + "for storing foot steps (see 'scenario.attributesPedestrian.footStepsToStore' field)");
"scenario attribute 'lastFootStepsToStore'");
} }
FootStep currentFootStep = this.trajectory.getLastFootSteps().getYoungestFootStep(); FootStep currentFootStep = this.trajectory.getLastFootSteps().getYoungestFootStep();
......
...@@ -22,7 +22,6 @@ public class VTrajectory implements Iterable<FootStep> { ...@@ -22,7 +22,6 @@ public class VTrajectory implements Iterable<FootStep> {
} }
public VTrajectory(int lastFootStepCapacity){ public VTrajectory(int lastFootStepCapacity){
this.lastFootStepCapacity = lastFootStepCapacity;
footSteps = new LinkedList<>(); footSteps = new LinkedList<>();
lastFootSteps = new LastFootSteps(lastFootStepCapacity); lastFootSteps = new LastFootSteps(lastFootStepCapacity);
} }
...@@ -32,10 +31,6 @@ public class VTrajectory implements Iterable<FootStep> { ...@@ -32,10 +31,6 @@ public class VTrajectory implements Iterable<FootStep> {
return new LinkedList<>(footSteps); return new LinkedList<>(footSteps);
} }
public int getLastFootStepCapacity() {
return lastFootStepCapacity;
}
public LastFootSteps getLastFootSteps() { public LastFootSteps getLastFootSteps() {
return lastFootSteps; 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