...
 
Commits (4)
......@@ -6,7 +6,7 @@
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
"filename" : "postvis.trajectories",
"processors" : [ 1, 2, 6, 7, 9, 10 ]
"processors" : [ 1, 2, 6, 7, 9, 10, 11, 13, 14, 15 ]
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOverlapOutputFile",
"filename" : "overlaps.csv",
......@@ -42,23 +42,59 @@
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianSalientBehaviorProcessor",
"id" : 7
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianSpeedInAreaProcessor",
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianSpeedInAreaProcessorUsingAgentTrajectory",
"id" : 9,
"attributesType" : "org.vadere.state.attributes.processor.AttributesSpeedInAreaProcessor",
"attributesType" : "org.vadere.state.attributes.processor.AttributesSpeedInAreaProcessorUsingAgentTrajectory",
"attributes" : {
"measurementAreaId" : 1,
"pedestrianTrajectoryProcessorId" : 5,
"speedCalculationStrategy" : "BY_MEASUREMENT_AREA_HEIGHT"
}
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianSpeedInAreaProcessor",
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianSpeedInAreaProcessorUsingAgentTrajectory",
"id" : 10,
"attributesType" : "org.vadere.state.attributes.processor.AttributesSpeedInAreaProcessor",
"attributesType" : "org.vadere.state.attributes.processor.AttributesSpeedInAreaProcessorUsingAgentTrajectory",
"attributes" : {
"measurementAreaId" : 2,
"pedestrianTrajectoryProcessorId" : 5,
"speedCalculationStrategy" : "BY_MEASUREMENT_AREA_HEIGHT"
}
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianSpeedInAreaProcessorUsingAgentTrajectory",
"id" : 11,
"attributesType" : "org.vadere.state.attributes.processor.AttributesSpeedInAreaProcessorUsingAgentTrajectory",
"attributes" : {
"measurementAreaId" : 3,
"pedestrianTrajectoryProcessorId" : 5,
"speedCalculationStrategy" : "BY_MEASUREMENT_AREA_HEIGHT"
}
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianVelocityDefaultProcessor",
"id" : 12
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianSpeedInAreaProcessorUsingAgentVelocity",
"id" : 13,
"attributesType" : "org.vadere.state.attributes.processor.AttributesSpeedInAreaProcessorUsingAgentVelocity",
"attributes" : {
"measurementAreaId" : 1,
"pedestrianVelocityDefaultProcessor" : 12
}
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianSpeedInAreaProcessorUsingAgentVelocity",
"id" : 14,
"attributesType" : "org.vadere.state.attributes.processor.AttributesSpeedInAreaProcessorUsingAgentVelocity",
"attributes" : {
"measurementAreaId" : 2,
"pedestrianVelocityDefaultProcessor" : 12
}
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianSpeedInAreaProcessorUsingAgentVelocity",
"id" : 15,
"attributesType" : "org.vadere.state.attributes.processor.AttributesSpeedInAreaProcessorUsingAgentVelocity",
"attributes" : {
"measurementAreaId" : 3,
"pedestrianVelocityDefaultProcessor" : 12
}
} ],
"isTimestamped" : true,
"isWriteMetaData" : false
......@@ -172,9 +208,18 @@
}, {
"shape" : {
"x" : 0.5,
"y" : 13.1,
"y" : 14.1,
"width" : 4.0,
"height" : 8.0,
"type" : "RECTANGLE"
},
"id" : 3
}, {
"shape" : {
"x" : 0.5,
"y" : 1.9,
"width" : 4.0,
"height" : 9.0,
"height" : 8.0,
"type" : "RECTANGLE"
},
"id" : 1
......
{
"name" : "10-RiMEA11-ExitSelection-OSMEventDriven-SBDisabled",
"description" : "",
"release" : "0.10",
"processWriters" : {
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
"filename" : "postvis.trajectories",
"processors" : [ 1, 2, 3 ]
} ],
"processors" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianPositionProcessor",
"id" : 1
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianMostImportantEventProcessor",
"id" : 2
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianSalientBehaviorProcessor",
"id" : 3
} ],
"isTimestamped" : true,
"isWriteMetaData" : false
},
"scenario" : {
"mainModel" : "org.vadere.simulator.models.osm.OptimalStepsModel",
"attributesModel" : {
"org.vadere.state.attributes.models.AttributesOSM" : {
"stepCircleResolution" : 4,
"numberOfCircles" : 1,
"optimizationType" : "NELDER_MEAD",
"varyStepDirection" : true,
"movementType" : "ARBITRARY",
"stepLengthIntercept" : 0.4625,
"stepLengthSlopeSpeed" : 0.2345,
"stepLengthSD" : 0.036,
"movementThreshold" : 0.0,
"minStepLength" : 0.1,
"minimumStepLength" : true,
"maxStepDuration" : 1.7976931348623157E308,
"dynamicStepLength" : true,
"updateType" : "EVENT_DRIVEN",
"seeSmallWalls" : false,
"targetPotentialModel" : "org.vadere.simulator.models.potential.fields.PotentialFieldTargetGrid",
"pedestrianPotentialModel" : "org.vadere.simulator.models.potential.PotentialFieldPedestrianCompactSoftshell",
"obstaclePotentialModel" : "org.vadere.simulator.models.potential.PotentialFieldObstacleCompactSoftshell",
"submodels" : [ ]
},
"org.vadere.state.attributes.models.AttributesPotentialCompactSoftshell" : {
"pedPotentialIntimateSpaceWidth" : 0.45,
"pedPotentialPersonalSpaceWidth" : 1.2,
"pedPotentialHeight" : 50.0,
"obstPotentialWidth" : 0.8,
"obstPotentialHeight" : 6.0,
"intimateSpaceFactor" : 1.2,
"personalSpacePower" : 1,
"intimateSpacePower" : 1
},
"org.vadere.state.attributes.models.AttributesFloorField" : {
"createMethod" : "HIGH_ACCURACY_FAST_MARCHING",
"potentialFieldResolution" : 0.1,
"obstacleGridPenalty" : 0.1,
"targetAttractionStrength" : 1.0,
"timeCostAttributes" : {
"standardDeviation" : 0.7,
"type" : "UNIT",
"obstacleDensityWeight" : 3.5,
"pedestrianSameTargetDensityWeight" : 3.5,
"pedestrianOtherTargetDensityWeight" : 3.5,
"pedestrianWeight" : 3.5,
"queueWidthLoading" : 1.0,
"pedestrianDynamicWeight" : 6.0,
"loadingType" : "CONSTANT",
"width" : 0.2,
"height" : 1.0
}
}
},
"attributesSimulation" : {
"finishTime" : 200.0,
"simTimeStepLength" : 0.4,
"realTimeSimTimeRatio" : 0.0,
"writeSimulationData" : true,
"visualizationEnabled" : true,
"printFPS" : false,
"digitsPerCoordinate" : 2,
"useFixedSeed" : true,
"fixedSeed" : 3213925745664992646,
"simulationSeed" : 1,
"useSalientBehavior" : false
},
"topography" : {
"attributes" : {
"bounds" : {
"x" : 0.0,
"y" : 0.0,
"width" : 14.0,
"height" : 18.0
},
"boundingBoxWidth" : 0.5,
"bounded" : true
},
"obstacles" : [ {
"shape" : {
"type" : "POLYGON",
"points" : [ {
"x" : 7.2,
"y" : 5.0
}, {
"x" : 7.2,
"y" : 6.0
}, {
"x" : 0.5,
"y" : 6.0
}, {
"x" : 0.5,
"y" : 5.0
} ]
},
"id" : -1
}, {
"shape" : {
"type" : "POLYGON",
"points" : [ {
"x" : 10.1,
"y" : 5.0
}, {
"x" : 10.1,
"y" : 6.0
}, {
"x" : 7.8,
"y" : 6.0
}, {
"x" : 7.8,
"y" : 5.0
} ]
},
"id" : -1
}, {
"shape" : {
"type" : "POLYGON",
"points" : [ {
"x" : 0.5,
"y" : 14.5
}, {
"x" : 11.6,
"y" : 14.5
}, {
"x" : 11.6,
"y" : 6.000000000000007
}, {
"x" : 10.7,
"y" : 6.0
}, {
"x" : 10.7,
"y" : 5.0
}, {
"x" : 12.6,
"y" : 5.0
}, {
"x" : 12.6,
"y" : 15.600000000000001
}, {
"x" : 0.5,
"y" : 15.600000000000001
} ]
},
"id" : -1
} ],
"measurementAreas" : [ ],
"stairs" : [ ],
"targets" : [ {
"id" : 1,
"absorbing" : true,
"shape" : {
"x" : 6.4,
"y" : 2.4000000000000004,
"width" : 6.0,
"height" : 2.0,
"type" : "RECTANGLE"
},
"waitingTime" : 0.0,
"waitingTimeYellowPhase" : 0.0,
"parallelWaiters" : 0,
"individualWaiting" : true,
"deletionDistance" : 0.1,
"startingWithRedLight" : false,
"nextSpeed" : -1.0
} ],
"absorbingAreas" : [ ],
"sources" : [ {
"id" : -1,
"shape" : {
"x" : 2.5,
"y" : 8.0,
"width" : 3.95,
"height" : 4.74,
"type" : "RECTANGLE"
},
"interSpawnTimeDistribution" : "org.vadere.state.scenario.ConstantDistribution",
"distributionParameters" : [ 1.0 ],
"spawnNumber" : 100,
"maxSpawnNumberTotal" : -1,
"startTime" : 0.0,
"endTime" : 0.0,
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : true,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
"attributesPedestrian" : {
"radius" : 0.195,
"densityDependentSpeed" : false,
"speedDistributionMean" : 1.34,
"speedDistributionStandardDeviation" : 0.26,
"minimumSpeed" : 0.5,
"maximumSpeed" : 2.2,
"acceleration" : 2.0,
"footStepsToStore" : 4,
"searchRadius" : 1.0,
"angleCalculationType" : "USE_CENTER",
"targetOrientationAngleThreshold" : 45.0
},
"teleporter" : null,
"attributesCar" : null
},
"eventInfos" : [ ]
}
}
\ No newline at end of file
{
"name" : "11-RiMEA11-ExitSelection-OSMEventDriven-SBEnabled",
"description" : "",
"release" : "0.10",
"processWriters" : {
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
"filename" : "postvis.trajectories",
"processors" : [ 1, 2, 3 ]
} ],
"processors" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianPositionProcessor",
"id" : 1
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianMostImportantEventProcessor",
"id" : 2
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianSalientBehaviorProcessor",
"id" : 3
} ],
"isTimestamped" : true,
"isWriteMetaData" : false
},
"scenario" : {
"mainModel" : "org.vadere.simulator.models.osm.OptimalStepsModel",
"attributesModel" : {
"org.vadere.state.attributes.models.AttributesOSM" : {
"stepCircleResolution" : 4,
"numberOfCircles" : 1,
"optimizationType" : "NELDER_MEAD",
"varyStepDirection" : true,
"movementType" : "ARBITRARY",
"stepLengthIntercept" : 0.4625,
"stepLengthSlopeSpeed" : 0.2345,
"stepLengthSD" : 0.036,
"movementThreshold" : 0.0,
"minStepLength" : 0.1,
"minimumStepLength" : true,
"maxStepDuration" : 1.7976931348623157E308,
"dynamicStepLength" : true,
"updateType" : "EVENT_DRIVEN",
"seeSmallWalls" : false,
"targetPotentialModel" : "org.vadere.simulator.models.potential.fields.PotentialFieldTargetGrid",
"pedestrianPotentialModel" : "org.vadere.simulator.models.potential.PotentialFieldPedestrianCompactSoftshell",
"obstaclePotentialModel" : "org.vadere.simulator.models.potential.PotentialFieldObstacleCompactSoftshell",
"submodels" : [ ]
},
"org.vadere.state.attributes.models.AttributesPotentialCompactSoftshell" : {
"pedPotentialIntimateSpaceWidth" : 0.45,
"pedPotentialPersonalSpaceWidth" : 1.2,
"pedPotentialHeight" : 50.0,
"obstPotentialWidth" : 0.8,
"obstPotentialHeight" : 6.0,
"intimateSpaceFactor" : 1.2,
"personalSpacePower" : 1,
"intimateSpacePower" : 1
},
"org.vadere.state.attributes.models.AttributesFloorField" : {
"createMethod" : "HIGH_ACCURACY_FAST_MARCHING",
"potentialFieldResolution" : 0.1,
"obstacleGridPenalty" : 0.1,
"targetAttractionStrength" : 1.0,
"timeCostAttributes" : {
"standardDeviation" : 0.7,
"type" : "UNIT",
"obstacleDensityWeight" : 3.5,
"pedestrianSameTargetDensityWeight" : 3.5,
"pedestrianOtherTargetDensityWeight" : 3.5,
"pedestrianWeight" : 3.5,
"queueWidthLoading" : 1.0,
"pedestrianDynamicWeight" : 6.0,
"loadingType" : "CONSTANT",
"width" : 0.2,
"height" : 1.0
}
}
},
"attributesSimulation" : {
"finishTime" : 200.0,
"simTimeStepLength" : 0.4,
"realTimeSimTimeRatio" : 0.0,
"writeSimulationData" : true,
"visualizationEnabled" : true,
"printFPS" : false,
"digitsPerCoordinate" : 2,
"useFixedSeed" : true,
"fixedSeed" : 3213925745664992646,
"simulationSeed" : 1,
"useSalientBehavior" : true
},
"topography" : {
"attributes" : {
"bounds" : {
"x" : 0.0,
"y" : 0.0,
"width" : 14.0,
"height" : 18.0
},
"boundingBoxWidth" : 0.5,
"bounded" : true
},
"obstacles" : [ {
"shape" : {
"type" : "POLYGON",
"points" : [ {
"x" : 7.2,
"y" : 5.0
}, {
"x" : 7.2,
"y" : 6.0
}, {
"x" : 0.5,
"y" : 6.0
}, {
"x" : 0.5,
"y" : 5.0
} ]
},
"id" : -1
}, {
"shape" : {
"type" : "POLYGON",
"points" : [ {
"x" : 10.1,
"y" : 5.0
}, {
"x" : 10.1,
"y" : 6.0
}, {
"x" : 7.8,
"y" : 6.0
}, {
"x" : 7.8,
"y" : 5.0
} ]
},
"id" : -1
}, {
"shape" : {
"type" : "POLYGON",
"points" : [ {
"x" : 0.5,
"y" : 14.5
}, {
"x" : 11.6,
"y" : 14.5
}, {
"x" : 11.6,
"y" : 6.000000000000007
}, {
"x" : 10.7,
"y" : 6.0
}, {
"x" : 10.7,
"y" : 5.0
}, {
"x" : 12.6,
"y" : 5.0
}, {
"x" : 12.6,
"y" : 15.600000000000001
}, {
"x" : 0.5,
"y" : 15.600000000000001
} ]
},
"id" : -1
} ],
"measurementAreas" : [ ],
"stairs" : [ ],
"targets" : [ {
"id" : 1,
"absorbing" : true,
"shape" : {
"x" : 6.4,
"y" : 2.4000000000000004,
"width" : 6.0,
"height" : 2.0,
"type" : "RECTANGLE"
},
"waitingTime" : 0.0,
"waitingTimeYellowPhase" : 0.0,
"parallelWaiters" : 0,
"individualWaiting" : true,
"deletionDistance" : 0.1,
"startingWithRedLight" : false,
"nextSpeed" : -1.0
} ],
"absorbingAreas" : [ ],
"sources" : [ {
"id" : -1,
"shape" : {
"x" : 2.5,
"y" : 8.0,
"width" : 3.95,
"height" : 4.74,
"type" : "RECTANGLE"
},
"interSpawnTimeDistribution" : "org.vadere.state.scenario.ConstantDistribution",
"distributionParameters" : [ 1.0 ],
"spawnNumber" : 100,
"maxSpawnNumberTotal" : -1,
"startTime" : 0.0,
"endTime" : 0.0,
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : true,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
"attributesPedestrian" : {
"radius" : 0.195,
"densityDependentSpeed" : false,
"speedDistributionMean" : 1.34,
"speedDistributionStandardDeviation" : 0.26,
"minimumSpeed" : 0.5,
"maximumSpeed" : 2.2,
"acceleration" : 2.0,
"footStepsToStore" : 4,
"searchRadius" : 1.0,
"angleCalculationType" : "USE_CENTER",
"targetOrientationAngleThreshold" : 45.0
},
"teleporter" : null,
"attributesCar" : null
},
"eventInfos" : [ ]
}
}
\ No newline at end of file
......@@ -6,7 +6,7 @@
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
"filename" : "postvis.trajectories",
"processors" : [ 1, 2, 6 ]
"processors" : [ 1, 2, 6, 8 ]
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOverlapOutputFile",
"filename" : "overlaps.csv",
......@@ -36,14 +36,25 @@
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianTrajectoryProcessor",
"id" : 5
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianSpeedInAreaProcessor",
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianSpeedInAreaProcessorUsingAgentTrajectory",
"id" : 6,
"attributesType" : "org.vadere.state.attributes.processor.AttributesSpeedInAreaProcessor",
"attributesType" : "org.vadere.state.attributes.processor.AttributesSpeedInAreaProcessorUsingAgentTrajectory",
"attributes" : {
"measurementAreaId" : 1,
"pedestrianTrajectoryProcessorId" : 5,
"speedCalculationStrategy" : "BY_MEASUREMENT_AREA_HEIGHT"
}
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianVelocityDefaultProcessor",
"id" : 7
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianSpeedInAreaProcessorUsingAgentVelocity",
"id" : 8,
"attributesType" : "org.vadere.state.attributes.processor.AttributesSpeedInAreaProcessorUsingAgentVelocity",
"attributes" : {
"measurementAreaId" : 1,
"pedestrianVelocityDefaultProcessor" : 7
}
} ],
"isTimestamped" : true,
"isWriteMetaData" : false
......
......@@ -6,7 +6,7 @@
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
"filename" : "postvis.trajectories",
"processors" : [ 1, 2, 6 ]
"processors" : [ 1, 2, 6, 8 ]
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOverlapOutputFile",
"filename" : "overlaps.csv",
......@@ -36,13 +36,24 @@
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianTrajectoryProcessor",
"id" : 5
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianSpeedInAreaProcessor",
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianSpeedInAreaProcessorUsingAgentTrajectory",
"id" : 6,
"attributesType" : "org.vadere.state.attributes.processor.AttributesSpeedInAreaProcessor",
"attributesType" : "org.vadere.state.attributes.processor.AttributesSpeedInAreaProcessorUsingAgentTrajectory",
"attributes" : {
"measurementAreaId" : 1,
"pedestrianTrajectoryProcessorId" : 5,
"speedCalculationStrategy" : "BY_TRAJECTORY"
"speedCalculationStrategy" : "BY_MEASUREMENT_AREA_HEIGHT"
}
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianVelocityDefaultProcessor",
"id" : 7
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianSpeedInAreaProcessorUsingAgentVelocity",
"id" : 8,
"attributesType" : "org.vadere.state.attributes.processor.AttributesSpeedInAreaProcessorUsingAgentVelocity",
"attributes" : {
"measurementAreaId" : 1,
"pedestrianVelocityDefaultProcessor" : 7
}
} ],
"isTimestamped" : true,
......
......@@ -6,7 +6,7 @@
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
"filename" : "postvis.trajectories",
"processors" : [ 1, 2, 6 ]
"processors" : [ 1, 2, 6, 8 ]
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOverlapOutputFile",
"filename" : "overlaps.csv",
......@@ -36,13 +36,24 @@
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianTrajectoryProcessor",
"id" : 5
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianSpeedInAreaProcessor",
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianSpeedInAreaProcessorUsingAgentTrajectory",
"id" : 6,
"attributesType" : "org.vadere.state.attributes.processor.AttributesSpeedInAreaProcessor",
"attributesType" : "org.vadere.state.attributes.processor.AttributesSpeedInAreaProcessorUsingAgentTrajectory",
"attributes" : {
"measurementAreaId" : 1,
"pedestrianTrajectoryProcessorId" : 5,
"speedCalculationStrategy" : "BY_MEASUREMENT_AREA_WIDTH"
"speedCalculationStrategy" : "BY_MEASUREMENT_AREA_HEIGHT"
}
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianVelocityDefaultProcessor",
"id" : 7
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianSpeedInAreaProcessorUsingAgentVelocity",
"id" : 8,
"attributesType" : "org.vadere.state.attributes.processor.AttributesSpeedInAreaProcessorUsingAgentVelocity",
"attributes" : {
"measurementAreaId" : 1,
"pedestrianVelocityDefaultProcessor" : 7
}
} ],
"isTimestamped" : true,
......
......@@ -6,7 +6,7 @@ import org.vadere.simulator.projects.dataprocessing.ProcessorManager;
import org.vadere.simulator.projects.dataprocessing.datakey.PedestrianIdKey;
import org.vadere.simulator.projects.dataprocessing.datakey.TimestepPedestrianIdKey;
import org.vadere.state.attributes.processor.AttributesProcessor;
import org.vadere.state.attributes.processor.AttributesSpeedInAreaProcessor;
import org.vadere.state.attributes.processor.AttributesSpeedInAreaProcessorUsingAgentTrajectory;
import org.vadere.state.attributes.processor.enums.SpeedCalculationStrategy;
import org.vadere.state.scenario.MeasurementArea;
import org.vadere.state.scenario.Pedestrian;
......@@ -42,10 +42,12 @@ import java.util.function.BiFunction;
* <pre>
* | timeStep | pedId | ... | M1 | M2 |
* |----------|-------|-----|-----|-----|
* |1 | 1 | | 0.5 | 0 |
* |1 | 2 | | 0 | 0.6 |
* |1 | 1 | | 0.5 | -1 |
* |1 | 2 | | -1 | 0.6 |
* </pre>
*
* Note: If trajectory of pedestrian is empty, log -2.
*
* Use the {@link PedestrianTrajectoryProcessor} to access pedestrian's
* trajectory.
*
......@@ -53,11 +55,9 @@ import java.util.function.BiFunction;
* - ByTrajectory: Use {@link VTrajectory#speed()}, i.e. trajectory.length() / trajectory.duration()
* - ByMeasurementAreaHeight: Use measurementArea.height() / trajectory.duration()
* - ByMeasurementAreaWidth: Use measurementArea.width() / trajectory.duration()
*
* Note: If "trajectory.isEmpty()", log -2.
*/
@DataProcessorClass()
public class PedestrianSpeedInAreaProcessor extends DataProcessor<TimestepPedestrianIdKey, Double> {
public class PedestrianSpeedInAreaProcessorUsingAgentTrajectory extends DataProcessor<TimestepPedestrianIdKey, Double> {
// Static variables
public static double ERROR_PED_NOT_IN_MEASUREMENT_AREA = -1;
......@@ -69,8 +69,8 @@ public class PedestrianSpeedInAreaProcessor extends DataProcessor<TimestepPedest
private BiFunction<VTrajectory, VRectangle, Double> speedCalculationStrategy;
// Constructors
public PedestrianSpeedInAreaProcessor() {
super("speedInArea");
public PedestrianSpeedInAreaProcessorUsingAgentTrajectory() {
super("speedInAreaUsingAgentTrajectory");
// "init()" method is used by processor manager to initialize variables.
}
......@@ -85,7 +85,7 @@ public class PedestrianSpeedInAreaProcessor extends DataProcessor<TimestepPedest
public void init(final ProcessorManager manager) {
super.init(manager);
AttributesSpeedInAreaProcessor processorAttributes = (AttributesSpeedInAreaProcessor) this.getAttributes();
AttributesSpeedInAreaProcessorUsingAgentTrajectory processorAttributes = (AttributesSpeedInAreaProcessorUsingAgentTrajectory) this.getAttributes();
// manager.getMeasurementArea() throws an exception if area is "null" or not rectangular. Though, no checks required here.
boolean rectangularAreaRequired = true;
......@@ -94,13 +94,13 @@ public class PedestrianSpeedInAreaProcessor extends DataProcessor<TimestepPedest
pedestrianTrajectoryProcessor = (PedestrianTrajectoryProcessor) manager.getProcessor(processorAttributes.getPedestrianTrajectoryProcessorId());
if (pedestrianTrajectoryProcessor == null) {
throw new RuntimeException(String.format("PedestrianVelocityProcessor with index %d does not exist.", processorAttributes.getPedestrianTrajectoryProcessorId()));
throw new RuntimeException(String.format("PedestrianTrajectoryProcessor with index %d does not exist.", processorAttributes.getPedestrianTrajectoryProcessorId()));
}
initSpeedCalculationStrategy(processorAttributes);
}
private void initSpeedCalculationStrategy(AttributesSpeedInAreaProcessor processorAttributes) {
private void initSpeedCalculationStrategy(AttributesSpeedInAreaProcessorUsingAgentTrajectory processorAttributes) {
if (processorAttributes.getSpeedCalculationStrategy() == SpeedCalculationStrategy.BY_TRAJECTORY) {
speedCalculationStrategy = this::calculateSpeedByTrajectory;
} else if (processorAttributes.getSpeedCalculationStrategy() == SpeedCalculationStrategy.BY_MEASUREMENT_AREA_HEIGHT) {
......@@ -115,7 +115,7 @@ public class PedestrianSpeedInAreaProcessor extends DataProcessor<TimestepPedest
@Override
public AttributesProcessor getAttributes() {
if (super.getAttributes() == null) {
setAttributes(new AttributesSpeedInAreaProcessor());
setAttributes(new AttributesSpeedInAreaProcessorUsingAgentTrajectory());
}
return super.getAttributes();
......
package org.vadere.simulator.projects.dataprocessing.processor;
import org.vadere.annotation.factories.dataprocessors.DataProcessorClass;
import org.vadere.simulator.control.SimulationState;
import org.vadere.simulator.projects.dataprocessing.ProcessorManager;
import org.vadere.simulator.projects.dataprocessing.datakey.TimestepPedestrianIdKey;
import org.vadere.state.attributes.processor.AttributesProcessor;
import org.vadere.state.attributes.processor.AttributesSpeedInAreaProcessorUsingAgentVelocity;
import org.vadere.state.scenario.MeasurementArea;
import org.vadere.state.scenario.Pedestrian;
/**
* Log for each pedestrian the speed within a measurement area.
*
* <pre>
* +--------------------------------------------------+
* | |
* | M1-------------+ M2-------------+ |
* | +-+ | | | | +-+ |
* | |S| | P1 | | P2 | |T| |
* | +-+ | | | | +-+ |
* | +--------------+ +--------------+ |
* | |
* +--------------------------------------------------+
*
* - S: source
* - T: target
* - Pi: pedestrian i
* - Mj: measurement j
* </pre>
*
* Note: If two measurement areas M1 and M2 are disjoint
* and a pedestrian P1 is located within M1, M2 should
* log a speed of -1 for P1.
*
* <pre>
* | timeStep | pedId | ... | M1 | M2 |
* |----------|-------|-----|-----|-----|
* |1 | 1 | | 0.5 | -1 |
* |1 | 2 | | -1 | 0.6 |
* </pre>
*
* Watch out: This processor uses the {@link PedestrianVelocityDefaultProcessor} internally instead of the
* {@link PedestrianTrajectoryProcessor} which is used by {@link PedestrianSpeedInAreaProcessorUsingAgentTrajectory}.
*/
@DataProcessorClass()
public class PedestrianSpeedInAreaProcessorUsingAgentVelocity extends DataProcessor<TimestepPedestrianIdKey, Double> {
// Static variables
public static double ERROR_PED_NOT_IN_MEASUREMENT_AREA = -1;
// Variables
private MeasurementArea measurementArea;
private PedestrianVelocityDefaultProcessor pedestrianVelocityDefaultProcessor;
// Constructors
public PedestrianSpeedInAreaProcessorUsingAgentVelocity() {
super("speedInAreaUsingAgentVelocity");
// "init()" method is used by processor manager to initialize variables.
}
// Getter
public MeasurementArea getMeasurementArea() {
return this.measurementArea;
}
public PedestrianVelocityDefaultProcessor getPedestrianVelocityDefaultProcessor() { return pedestrianVelocityDefaultProcessor; }
// Methods (overridden)
@Override
public void init(final ProcessorManager manager) {
super.init(manager);
AttributesSpeedInAreaProcessorUsingAgentVelocity processorAttributes = (AttributesSpeedInAreaProcessorUsingAgentVelocity) this.getAttributes();
// manager.getMeasurementArea() throws an exception if area is "null" or not rectangular. Though, no checks required here.
boolean rectangularAreaRequired = true;
measurementArea = manager.getMeasurementArea(processorAttributes.getMeasurementAreaId(), rectangularAreaRequired);
pedestrianVelocityDefaultProcessor = (PedestrianVelocityDefaultProcessor) manager.getProcessor(processorAttributes.getPedestrianVelocityDefaultProcessorId());
if (pedestrianVelocityDefaultProcessor == null) {
throw new RuntimeException(String.format("PedestrianVelocityDefaultProcessor with index %d does not exist.", processorAttributes.getPedestrianVelocityDefaultProcessorId()));
}
}
@Override
public AttributesProcessor getAttributes() {
if (super.getAttributes() == null) {
setAttributes(new AttributesSpeedInAreaProcessorUsingAgentVelocity());
}
return super.getAttributes();
}
@Override
protected void doUpdate(final SimulationState state) {
pedestrianVelocityDefaultProcessor.update(state);
for (Pedestrian pedestrian : state.getTopography().getElements(Pedestrian.class)) {
double speed = ERROR_PED_NOT_IN_MEASUREMENT_AREA;
TimestepPedestrianIdKey rowKey = new TimestepPedestrianIdKey(state.getStep(), pedestrian.getId());
if (measurementArea.getShape().contains(pedestrian.getPosition())) {
speed = pedestrianVelocityDefaultProcessor.getValue(rowKey);
}
this.putValue(rowKey, speed);
}
}
}
......@@ -2,7 +2,7 @@ package org.vadere.state.attributes.processor;
import org.vadere.state.attributes.processor.enums.SpeedCalculationStrategy;
public class AttributesSpeedInAreaProcessor extends AttributesProcessor {
public class AttributesSpeedInAreaProcessorUsingAgentTrajectory extends AttributesProcessor {
// Variables
private int measurementAreaId = -1;
......
package org.vadere.state.attributes.processor;
public class AttributesSpeedInAreaProcessorUsingAgentVelocity extends AttributesProcessor {
// Variables
private int measurementAreaId = -1;
private int pedestrianVelocityDefaultProcessor = -1;
// Getter
public int getMeasurementAreaId() {
return this.measurementAreaId;
}
public int getPedestrianVelocityDefaultProcessorId() {
return this.pedestrianVelocityDefaultProcessor;
}
// Setter
public void setMeasurementAreaId(int measurementAreaId) {
checkSealed();
this.measurementAreaId = measurementAreaId;
}
public void setPedestrianVelocityDefaultProcessorId(int pedestrianVelocityDefaultProcessor) {
checkSealed();
this.pedestrianVelocityDefaultProcessor = pedestrianVelocityDefaultProcessor;
}
}