Notice to GitKraken users: A vulnerability has been found in the SSH key generation of GitKraken versions 7.6.0 to 8.0.0 (https://www.gitkraken.com/blog/weak-ssh-key-fix). If you use GitKraken and have generated a SSH key using one of these versions, please remove it both from your local workstation and from your LRZ GitLab profile.

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

Commit 33e3de47 authored by Benedikt Kleinmeier's avatar Benedikt Kleinmeier
Browse files

Added "searchRadius" to "AttributesAgent" and use it "OSMBehaviorController".

parent 3b5f89bd
{ {
"name" : "01-ExperimentSetup-OSMEventDriven", "name" : "01-ExperimentSetup-OSMEventDriven",
"description" : "", "description" : "",
"release" : "0.7", "release" : "0.8",
"processWriters" : { "processWriters" : {
"files" : [ { "files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile", "type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
} }
}, },
"attributesSimulation" : { "attributesSimulation" : {
"finishTime" : 100.0, "finishTime" : 60.0,
"simTimeStepLength" : 0.4, "simTimeStepLength" : 0.4,
"realTimeSimTimeRatio" : 0.1, "realTimeSimTimeRatio" : 0.1,
"writeSimulationData" : true, "writeSimulationData" : true,
......
{ {
"name" : "01-ExperimentSetup-OSMSequential", "name" : "01-ExperimentSetup-OSMSequential",
"description" : "", "description" : "",
"release" : "0.7", "release" : "0.8",
"processWriters" : { "processWriters" : {
"files" : [ { "files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile", "type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
} }
}, },
"attributesSimulation" : { "attributesSimulation" : {
"finishTime" : 100.0, "finishTime" : 60.0,
"simTimeStepLength" : 0.4, "simTimeStepLength" : 0.4,
"realTimeSimTimeRatio" : 0.1, "realTimeSimTimeRatio" : 0.1,
"writeSimulationData" : true, "writeSimulationData" : true,
......
...@@ -156,9 +156,8 @@ public class OSMBehaviorController { ...@@ -156,9 +156,8 @@ public class OSMBehaviorController {
private List<Pedestrian> getClosestPedestriansWhichAreCloserToTarget(PedestrianOSM pedestrian, Topography topography) { private List<Pedestrian> getClosestPedestriansWhichAreCloserToTarget(PedestrianOSM pedestrian, Topography topography) {
VPoint positionOfPedestrian = pedestrian.getPosition(); VPoint positionOfPedestrian = pedestrian.getPosition();
// TODO Maybe, extract search radius as configurable attribute.
List<Pedestrian> closestPedestrians = topography.getSpatialMap(Pedestrian.class) List<Pedestrian> closestPedestrians = topography.getSpatialMap(Pedestrian.class)
.getObjects(positionOfPedestrian, pedestrian.getRadius() * 5); .getObjects(positionOfPedestrian, pedestrian.getAttributes().getSearchRadius());
// Filter out "me" and pedestrians which are farer away from target than "me". // Filter out "me" and pedestrians which are farer away from target than "me".
closestPedestrians = closestPedestrians.stream() closestPedestrians = closestPedestrians.stream()
......
...@@ -34,6 +34,9 @@ public class AttributesAgent extends AttributesDynamicElement { ...@@ -34,6 +34,9 @@ public class AttributesAgent extends AttributesDynamicElement {
// store n last foot steps for speed calculation // store n last foot steps for speed calculation
private int footStepsToStore = 10; private int footStepsToStore = 10;
// agents search for other scenario elements (e.g., other agents) within this radius
private double searchRadius = 1.0;
public AttributesAgent() { public AttributesAgent() {
this(-1); this(-1);
} }
...@@ -55,6 +58,7 @@ public class AttributesAgent extends AttributesDynamicElement { ...@@ -55,6 +58,7 @@ public class AttributesAgent extends AttributesDynamicElement {
this.maximumSpeed = other.maximumSpeed; this.maximumSpeed = other.maximumSpeed;
this.acceleration = other.acceleration; this.acceleration = other.acceleration;
this.footStepsToStore = other.footStepsToStore; this.footStepsToStore = other.footStepsToStore;
this.searchRadius = other.searchRadius;
} }
// Getters... // Getters...
...@@ -89,6 +93,8 @@ public class AttributesAgent extends AttributesDynamicElement { ...@@ -89,6 +93,8 @@ public class AttributesAgent extends AttributesDynamicElement {
public int getFootStepsToStore() { return footStepsToStore; } public int getFootStepsToStore() { return footStepsToStore; }
public double getSearchRadius() { return searchRadius; }
// Setters... // Setters...
public void setRadius(double radius) { public void setRadius(double radius) {
...@@ -130,4 +136,9 @@ public class AttributesAgent extends AttributesDynamicElement { ...@@ -130,4 +136,9 @@ public class AttributesAgent extends AttributesDynamicElement {
checkSealed(); checkSealed();
this.footStepsToStore = footStepsToStore; this.footStepsToStore = footStepsToStore;
} }
public void setSearchRadius(double searchRadius) {
checkSealed();
this.searchRadius = searchRadius;
}
} }
...@@ -39,9 +39,8 @@ public class Pedestrian extends Agent { ...@@ -39,9 +39,8 @@ public class Pedestrian extends Agent {
private ScenarioElementType type = ScenarioElementType.PEDESTRIAN; // TODO used at all? For JSON de-/serialization? Car does NOT have this field. remove if unused! private ScenarioElementType type = ScenarioElementType.PEDESTRIAN; // TODO used at all? For JSON de-/serialization? Car does NOT have this field. remove if unused!
// Constructors // Constructors
@SuppressWarnings("unused")
private Pedestrian() { private Pedestrian() {
// TODO constructor may be required for Jackson? // Default constructor required for JSON de-/serialization.
this(new AttributesAgent()); this(new AttributesAgent());
} }
......
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