Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Vadere trajectory loader #382

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
aaf0df7
Add trajectory loader for Vadere trajectory (postvis.traj) files
Jul 26, 2024
ac65d62
Refactor trajectory_loader for Vadere trajectories
Aug 6, 2024
bfe1d56
Refactor using scripts/format.sh
Aug 6, 2024
d739abb
Add test_load_trajectory_from_vadere_no_data
Aug 9, 2024
5dc5505
Add test_load_trajectory_from_vadere_reference_file including referen…
Aug 9, 2024
0bea69e
Fix unstable floating point operations in trajectory_loader
Aug 9, 2024
491f7f2
Add test_load_trajectory_from_vadere_success
Aug 9, 2024
e5f6400
Group vadere test functions
Aug 9, 2024
2b26626
Add tests for missing and non-unique columns in vadere trajectory files
Aug 9, 2024
a3723ec
Refactor using scripts/format.sh
Aug 9, 2024
f0bfcdb
Refactoring
Aug 9, 2024
7b1558e
Add load_trajectory_from_vadere to __init__.py
Aug 12, 2024
cbad152
Add Vadere example to jupyter notebook
Aug 12, 2024
dade283
Add draft for load_walkable_area_from_vadere_scenario
Aug 12, 2024
533f721
Update vadere scenario and trajectory files
Aug 12, 2024
241168e
Add walkable area for Vadere to user guide jupyter notebook
Aug 12, 2024
420289e
Simplify the way how the Vadere bounding box is loaded to PedPy
Aug 13, 2024
2b84da7
Update jupyter notebook
Aug 13, 2024
2d4a08c
Add decimal places as input variable
Aug 16, 2024
c0abee1
Add test_load_walkable_area_from_vadere_scenario
Aug 16, 2024
b948129
Merge 'main' into branch 'load_vadere_trajectories'
Sep 26, 2024
dbb924d
Refactor error messages and syntax
Sep 26, 2024
40800a9
Correct input argument that leads to error
Sep 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
268 changes: 268 additions & 0 deletions notebooks/demo-data/vadere/bottleneck/bottleneck.scenario
Original file line number Diff line number Diff line change
@@ -0,0 +1,268 @@
{
"name" : "bottleneck",
"description" : "",
"release" : "3.0",
"commithash" : "d79a4bfd2394cfa6fc92372d2ebd1b117ab9a2da",
"processWriters" : {
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.EventtimePedestrianIdOutputFile",
"filename" : "postvis.traj",
"processors" : [ 1, 2 ]
} ],
"processors" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.FootStepProcessor",
"id" : 1
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.FootStepTargetIDProcessor",
"id" : 2
} ],
"isTimestamped" : false,
"isWriteMetaData" : true
},
"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,
"cacheType" : "NO_CACHE",
"cacheDir" : "",
"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" : 50.0,
"simTimeStepLength" : 0.4,
"realTimeSimTimeRatio" : 0.1,
"writeSimulationData" : true,
"visualizationEnabled" : true,
"printFPS" : false,
"digitsPerCoordinate" : 2,
"useFixedSeed" : true,
"fixedSeed" : 98957596352036733,
"simulationSeed" : 98957596352036733
},
"attributesPsychology" : {
"usePsychologyLayer" : false,
"psychologyLayer" : {
"perception" : "SimplePerceptionModel",
"cognition" : "SimpleCognitionModel",
"attributesModel" : {
"org.vadere.state.attributes.models.psychology.perception.AttributesSimplePerceptionModel" : {
"priority" : {
"1" : "InformationStimulus",
"2" : "ChangeTargetScripted",
"3" : "ChangeTarget",
"4" : "Threat",
"5" : "Wait",
"6" : "WaitInArea",
"7" : "DistanceRecommendation"
}
},
"org.vadere.state.attributes.models.psychology.cognition.AttributesSimpleCognitionModel" : { }
}
}
},
"topography" : {
"attributes" : {
"bounds" : {
"x" : 0.0,
"y" : 0.0,
"width" : 8.0,
"height" : 10.0
},
"boundingBoxWidth" : 0.5,
"bounded" : true,
"referenceCoordinateSystem" : null
},
"obstacles" : [ {
"id" : 5,
"shape" : {
"type" : "POLYGON",
"points" : [ {
"x" : 0.5,
"y" : 3.5
}, {
"x" : 0.5,
"y" : 3.0
}, {
"x" : 3.0,
"y" : 3.0
}, {
"x" : 3.0,
"y" : 2.5
}, {
"x" : 3.5,
"y" : 2.5
}, {
"x" : 3.5,
"y" : 3.0
}, {
"x" : 3.5,
"y" : 3.5
}, {
"x" : 3.0,
"y" : 3.5
} ]
},
"visible" : true
}, {
"id" : 6,
"shape" : {
"type" : "POLYGON",
"points" : [ {
"x" : 7.5,
"y" : 3.5
}, {
"x" : 5.0,
"y" : 3.5
}, {
"x" : 4.5,
"y" : 3.5
}, {
"x" : 4.5,
"y" : 3.0
}, {
"x" : 4.5,
"y" : 2.5
}, {
"x" : 5.0,
"y" : 2.5
}, {
"x" : 5.0,
"y" : 3.0
}, {
"x" : 7.5,
"y" : 3.0
} ]
},
"visible" : true
} ],
"measurementAreas" : [ ],
"stairs" : [ ],
"targets" : [ {
"id" : 8,
"shape" : {
"x" : 6.4,
"y" : 1.0,
"width" : 0.6,
"height" : 1.0,
"type" : "RECTANGLE"
},
"visible" : true,
"absorber" : {
"enabled" : true,
"deletionDistance" : 0.1
},
"waiter" : {
"enabled" : false,
"distribution" : null,
"individualWaiting" : true
},
"leavingSpeed" : -1.0,
"parallelEvents" : 0
} ],
"targetChangers" : [ ],
"absorbingAreas" : [ ],
"aerosolClouds" : [ ],
"droplets" : [ ],
"sources" : [ {
"id" : 1,
"shape" : {
"x" : 1.0,
"y" : 5.0,
"width" : 6.0,
"height" : 4.0,
"type" : "RECTANGLE"
},
"visible" : true,
"targetIds" : [ 8 ],
"spawner" : {
"type" : "org.vadere.state.attributes.spawner.AttributesRegularSpawner",
"constraintsElementsMax" : -1,
"constraintsTimeStart" : 0.0,
"constraintsTimeEnd" : 0.0,
"eventPositionRandom" : true,
"eventPositionGridCA" : false,
"eventPositionFreeSpace" : true,
"eventElementCount" : 20,
"eventElement" : null,
"distribution" : {
"type" : "org.vadere.state.attributes.distributions.AttributesConstantDistribution",
"updateFrequency" : 1.0
}
},
"groupSizeDistribution" : [ 1.0 ]
} ],
"dynamicElements" : [ ],
"attributesPedestrian" : {
"shape" : {
"x" : 0.0,
"y" : 0.0,
"width" : 1.0,
"height" : 1.0,
"type" : "RECTANGLE"
},
"visible" : true,
"radius" : 0.2,
"densityDependentSpeed" : false,
"speedDistributionMean" : 1.34,
"speedDistributionStandardDeviation" : 0.26,
"minimumSpeed" : 0.5,
"maximumSpeed" : 2.2,
"acceleration" : 2.0,
"footstepHistorySize" : 4,
"searchRadius" : 1.0,
"walkingDirectionSameIfAngleLessOrEqual" : 45.0,
"walkingDirectionCalculation" : "BY_TARGET_CENTER"
},
"teleporter" : null
},
"stimulusInfos" : [ ]
}
}
Loading
Loading