Class HistoryManager
- java.lang.Object
-
- org.opentrafficsim.core.perception.HistoryManager
-
- Direct Known Subclasses:
HistoryManagerDEVS
public abstract class HistoryManager extends Object
History manager with automatic garbage collection by the java garbage collector using weak references to theHistorical
s.Copyright (c) 2013-2022 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.- Version:
- $Revision$, $LastChangedDate$, by $Author$, initial version 18 jan. 2018
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
HistoryManager.HistoricalElement
Historical view for the history manager.
-
Constructor Summary
Constructors Constructor Description HistoryManager()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
endOfSimulation()
Method that clears the entire memory at simulation end.protected Set<HistoryManager.HistoricalElement>
getHistoricals()
Returns the historicals.(package private) abstract Time
now()
Returns the current simulation time.void
registerHistorical(HistoryManager.HistoricalElement historical)
Registers a historical.
-
-
-
Method Detail
-
registerHistorical
public void registerHistorical(HistoryManager.HistoricalElement historical)
Registers a historical.- Parameters:
historical
- HistoricalElement; historical to register.
-
getHistoricals
protected final Set<HistoryManager.HistoricalElement> getHistoricals()
Returns the historicals.- Returns:
- the historicals
-
now
abstract Time now()
Returns the current simulation time. This is used by historicals to time-stamp state changes.- Returns:
- Time; current simulation time.
-
endOfSimulation
protected final void endOfSimulation()
Method that clears the entire memory at simulation end.
-
-