public abstract class

TupleStorageService

extends Object
implements StorageService
java.lang.Object
   ↳ uk.ac.imperial.presage2.core.db.TupleStorageService

Summary

Public Constructors
TupleStorageService()
Public Methods
PersistentAgent createAgent(UUID agentID, String name)
Create a new PersistentAgent for this simulation.
PersistentSimulation createSimulation(String name, String classname, String state, int finishTime)
Create a PersistentSimulation for the given parameters and set it as the current simulation
PersistentSimulation get()
PersistentAgent getAgent(UUID agentID)
Get the PersistentAgent for this simulation with given UUID.
TransientAgentState getAgentState(UUID agentID, int time)
Get the TransientAgentState associated with agentID at a given time.
PersistentSimulation getSimulation()
Get the PersistentSimulation for the currently running simulation.
PersistentSimulation getSimulationById(long id)
Get a PersistentSimulation which corresponds to the given simulation ID.
void setSimulation(PersistentSimulation sim)
Set the PersistentSimulation to use.
Protected Methods
abstract String fetchParameter(long id, String key)
abstract Set<String> fetchParameterKeys(long id)
String fetchTuple(long id, String key)
String fetchTuple(long id, String key, int t)
abstract <T> T fetchTuple(long id, String key, int t, Class<T> type)
abstract <T> T fetchTuple(long id, String key, Class<T> type)
String fetchTuple(long id, String key, UUID agent)
String fetchTuple(long id, String key, UUID agent, int t)
abstract <T> T fetchTuple(long id, String key, UUID agent, int t, Class<T> type)
abstract <T> T fetchTuple(long id, String key, UUID agent, Class<T> type)
abstract long getNextId()
abstract void storeParameter(long id, String key, String value)
abstract void storeTuple(long id, String key, double value)
abstract void storeTuple(long id, String key, int value)
abstract void storeTuple(long id, String key, int t, double value)
abstract void storeTuple(long id, String key, int t, int value)
abstract void storeTuple(long id, String key, int t, String value)
abstract void storeTuple(long id, String key, String value)
abstract void storeTuple(long id, String key, UUID agent, double value)
abstract void storeTuple(long id, String key, UUID agent, int value)
abstract void storeTuple(long id, String key, UUID agent, int t, double value)
abstract void storeTuple(long id, String key, UUID agent, int t, int value)
abstract void storeTuple(long id, String key, UUID agent, int t, String value)
abstract void storeTuple(long id, String key, UUID agent, String value)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.google.inject.Provider
From interface javax.inject.Provider
From interface uk.ac.imperial.presage2.core.db.StorageService

Public Constructors

public TupleStorageService ()

Public Methods

public PersistentAgent createAgent (UUID agentID, String name)

Create a new PersistentAgent for this simulation.

public 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 PersistentSimulation get ()

public PersistentAgent getAgent (UUID agentID)

Get the PersistentAgent for this simulation with given UUID.

public TransientAgentState getAgentState (UUID agentID, int time)

Get the TransientAgentState associated with agentID at a given time.

public PersistentSimulation getSimulation ()

Get the PersistentSimulation for the currently running simulation.

public PersistentSimulation getSimulationById (long id)

Get a PersistentSimulation which corresponds to the given simulation ID.

public void setSimulation (PersistentSimulation sim)

Set the PersistentSimulation to use.

Protected Methods

protected abstract String fetchParameter (long id, String key)

protected abstract Set<String> fetchParameterKeys (long id)

protected String fetchTuple (long id, String key)

protected String fetchTuple (long id, String key, int t)

protected abstract T fetchTuple (long id, String key, int t, Class<T> type)

protected abstract T fetchTuple (long id, String key, Class<T> type)

protected String fetchTuple (long id, String key, UUID agent)

protected String fetchTuple (long id, String key, UUID agent, int t)

protected abstract T fetchTuple (long id, String key, UUID agent, int t, Class<T> type)

protected abstract T fetchTuple (long id, String key, UUID agent, Class<T> type)

protected abstract long getNextId ()

protected abstract void storeParameter (long id, String key, String value)

protected abstract void storeTuple (long id, String key, double value)

protected abstract void storeTuple (long id, String key, int value)

protected abstract void storeTuple (long id, String key, int t, double value)

protected abstract void storeTuple (long id, String key, int t, int value)

protected abstract void storeTuple (long id, String key, int t, String value)

protected abstract void storeTuple (long id, String key, String value)

protected abstract void storeTuple (long id, String key, UUID agent, double value)

protected abstract void storeTuple (long id, String key, UUID agent, int value)

protected abstract void storeTuple (long id, String key, UUID agent, int t, double value)

protected abstract void storeTuple (long id, String key, UUID agent, int t, int value)

protected abstract void storeTuple (long id, String key, UUID agent, int t, String value)

protected abstract void storeTuple (long id, String key, UUID agent, String value)