Commit 76a45b86 authored by Stefan Schuhbaeck's avatar Stefan Schuhbaeck
Browse files

Merge branch 'master' into add_artery_support

parents 91246161 442d062a
Pipeline #320155 passed with stages
in 141 minutes and 17 seconds
......@@ -145,7 +145,9 @@
},
"attributesStrategy" : {
"useStrategyModel" : true,
"strategyModel" : "RouteChoiceThreeCorridors"
"strategyModel" : "RouteChoiceThreeCorridors",
"arguments" : [ ],
"requiredDataProcessorIds" : [ ]
},
"topography" : {
"attributes" : {
......
......@@ -19,6 +19,10 @@
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepOutputFile",
"filename" : "densities.csv",
"processors" : [ 5, 6, 7, 8 ]
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
"filename" : "pedestrianDensities.txt",
"processors" : [ 9, 10 ]
} ],
"processors" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.FootStepProcessor",
......@@ -64,6 +68,31 @@
"attributes" : {
"measurementAreaId" : 1000
}
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianDensityCountingProcessor",
"id" : 9,
"attributesType" : "org.vadere.state.attributes.processor.AttributesPedestrianDensityCountingProcessor",
"attributes" : {
"pedestrianPositionProcessorId" : 11,
"radius" : 1.5
}
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianDensityGaussianProcessor",
"id" : 10,
"attributesType" : "org.vadere.state.attributes.processor.AttributesPedestrianDensityGaussianProcessor",
"attributes" : {
"pedestrianPositionProcessorId" : 11,
"scale" : 10.0,
"standardDeviation" : 0.7,
"obstacleDensity" : true
}
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianPositionProcessor",
"id" : 11,
"attributesType" : "org.vadere.state.attributes.processor.AttributesPedestrianPositionProcessor",
"attributes" : {
"interpolate" : true
}
} ],
"isTimestamped" : false,
"isWriteMetaData" : false
......@@ -145,7 +174,9 @@
},
"attributesStrategy" : {
"useStrategyModel" : false,
"strategyModel" : "RouteChoiceThreeCorridors"
"strategyModel" : "RouteChoiceThreeCorridors",
"arguments" : [ ],
"requiredDataProcessorIds" : [ ]
},
"topography" : {
"attributes" : {
......
......@@ -23,6 +23,14 @@
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepOutputFile",
"filename" : "AreaDensityCounting.txt",
"processors" : [ 8 ]
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepKeyIdOutputFile",
"filename" : "MeshDensityCounting.txt",
"processors" : [ 9 ]
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.NoDataKeyOutputFile",
"filename" : "Mesh.txt",
"processors" : [ 10 ]
} ],
"processors" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.FootStepProcessor",
......@@ -77,7 +85,8 @@
"attributesType" : "org.vadere.state.attributes.processor.AttributesMeshProcessor",
"attributes" : {
"measurementAreaId" : 1,
"edgeLength" : 1.5
"edgeLength" : 1.5,
"displayMesh" : false
}
} ],
"isTimestamped" : true,
......@@ -160,7 +169,9 @@
},
"attributesStrategy" : {
"useStrategyModel" : false,
"strategyModel" : "RouteChoiceThreeCorridors"
"strategyModel" : "RouteChoiceThreeCorridors",
"arguments" : [ ],
"requiredDataProcessorIds" : [ ]
},
"topography" : {
"attributes" : {
......
{
"name" : "TwoCorridors_forced_controller",
"description" : "",
"release" : "1.14",
"processWriters" : {
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.EventtimePedestrianIdOutputFile",
"filename" : "postvis.traj",
"processors" : [ 1, 2 ]
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOverlapOutputFile",
"filename" : "overlaps.csv",
"processors" : [ 3 ]
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.NoDataKeyOutputFile",
"filename" : "overlapCount.txt",
"processors" : [ 4 ]
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.NoDataKeyOutputFile",
"filename" : "evacuationTime.txt",
"processors" : [ 5 ]
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepOutputFile",
"filename" : "AreaDensityCounting.txt",
"processors" : [ 8 ]
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepKeyIdOutputFile",
"filename" : "MeshDensityCounting.txt",
"processors" : [ 9 ]
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.NoDataKeyOutputFile",
"filename" : "Mesh.txt",
"processors" : [ 10 ]
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepOutputFile",
"filename" : "controllerOutput.txt",
"processors" : [ 11 ]
} ],
"processors" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.FootStepProcessor",
"id" : 1
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.FootStepTargetIDProcessor",
"id" : 2
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianOverlapProcessor",
"id" : 3
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.NumberOverlapsProcessor",
"id" : 4,
"attributesType" : "org.vadere.state.attributes.processor.AttributesNumberOverlapsProcessor",
"attributes" : {
"pedestrianOverlapProcessorId" : 3
}
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.EvacuationTimeProcessor",
"id" : 5,
"attributesType" : "org.vadere.state.attributes.processor.AttributesEvacuationTimeProcessor",
"attributes" : {
"pedestrianEvacuationTimeProcessorId" : 6
}
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianEvacuationTimeProcessor",
"id" : 6,
"attributesType" : "org.vadere.state.attributes.processor.AttributesPedestrianEvacuationTimeProcessor",
"attributes" : {
"pedestrianStartTimeProcessorId" : 7
}
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianStartTimeProcessor",
"id" : 7
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.AreaDensityCountingProcessor",
"id" : 8,
"attributesType" : "org.vadere.state.attributes.processor.AttributesAreaDensityCountingProcessor",
"attributes" : {
"measurementAreaId" : 1000
}
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.MeshDensityCountingProcessor",
"id" : 9,
"attributesType" : "org.vadere.state.attributes.processor.AttributesMeshDensityCountingProcessor",
"attributes" : {
"meshProcessorId" : 10
}
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.MeshProcessor",
"id" : 10,
"attributesType" : "org.vadere.state.attributes.processor.AttributesMeshProcessor",
"attributes" : {
"measurementAreaId" : 1,
"edgeLength" : 1.5,
"displayMesh" : false
}
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.StrategyControllerValuesRealized",
"id" : 11
} ],
"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,
"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" : 200.0,
"simTimeStepLength" : 0.4,
"realTimeSimTimeRatio" : 0.1,
"writeSimulationData" : true,
"visualizationEnabled" : true,
"printFPS" : false,
"digitsPerCoordinate" : 2,
"useFixedSeed" : false,
"fixedSeed" : 2617225706430579811,
"simulationSeed" : 0
},
"attributesPsychology" : {
"usePsychologyLayer" : false,
"psychologyLayer" : {
"perception" : "SimplePerceptionModel",
"cognition" : "SimpleCognitionModel"
}
},
"attributesStrategy" : {
"useStrategyModel" : true,
"strategyModel" : "ReadSetControllerInputs",
"arguments" : [ "Scenarios/Demos/Density_controller/scenarios/TwoCorridors_forced_controller_input.csv" ],
"requiredDataProcessorIds" : [ 10 ]
},
"topography" : {
"attributes" : {
"bounds" : {
"x" : 0.0,
"y" : 0.0,
"width" : 60.0,
"height" : 51.0
},
"boundingBoxWidth" : 0.5,
"bounded" : true,
"referenceCoordinateSystem" : null
},
"obstacles" : [ {
"shape" : {
"x" : 5.0,
"y" : 10.5,
"width" : 15.5,
"height" : 30.0,
"type" : "RECTANGLE"
},
"id" : 6
}, {
"shape" : {
"x" : 0.5,
"y" : 10.5,
"width" : 2.5,
"height" : 30.0,
"type" : "RECTANGLE"
},
"id" : 7
}, {
"shape" : {
"type" : "POLYGON",
"points" : [ {
"x" : 22.5,
"y" : 40.5
}, {
"x" : 22.5,
"y" : 4.5
}, {
"x" : 40.0,
"y" : 4.5
}, {
"x" : 40.0,
"y" : 30.0
}, {
"x" : 59.5,
"y" : 30.0
}, {
"x" : 59.5,
"y" : 50.5
}, {
"x" : 39.9,
"y" : 50.5
}, {
"x" : 40.0,
"y" : 40.5
} ]
},
"id" : 3
} ],
"measurementAreas" : [ {
"shape" : {
"x" : 20.5,
"y" : 10.5,
"width" : 2.0,
"height" : 10.0,
"type" : "RECTANGLE"
},
"id" : 1000
}, {
"shape" : {
"x" : 0.5,
"y" : 0.5,
"width" : 59.0,
"height" : 50.0,
"type" : "RECTANGLE"
},
"id" : 1
}, {
"shape" : {
"x" : 27.9,
"y" : 0.5,
"width" : 10.0,
"height" : 4.0,
"type" : "RECTANGLE"
},
"id" : 555
} ],
"stairs" : [ ],
"targets" : [ {
"id" : 1,
"absorbing" : true,
"shape" : {
"x" : 25.0,
"y" : 40.5,
"width" : 15.0,
"height" : 10.0,
"type" : "RECTANGLE"
},
"waitingTime" : 0.0,
"waitingTimeYellowPhase" : 0.0,
"parallelWaiters" : 0,
"individualWaiting" : true,
"deletionDistance" : 0.1,
"startingWithRedLight" : false,
"nextSpeed" : -1.0
}, {
"id" : 2001,
"absorbing" : false,
"shape" : {
"x" : 3.0,
"y" : 13.4,
"width" : 2.0,
"height" : 1.0,
"type" : "RECTANGLE"
},
"waitingTime" : 0.0,
"waitingTimeYellowPhase" : 0.0,
"parallelWaiters" : 0,
"individualWaiting" : true,
"deletionDistance" : 0.1,
"startingWithRedLight" : false,
"nextSpeed" : -1.0
}, {
"id" : 2002,
"absorbing" : false,
"shape" : {
"x" : 20.5,
"y" : 13.6,
"width" : 2.0,
"height" : 1.0,
"type" : "RECTANGLE"
},
"waitingTime" : 0.0,
"waitingTimeYellowPhase" : 0.0,
"parallelWaiters" : 0,
"individualWaiting" : true,
"deletionDistance" : 0.1,
"startingWithRedLight" : false,
"nextSpeed" : -1.0
} ],
"targetChangers" : [ ],
"absorbingAreas" : [ ],
"sources" : [ {
"id" : 2,
"shape" : {
"x" : 40.0,
"y" : 10.5,
"width" : 19.5,
"height" : 19.5,
"type" : "RECTANGLE"
},
"interSpawnTimeDistribution" : "org.vadere.state.scenario.ConstantDistribution",
"distributionParameters" : [ 1.0 ],
"spawnNumber" : 250,
"maxSpawnNumberTotal" : -1,
"startTime" : 0.0,
"endTime" : 0.0,
"spawnAtRandomPositions" : true,
"spawnAtGridPositionsCA" : false,
"useFreeSpaceOnly" : true,
"targetIds" : [ 2002, 1 ],
"groupSizeDistribution" : [ 1.0 ],
"dynamicElementType" : "PEDESTRIAN",
"attributesPedestrian" : null
} ],
"dynamicElements" : [ ],
"attributesPedestrian" : {
"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,
"walkingDirectionCalculation" : "BY_TARGET_CENTER",
"walkingDirectionSameIfAngleLessOrEqual" : 45.0
},
"teleporter" : null,
"attributesCar" : {
"id" : -1,
"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,
"walkingDirectionCalculation" : "BY_TARGET_CENTER",
"walkingDirectionSameIfAngleLessOrEqual" : 45.0,
"length" : 4.5,
"width" : 1.7,
"direction" : {
"x" : 1.0,
"y" : 0.0
}
}
},
"stimulusInfos" : [ ]
}
}
\ No newline at end of file
......@@ -23,6 +23,14 @@
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepOutputFile",
"filename" : "AreaDensityCounting.txt",
"processors" : [ 8 ]
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepKeyIdOutputFile",
"filename" : "MeshDensityCounting.txt",
"processors" : [ 9 ]
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.NoDataKeyOutputFile",
"filename" : "Mesh.txt",
"processors" : [ 10 ]
} ],
"processors" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.FootStepProcessor",
......@@ -77,7 +85,8 @@
"attributesType" : "org.vadere.state.attributes.processor.AttributesMeshProcessor",
"attributes" : {
"measurementAreaId" : 1,
"edgeLength" : 1.5
"edgeLength" : 1.5,
"displayMesh" : false
}
} ],
"isTimestamped" : true,
......@@ -160,7 +169,9 @@
},
"attributesStrategy" : {
"useStrategyModel" : false,
"strategyModel" : "RouteChoiceThreeCorridors"
"strategyModel" : "RouteChoiceThreeCorridors",
"arguments" : [ ],
"requiredDataProcessorIds" : [ ]
},
"topography" : {
"attributes" : {
......@@ -350,4 +361,4 @@
},
"stimulusInfos" : [ ]
}
}
}
\ No newline at end of file
......@@ -66,7 +66,7 @@ public class OfflineSimulation {
.map(t -> t.getAgent(step.getStepNumber()))
.filter(opt -> opt.isPresent()).forEach(opt -> topography.addElement(opt.get()));
return new SimulationState(vadere.getName(), topography, vadere.getScenarioStore(),
(step.getStepNumber()-1) * vadere.getAttributesSimulation().getSimTimeStepLength(), step.getStepNumber(), null);
(step.getStepNumber()-1) * vadere.getAttributesSimulation().getSimTimeStepLength(), step.getStepNumber(), null, null);
}
private void prepareOutput() {
......
......@@ -18,7 +18,6 @@ import org.vadere.simulator.projects.Domain;
import org.vadere.simulator.projects.ScenarioStore;
import org.vadere.simulator.projects.SimulationResult;
import org.vadere.simulator.projects.dataprocessing.ProcessorManager;
import org.vadere.simulator.projects.dataprocessing.processor.DataProcessor;
import org.vadere.simulator.utils.cache.ScenarioCache;
import org.vadere.state.attributes.AttributesSimulation;
import org.vadere.state.attributes.scenario.AttributesAgent;
......@@ -228,7 +227,7 @@ public class Simulation {
}
private void postLoop() {
simulationState = new SimulationState(name, topography, scenarioStore, simTimeInSec, step, mainModel);
simulationState = new SimulationState(name, topography, scenarioStore, simTimeInSec, step, mainModel, strategyModel);
topographyController.postLoop(this.simTimeInSec);
for (Model m : models) {
......@@ -287,7 +286,7 @@ public class Simulation {
updateCallbacks(simTimeInSec);
step++;
this.simulationState = new SimulationState(name, topography, scenarioStore, simTimeInSec, step, mainModel);
this.simulationState = new SimulationState(name, topography, scenarioStore, simTimeInSec, step, mainModel, strategyModel);
if (attributesSimulation.isWriteSimulationData()) {
processorManager.update(this.simulationState);
......@@ -374,7 +373,7 @@ public class Simulation {
}
private SimulationState initialSimulationState() {
SimulationState state = new SimulationState(name, topography.clone(), scenarioStore, simTimeInSec, step, mainModel);
SimulationState state = new SimulationState(name, topography.clone(), scenarioStore, simTimeInSec, step, mainModel, strategyModel );
return state;
}
......@@ -426,12 +425,11 @@ public class Simulation {
private void updateStrategyLayer(double simTimeInSec) {
if (scenarioStore.getAttributesStrategyModel().isUseStrategyModel()) {
Collection<Pedestrian> pedestrians = topography.getElements(Pedestrian.class);
if (simTimeInSec == startTimeInSec) {
strategyModel.update(simTimeInSec, pedestrians, null);
strategyModel.update(simTimeInSec, topography, null);
}
strategyModel.update(simTimeInSec, pedestrians, processorManager);
strategyModel.update(simTimeInSec, topography, processorManager);
}
......