public interface

StorageService

implements Provider<T>
uk.ac.imperial.presage2.core.db.StorageService
Known Indirect Subclasses

Class Overview

A service to provide storage of simulation data.

Summary

Public Methods
abstract PersistentAgent createAgent(UUID agentID, String name)
Create a new PersistentAgent for this simulation.
abstract PersistentSimulation createSimulation(String name, String classname, String state, int finishTime)
Create a PersistentSimulation for the given parameters and set it as the current simulation
abstract PersistentAgent getAgent(UUID agentID)
Get the PersistentAgent for this simulation with given UUID.
abstract TransientAgentState getAgentState(UUID agentID, int time)
Get the TransientAgentState associated with agentID at a given time.
abstract PersistentSimulation getSimulation()
Get the PersistentSimulation for the currently running simulation.
abstract PersistentSimulation getSimulationById(long id)
Get a PersistentSimulation which corresponds to the given simulation ID.
abstract List<Long> getSimulations()
abstract void setSimulation(PersistentSimulation sim)
Set the PersistentSimulation to use.
[Expand]
Inherited Methods
From interface com.google.inject.Provider
From interface javax.inject.Provider

Public Methods

public abstract PersistentAgent createAgent (UUID agentID, String name)

Create a new PersistentAgent for this simulation.

public abstract PersistentSimulation createSimulation (String name, String classname, String state, int finishTime)

Create a PersistentSimulation for the given parameters and set it as the current simulation

Parameters
name name of the simulation
classname name of the simulation's main class
state current state of the simulation
finishTime number of simulation cycles in this sim
Returns

public abstract PersistentAgent getAgent (UUID agentID)

Get the PersistentAgent for this simulation with given UUID.

public abstract TransientAgentState getAgentState (UUID agentID, int time)

Get the TransientAgentState associated with agentID at a given time.

public abstract PersistentSimulation getSimulation ()

Get the PersistentSimulation for the currently running simulation.

public abstract PersistentSimulation getSimulationById (long id)

Get a PersistentSimulation which corresponds to the given simulation ID.

public abstract List<Long> getSimulations ()

Returns
  • A List of the IDs of simulations kept in this storage medium.

public abstract void setSimulation (PersistentSimulation sim)

Set the PersistentSimulation to use.