public class Trajectory
extends java.lang.Object
Pedestrian
objects, that can be seen
as pedestrian states of the same pedestrian. The representing pedestrian is the same, so all
Pedestrian
objects has
the same id but the state of a pedestrian changes over time.Modifier and Type | Field and Description |
---|---|
private java.util.Optional<Step> |
firstStep |
private java.util.Optional<Step> |
lastStep |
private int |
pedestrianId |
private java.util.Comparator<Step> |
stepReverseComparator |
private java.util.Map<Step,Agent> |
trajectoryPoints |
Constructor and Description |
---|
Trajectory(int pedestrianId) |
Trajectory(java.util.Map<Step,java.util.List<Agent>> pedestrianByStep,
int pedestrianId) |
Modifier and Type | Method and Description |
---|---|
void |
addStep(Step step,
Agent agent) |
void |
fill() |
java.util.Optional<Agent> |
getAgent(Step step)
Returns an Optional
|
java.util.Optional<Step> |
getEndStep() |
java.util.Optional<java.lang.Integer> |
getLifeTime() |
int |
getPedestrianId()
Returns the pedestrian id that specified this trajectory.
|
java.util.stream.Stream<org.vadere.util.geometry.shapes.VPoint> |
getPositionsReverse(Step step)
Return a
java.util.stream.Stream<> stream of
VPoint pedestrian positions
from the first step (1) to the (step.getStepNumber()) in reverse order. |
java.util.Optional<Step> |
getStartStep() |
boolean |
isPedestrianAlive(Step step)
Returns true if the pedestrian is alive at the specific time step, alive means the pedestrain
appeared and does not jet
disappeared.
|
boolean |
isPedestrianAppeared(Step step)
Returns true if the pedestrian appeared, otherwise false.
|
boolean |
isPedestrianDisappeared(Step step)
Returns true if the pedestrian disappeared, otherwise false.
|
private java.util.stream.Stream<org.vadere.util.geometry.shapes.VPoint> |
toPointStream(Agent agent) |
private java.util.Comparator<Step> stepReverseComparator
private java.util.Optional<Step> firstStep
private java.util.Optional<Step> lastStep
private int pedestrianId
public void fill()
public java.util.Optional<java.lang.Integer> getLifeTime()
public int getPedestrianId()
public boolean isPedestrianAlive(Step step)
step
- the time steppublic boolean isPedestrianAppeared(Step step)
step
- the time steppublic boolean isPedestrianDisappeared(Step step)
step
- the time steppublic java.util.Optional<Agent> getAgent(Step step)
step
- the time step that specify the pedestrianpublic java.util.stream.Stream<org.vadere.util.geometry.shapes.VPoint> getPositionsReverse(Step step)
java.util.stream.Stream<>
stream of
VPoint
pedestrian positions
from the first step (1) to the (step.getStepNumber()) in reverse order.step
- the step of the last pedestrian positionprivate java.util.stream.Stream<org.vadere.util.geometry.shapes.VPoint> toPointStream(@NotNull Agent agent)
public java.util.Optional<Step> getStartStep()
public java.util.Optional<Step> getEndStep()