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
8bd9a92d
Commit
8bd9a92d
authored
Nov 29, 2019
by
Daniel Lehmberg
Browse files
Code cleaning and order of time and state update in Simulation.run()
parent
277e4b8f
Changes
1
Hide whitespace changes
Inline
Side-by-side
VadereSimulator/src/org/vadere/simulator/control/simulation/Simulation.java
View file @
8bd9a92d
...
...
@@ -272,7 +272,9 @@ public class Simulation {
assert
assertAllPedestrianInBounds
():
"Pedestrians are outside of topography bound."
;
updateCallbacks
(
simTimeInSec
);
updateWriters
(
simTimeInSec
);
// set SimulationState with Time!!!
step
++;
this
.
simulationState
=
new
SimulationState
(
name
,
topography
,
scenarioStore
,
simTimeInSec
,
step
,
mainModel
);
if
(
attributesSimulation
.
isWriteSimulationData
())
{
processorManager
.
update
(
this
.
simulationState
);
...
...
@@ -346,19 +348,11 @@ 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
);
return
state
;
}
private
void
updateWriters
(
double
simTimeInSec
)
{
SimulationState
simulationState
=
new
SimulationState
(
name
,
topography
,
scenarioStore
,
simTimeInSec
,
step
,
mainModel
);
this
.
simulationState
=
simulationState
;
}
private
void
updateCallbacks
(
double
simTimeInSec
)
{
List
<
Stimulus
>
stimuli
=
stimulusController
.
getStimuliForTime
(
simTimeInSec
);
...
...
@@ -388,7 +382,6 @@ public class Simulation {
}
topographyController
.
update
(
simTimeInSec
);
//rebuild CellGrid
step
++;
Collection
<
Pedestrian
>
pedestrians
=
topography
.
getElements
(
Pedestrian
.
class
);
perceptionModel
.
update
(
pedestrians
,
stimuli
);
...
...
Write
Preview
Supports
Markdown
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