Class AbstractEventStorage<S extends Solution<S,I>,I extends Instance>

java.lang.Object
es.urjc.etsii.grafo.events.AbstractEventStorage<S,I>
Direct Known Subclasses:
MemoryEventStorage

public abstract class AbstractEventStorage<S extends Solution<S,I>,I extends Instance> extends Object
Recover past events
  • Constructor Details

    • AbstractEventStorage

      public AbstractEventStorage()
  • Method Details

    • getEvents

      public abstract List<MorkEvent> getEvents(int from, int to)
      Get a list of events by id, in range [from, to)
      Parameters:
      from - first event id to return
      to - stop at this event id, without including it
      Returns:
      List of MorkEvent
    • getEvent

      public abstract MorkEvent getEvent(int id)
      Get a single event with the given id
      Parameters:
      id - event id
      Returns:
      event with the given id
      Throws:
      IllegalArgumentException - if the id is not valid
    • getGeneratedSolEventForExp

      public abstract Stream<SolutionGeneratedEvent<S,I>> getGeneratedSolEventForExp(String experimentName)
      Get all solution generated event for a given experiment.
      Parameters:
      experimentName - Experiment name
      Returns:
      SolutionGenerated events
    • getEventsByType

      public abstract <T extends MorkEvent> Stream<T> getEventsByType(Class<T> type)
      Returns an event stream for the given event type, ordered by creation date.
      Type Parameters:
      T - Event type
      Parameters:
      type - Filter by type
      Returns:
      Event stream
    • getAllEvents

      public abstract Stream<MorkEvent> getAllEvents()
      Returns all MorkEvents
      Returns:
      Stream of mork event.
    • solutionsInMemory

      public long solutionsInMemory(String experimentName)
      Count solutions in memory (not garbage collected) for a given experiment
      Returns:
      solution in memory for the given experiment