Commit 8191387b authored by Maxim Dudin's avatar Maxim Dudin
Browse files

#304 added noise to a crude visualisation possibility for PedestriansNearbyProcessor.java

parent c5de664c
Pipeline #240951 failed with stages
in 2 minutes and 48 seconds
......@@ -15,6 +15,10 @@
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.NoDataKeyOutputFile",
"filename" : "overlapCount.txt",
"processors" : [ 4 ]
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestriansNearbyIdOutputFile",
"filename" : "pedsNearby.txt",
"processors" : [ 5 ]
} ],
"processors" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.FootStepProcessor",
......@@ -32,6 +36,18 @@
"attributes" : {
"pedestrianOverlapProcessorId" : 3
}
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestriansNearbyProcessor",
"id" : 5,
"attributesType" : "org.vadere.state.attributes.processor.AttributesPedestrianNearbyProcessor",
"attributes" : {
"maxDistanceForANearbyPedestrian" : 1.5,
"sampleEveryNthStep" : 1,
"allowedAbsenceTimestepsIfContactReturns" : 0,
"minTimespanOfContactTimesteps" : 20,
"printContactTrajectories" : false,
"printForPostVis" : true
}
} ],
"isTimestamped" : true,
"isWriteMetaData" : false
......@@ -2085,6 +2101,23 @@
"deletionDistance" : 0.1,
"startingWithRedLight" : false,
"nextSpeed" : -1.0
}, {
"id" : 9999,
"absorbing" : true,
"shape" : {
"x" : 23.5,
"y" : 25.5,
"width" : 1.5,
"height" : 0.5,
"type" : "RECTANGLE"
},
"waitingTime" : 0.0,
"waitingTimeYellowPhase" : 0.0,
"parallelWaiters" : 0,
"individualWaiting" : true,
"deletionDistance" : 0.1,
"startingWithRedLight" : false,
"nextSpeed" : -1.0
} ],
"targetChangers" : [ {
"id" : 6,
......
......@@ -5,6 +5,7 @@ import org.vadere.util.geometry.shapes.VPoint;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class PedestriansNearbyData {
......@@ -87,7 +88,12 @@ public class PedestriansNearbyData {
} else {
pNext = traj.get(i);
}
ret.append(hashCode()).append(" ").append(startTimestep*0.4 + i*0.4).append(" ").append(startTimestep*0.4 + (i+1)*0.4).append(" ").append(p.x).append(" ").append(p.y).append(" ").append(pNext.x).append(" ").append(pNext.y).append(" 9999");
Random rand = new Random();
double r1 = rand.nextDouble();
r1 = r1*0.3 - 0.15;
double r2 = rand.nextDouble();
r2 = r2*0.3 - 0.15;
ret.append(hashCode()).append(" ").append(startTimestep*0.4 + i*0.4).append(" ").append(startTimestep*0.4 + (i+1)*0.4).append(" ").append(p.x + r2).append(" ").append(p.y + r1).append(" ").append(pNext.x + r1).append(" ").append(pNext.y + r2).append(" 9999");
if (i != traj.size() -1) {
ret.append("\n");
}
......
......@@ -53,7 +53,8 @@ public class PedestriansNearbyProcessor extends DataProcessor<TimestepPedestrian
.map(p -> {
double xAverage = (ped.getPosition().getX() + p.getPosition().getX())/2.;
double yAverage = (ped.getPosition().getY() + p.getPosition().getY())/2.;
System.out.println("x1= " + ped.getPosition().getX() + "y1= " + ped.getPosition().getY() + "x2= " + p.getPosition().getX() + "y2= " + p.getPosition().getY() + "xAver= " + xAverage + "yAver= " + yAverage);
//System.out.println("x1= " + ped.getPosition().getX() + "y1= " + ped.getPosition().getY() + "x2= " + p.getPosition().getX() + "y2= " + p.getPosition().getY() + "xAver= " + xAverage + "yAver= " + yAverage);
//System.out.println("x1= " + ped.getPosition().getX() + "y1= " + ped.getPosition().getY() + "x2= " + p.getPosition().getX() + "y2= " + p.getPosition().getY() + "xAver= " + xAverage + "yAver= " + yAverage);
VPoint pointOfContact = new VPoint(xAverage, yAverage);
List<VPoint> trajectory = new ArrayList<>();
trajectory.add(pointOfContact);
......
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