Package es.urjc.etsii.grafo.events
Class MemoryEventStorage<S extends Solution<S,I>,I extends Instance>
java.lang.Object
es.urjc.etsii.grafo.events.AbstractEventStorage<S,I>
es.urjc.etsii.grafo.events.MemoryEventStorage<S,I>
@Service
public class MemoryEventStorage<S extends Solution<S,I>,I extends Instance>
extends AbstractEventStorage<S,I>
Store historical event data
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAllEvents.getEvent
(int id) Get a single event with the given idgetEvents
(int from, int to) Get a list of events by id, in range [from, to)getEventsByType
(Class<T> type) Returns an event stream for the given event type, ordered by creation date.getGeneratedSolEventForExp
(String experimentName) Get all solution generated event for a given experiment.getLastEvent.void
storeEvent
(MorkEvent event) Store in memory the given eventMethods inherited from class es.urjc.etsii.grafo.events.AbstractEventStorage
solutionsInMemory
-
Constructor Details
-
MemoryEventStorage
protected MemoryEventStorage()Constructor for MemoryEventStorage.
-
-
Method Details
-
storeEvent
Store in memory the given event- Parameters:
event
- event to save
-
getEvents
Get a list of events by id, in range [from, to) Retrieve events by range [from, to). -
getEvent
Description copied from class:AbstractEventStorage
Get a single event with the given id -
getGeneratedSolEventForExp
Get all solution generated event for a given experiment.- Specified by:
getGeneratedSolEventForExp
in classAbstractEventStorage<S extends Solution<S,
I>, I extends Instance> - Parameters:
experimentName
- Experiment name- Returns:
- SolutionGenerated events
-
getEventsByType
Returns an event stream for the given event type, ordered by creation date.- Specified by:
getEventsByType
in classAbstractEventStorage<S extends Solution<S,
I>, I extends Instance> - Type Parameters:
T
- Event type- Parameters:
type
- Filter by type- Returns:
- Event stream
-
getAllEvents
getAllEvents.
- Specified by:
getAllEvents
in classAbstractEventStorage<S extends Solution<S,
I>, I extends Instance> - Returns:
- a
Stream
object.
-
getLastEvent
getLastEvent.
- Returns:
- a
MorkEvent
object.
-