2.12.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit 8b05aaa8 authored by Benedikt Kleinmeier's avatar Benedikt Kleinmeier
Browse files

In "PedestrianOSM.java", added getters and setters for "combinedPotentialStrategy".

parent e9f110be
...@@ -41,7 +41,7 @@ public class PedestrianOSM extends Pedestrian { ...@@ -41,7 +41,7 @@ public class PedestrianOSM extends Pedestrian {
private transient IPotentialFieldTarget potentialFieldTarget; private transient IPotentialFieldTarget potentialFieldTarget;
private transient PotentialFieldObstacle potentialFieldObstacle; private transient PotentialFieldObstacle potentialFieldObstacle;
private transient PotentialFieldAgent potentialFieldPedestrian; private transient PotentialFieldAgent potentialFieldPedestrian;
// TODO: Provide method to change object here according to stragey pattern. // A setter is provided to be able to change strategy at runtime (e.g. by events).
private transient CombinedPotentialStrategy combinedPotentialStrategy; private transient CombinedPotentialStrategy combinedPotentialStrategy;
private transient List<SpeedAdjuster> speedAdjusters; private transient List<SpeedAdjuster> speedAdjusters;
private transient List<StepSizeAdjuster> stepSizeAdjusters; private transient List<StepSizeAdjuster> stepSizeAdjusters;
...@@ -240,7 +240,9 @@ public class PedestrianOSM extends Pedestrian { ...@@ -240,7 +240,9 @@ public class PedestrianOSM extends Pedestrian {
strides.clear(); strides.clear();
} }
// Getters... // TODO: Group getters and setters correctly.
// Getters
public double getTargetPotential(VPoint pos) { public double getTargetPotential(VPoint pos) {
return potentialFieldTarget.getPotential(pos, this); return potentialFieldTarget.getPotential(pos, this);
...@@ -263,6 +265,10 @@ public class PedestrianOSM extends Pedestrian { ...@@ -263,6 +265,10 @@ public class PedestrianOSM extends Pedestrian {
new Vector2D(0, 0), this, relevantPedestrians); new Vector2D(0, 0), this, relevantPedestrians);
} }
public CombinedPotentialStrategy getCombinedPotentialStrategy() {
return combinedPotentialStrategy;
}
public double getTimeOfNextStep() { public double getTimeOfNextStep() {
return timeOfNextStep; return timeOfNextStep;
} }
...@@ -307,6 +313,10 @@ public class PedestrianOSM extends Pedestrian { ...@@ -307,6 +313,10 @@ public class PedestrianOSM extends Pedestrian {
this.relevantPedestrians = relevantPedestrians; this.relevantPedestrians = relevantPedestrians;
} }
public void setCombinedPotentialStrategy(CombinedPotentialStrategy combinedPotentialStrategy) {
this.combinedPotentialStrategy = combinedPotentialStrategy;
}
public Collection<? extends Agent> getRelevantPedestrians() { public Collection<? extends Agent> getRelevantPedestrians() {
return relevantPedestrians; return relevantPedestrians;
} }
......
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