Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
vadere
vadere
Commits
55f3dd9e
Commit
55f3dd9e
authored
Aug 26, 2020
by
Christina
Browse files
stored in data Processor
parent
dbcf835e
Pipeline
#313293
passed with stages
in 132 minutes and 53 seconds
Changes
4
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Scenarios/Demos/Density_controller/scenarios/TwoCorridors_forced_controller.scenario
0 → 100644
View file @
55f3dd9e
{
"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 ]
} ],
"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.ReadAndSetControllerInput",
"id" : 11,
"attributesType" : "org.vadere.state.attributes.processor.AttributesReadAndSetControllerInput",
"attributes" : {
"controllerInputFile" : "Scenarios/Demos/Density_controller/scenarios/TwoCorridors_forced_controller_input.csv",
"useFile" : true
}
} ],
"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" : 160.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" : false,
"strategyModel" : "RouteChoiceThreeCorridors"
},
"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" : 15.0,
"y" : 10.5,
"width" : 15.5,
"height" : 30.0,
"type" : "RECTANGLE"
},
"id" : 6
}, {
"shape" : {
"x" : 0.5,
"y" : 10.5,
"width" : 12.5,
"height" : 30.0,
"type" : "RECTANGLE"
},
"id" : 7
}, {
"shape" : {
"x" : 32.5,
"y" : 10.5,
"width" : 27.0,
"height" : 30.0,
"type" : "RECTANGLE"
},
"id" : 3
} ],
"measurementAreas" : [ {
"shape" : {
"x" : 30.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
} ],
"stairs" : [ ],
"targets" : [ {
"id" : 1,
"absorbing" : true,
"shape" : {
"x" : 44.5,
"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" : 13.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" : 30.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" : [ {
"id" : 4,
"shape" : {
"x" : 39.5,
"y" : 0.5,
"width" : 5.0,
"height" : 10.0,
"type" : "RECTANGLE"
},
"reachDistance" : 0.0,
"changeAlgorithmType" : "SELECT_LIST",
"nextTarget" : [ 2001, 1 ],
"probabilityToChangeTarget" : [ 0.5 ]
} ],
"absorbingAreas" : [ ],
"sources" : [ {
"id" : 2,
"shape" : {
"x" : 44.5,
"y" : 0.5,
"width" : 15.0,
"height" : 10.0,
"type" : "RECTANGLE"
},
"interSpawnTimeDistribution" : "org.vadere.state.scenario.ConstantDistribution",
"distributionParameters" : [ 1.0 ],
"spawnNumber" : 100,
"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
Scenarios/Demos/Density_controller/scenarios/TwoCorridors_forced_controller_input.csv
0 → 100644
View file @
55f3dd9e
This diff is collapsed.
Click to expand it.
VadereSimulator/src/org/vadere/simulator/projects/dataprocessing/processor/ReadAndSetControllerInput.java
0 → 100644
View file @
55f3dd9e
package
org.vadere.simulator.projects.dataprocessing.processor
;
import
org.vadere.annotation.factories.dataprocessors.DataProcessorClass
;
import
org.vadere.simulator.control.simulation.SimulationState
;
import
org.vadere.simulator.projects.dataprocessing.datakey.TimestepKey
;
import
org.vadere.state.attributes.processor.AttributesReadAndSetControllerInput
;
import
java.io.IOException
;
import
java.nio.file.Files
;
import
java.nio.file.Paths
;
import
java.util.Arrays
;
/**
* @author Christina Mayr
* reads and sets controller input defined in an external file
*/
@DataProcessorClass
()
public
class
ReadAndSetControllerInput
extends
DataProcessor
<
TimestepKey
,
Double
>
{
private
double
[][]
controllerInputs
;
public
ReadAndSetControllerInput
()
{
super
(
"percentageLeftRealized"
);
setAttributes
(
new
AttributesReadAndSetControllerInput
());
}
@Override
public
void
preLoop
(
SimulationState
state
)
{
String
fileName
=
getAttributes
().
getControllerInputFile
();
// fileName = "Scenarios/Demos/Density_controller/scenarios/TwoCorridors_forced_controller_input.csv";
try
{
this
.
controllerInputs
=
Files
.
lines
(
Paths
.
get
(
fileName
)).
map
(
s
->
s
.
split
(
" "
)).
map
(
s
->
Arrays
.
stream
(
s
).
mapToDouble
(
Double:
:
parseDouble
).
toArray
()).
toArray
(
double
[][]::
new
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
System
.
out
.
println
(
this
.
controllerInputs
[
0
][
0
]
);
int
i
=
0
;
}
@Override
protected
void
doUpdate
(
SimulationState
state
)
{
}
@Override
public
AttributesReadAndSetControllerInput
getAttributes
()
{
if
(
super
.
getAttributes
()
==
null
)
{
setAttributes
(
new
AttributesReadAndSetControllerInput
());
}
return
(
AttributesReadAndSetControllerInput
)
super
.
getAttributes
();
}
}
VadereState/src/org/vadere/state/attributes/processor/AttributesReadAndSetControllerInput.java
0 → 100644
View file @
55f3dd9e
package
org.vadere.state.attributes.processor
;
public
class
AttributesReadAndSetControllerInput
extends
AttributesProcessor
{
private
String
controllerInputFile
=
null
;
private
boolean
useFile
=
false
;
public
String
getControllerInputFile
()
{
return
controllerInputFile
;
}
public
void
setControllerInputFile
(
String
controllerInputFile
)
{
this
.
controllerInputFile
=
controllerInputFile
;
}
public
boolean
isUseFile
()
{
return
useFile
;
}
public
void
setUseFile
(
boolean
useFile
)
{
this
.
useFile
=
useFile
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment