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
38ad54dc
Commit
38ad54dc
authored
Dec 05, 2019
by
Daniel Lehmberg
Browse files
Resolve "Measurements if no Agent is in the measurement area"
parent
a54698f4
Changes
2
Hide whitespace changes
Inline
Side-by-side
VadereSimulator/src/org/vadere/simulator/projects/dataprocessing/processor/AreaSpeedProcessor.java
View file @
38ad54dc
...
...
@@ -50,7 +50,8 @@ public class AreaSpeedProcessor extends AreaDataProcessor<Double> {
}
}
this
.
putValue
(
new
TimestepKey
(
step
),
(
pedCount
>
0
?
sumVelocities
/
pedCount
:
0.0
));
// Insert a NaN value if there are no agents available (see #287)
this
.
putValue
(
new
TimestepKey
(
step
),
(
pedCount
>
0
?
sumVelocities
/
pedCount
:
Double
.
NaN
));
}
@Override
...
...
VadereSimulator/tests/org/vadere/simulator/projects/dataprocessing/processor/AreaSpeedProcessorTestEnv.java
View file @
38ad54dc
...
...
@@ -115,7 +115,9 @@ public class AreaSpeedProcessorTestEnv extends ProcessorTestEnv<TimestepKey, Dou
when
(
state
.
getSimTimeInSec
()).
thenReturn
(
simTime
);
int
step
=
state
.
getStep
();
addToExpectedOutput
(
new
TimestepKey
(
step
),
0.0
);
// if no agent is in the area, then return NaN (see #287)
addToExpectedOutput
(
new
TimestepKey
(
step
),
Double
.
NaN
);
}
});
}
...
...
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