|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjecthSimulator.library.Simulator
public class Simulator
This object implements an optimized, multithread model simulator. Optimized multithreading implementation of many simulation algorithms are provided (exact stochastic, deterministic and hybrid).
Constructor Summary | |
---|---|
Simulator(Model m)
Creates a new model simulator. |
|
Simulator(Model m,
int nThreads)
Creates a new model simulator. |
Method Summary | |
---|---|
double |
getCompletedPercentage()
Returns the percentage of calculation that has been completed on average by each simulation task. |
int |
getMaxNumberOfSteps()
Returns the maximum number of steps that the simulator can compute. |
boolean |
isSimulationPaused()
Returns if the simulation process has been paused. |
void |
pauseSimulation()
Pauses a simulation process before its completion. |
void |
resumeSimulation()
Resumes a (paused) simulation process. |
void |
setMaxNumberOfSteps(int maxN)
Sets the maximum number of steps that the simulator can compute. |
void |
shutDown()
Shuts down the java service used for parallel computing. |
SimulatedTS |
simDM(int nSim,
int tMax,
double tsSampling)
Simulates the model according to the Gillespie Direct Method (DM). |
SimulatedTS |
simDM(int nSim,
List<String> varsToBeSaved,
int tMax,
double tsSampling)
Simulates the model according to the Gillespie Direct Method (DM). |
SimulatedTS |
simEuler(int tMax,
double dT,
double tsSampling)
Simulates the model according to the Euler deterministic algorithm. |
SimulatedTS |
simEuler(List<String> varsToBeSaved,
int tMax,
double dT,
double tsSampling)
Simulates the model according to the Euler deterministic algorithm. |
SimulatedTS |
simHRSSA(int nSim,
int tMax,
double delta,
int epsilon,
int gamma,
int theta,
double dT,
double tsSampling)
Simulates the model according to the Hybrid Rejection-based Stochastic Simulation Algorithm (HRSSA). |
SimulatedTS |
simHRSSA(int nSim,
List<String> varsToBeSaved,
int tMax,
double delta,
int epsilon,
int gamma,
int theta,
double dT,
double tsSampling)
Simulates the model according to the Hybrid Rejection-based Stochastic Simulation Algorithm (HRSSA). |
SimulatedTS |
simRK45(int tMax,
double initialDT,
double maxErr,
double tsSampling)
Simulates the model according to the Runge-Kutta-Fehlberg (RK45) deterministic algorithm. |
SimulatedTS |
simRK45(List<String> varsToBeSaved,
int tMax,
double initialDT,
double maxErr,
double tsSampling)
Simulates the model according to the Runge-Kutta-Fehlberg (RK45) deterministic algorithm. |
SimulatedTS |
simRSSA(int nSim,
int tMax,
double delta,
int epsilon,
double tsSampling)
Simulates the model according to the Rejection-based Stochastic Simulation Algorithm (RSSA). |
SimulatedTS |
simRSSA(int nSim,
List<String> varsToBeSaved,
int tMax,
double delta,
int epsilon,
double tsSampling)
Simulates the model according to the Rejection-based Stochastic Simulation Algorithm (RSSA). |
void |
stopSimulation()
Stops a simulation process before its completion. |
String |
toString()
Returns the textual specification of the model that is simulated. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Simulator(Model m)
m
- the model that will be simulatedModel
public Simulator(Model m, int nThreads)
m
- the model that will be simulatednThreads
- size of the thread pool used for parallel computationModel
Method Detail |
---|
public void shutDown()
public void setMaxNumberOfSteps(int maxN)
Integer.MAX_VALUE
maxN
- the maximum number of stepspublic int getMaxNumberOfSteps()
public String toString()
toString
in class Object
public double getCompletedPercentage()
public SimulatedTS simEuler(int tMax, double dT, double tsSampling) throws ExecutionException, SimulationStoppedException
SimulatedTS
object will store all the computed time series.
tMax
- maximum time instant to be simulateddT
- discretization steptsSampling
- the time sampling used for storing time series in the SimulatedTS
object
ExecutionException
- if an error occurred during the simulation process
SimulationStoppedException
- if the simulation process has been prematurely stopped by means of the stopSimulation()
methodpublic SimulatedTS simEuler(List<String> varsToBeSaved, int tMax, double dT, double tsSampling) throws ExecutionException, SimulationStoppedException
variableName + Model.variableCompartmentSeparator + compartmentName
.
varsToBeSaved
- the list of variable IDs whose time series will be stored in the SimulatedTS
objecttMax
- maximum time instant to be simulateddT
- discretization steptsSampling
- the time sampling used for storing time series in the SimulatedTS
object
ExecutionException
- if an error occurred during the simulation process
SimulationStoppedException
- if the simulation process has been prematurely stopped by means of the stopSimulation()
methodpublic SimulatedTS simRK45(int tMax, double initialDT, double maxErr, double tsSampling) throws ExecutionException, SimulationStoppedException
SimulatedTS
object will store all the computed time series.
tMax
- maximum time instant to be simulatedinitialDT
- initial discretization stepmaxErr
- maximum error admitted during the computation of the dynamicstsSampling
- the time sampling used for storing time series in the SimulatedTS
object
ExecutionException
- if an error occurred during the simulation process
SimulationStoppedException
- if the simulation process has been prematurely stopped by means of the stopSimulation()
methodpublic SimulatedTS simRK45(List<String> varsToBeSaved, int tMax, double initialDT, double maxErr, double tsSampling) throws ExecutionException, SimulationStoppedException
variableName + Model.variableCompartmentSeparator + compartmentName
.
varsToBeSaved
- the list of variable IDs whose time series will be stored in the SimulatedTS
objecttMax
- maximum time instant to be simulatedinitialDT
- initial discretization stepmaxErr
- maximum error admitted during the computation of the dynamicstsSampling
- the time sampling used for storing time series in the SimulatedTS
object
ExecutionException
- if an error occurred during the simulation process
SimulationStoppedException
- if the simulation process has been prematurely stopped by means of the stopSimulation()
methodpublic SimulatedTS simDM(int nSim, int tMax, double tsSampling) throws ExecutionException, SimulationStoppedException
SimulatedTS
object will store all the computed time series.
nSim
- number of parallel simulations that will be computedtMax
- maximum time instant to be simulatedtsSampling
- the time sampling used for storing time series in the SimulatedTS
object
ExecutionException
- if an error occurred during the simulation process
SimulationStoppedException
- if the simulation process has been prematurely stopped by means of the stopSimulation()
methodpublic SimulatedTS simDM(int nSim, List<String> varsToBeSaved, int tMax, double tsSampling) throws ExecutionException, SimulationStoppedException
variableName + Model.variableCompartmentSeparator + compartmentName
.
nSim
- number of parallel simulations that will be computedvarsToBeSaved
- the list of variable IDs whose time series will be stored in the SimulatedTS
objecttMax
- maximum time instant to be simulatedtsSampling
- the time sampling used for storing time series in the SimulatedTS
object
ExecutionException
- if an error occurred during the simulation process
SimulationStoppedException
- if the simulation process has been prematurely stopped by means of the stopSimulation()
methodpublic SimulatedTS simRSSA(int nSim, int tMax, double delta, int epsilon, double tsSampling) throws ExecutionException, SimulationStoppedException
SimulatedTS
object will store all the computed time series.
nSim
- number of parallel simulations that will be computedtMax
- maximum time instant to be simulateddelta
- delta for calculating the fluctuation interval of variable statesepsilon
- minimum size of fluctuation intervalstsSampling
- the time sampling used for storing time series in the SimulatedTS
object
ExecutionException
- if an error occurred during the simulation process
SimulationStoppedException
- if the simulation process has been prematurely stopped by means of the stopSimulation()
methodpublic SimulatedTS simRSSA(int nSim, List<String> varsToBeSaved, int tMax, double delta, int epsilon, double tsSampling) throws ExecutionException, SimulationStoppedException
variableName + Model.variableCompartmentSeparator + compartmentName
.
nSim
- number of parallel simulations that will be computedvarsToBeSaved
- the list of variable IDs whose time series will be stored in the SimulatedTS
objecttMax
- maximum time instant to be simulateddelta
- delta for calculating the fluctuation interval of variable statesepsilon
- minimum size of fluctuation intervalstsSampling
- the time sampling used for storing time series in the SimulatedTS
object
ExecutionException
- if an error occurred during the simulation process
SimulationStoppedException
- if the simulation process has been prematurely stopped by means of the stopSimulation()
methodpublic SimulatedTS simHRSSA(int nSim, int tMax, double delta, int epsilon, int gamma, int theta, double dT, double tsSampling) throws ExecutionException, SimulationStoppedException
SimulatedTS
object will store all the computed time series.
nSim
- number of parallel simulations that will be computedtMax
- maximum time instant to be simulateddelta
- delta for calculating the fluctuation interval of variable statesepsilon
- minimum size of fluctuation intervalsgamma
- minimum molecule number of fast reactionstheta
- minimum number of reaction firing of fast reactionsdT
- discretization step used to simulate fast reactionstsSampling
- the time sampling used for storing time series in the SimulatedTS
object
ExecutionException
- if an error occurred during the simulation process
SimulationStoppedException
- if the simulation process has been prematurely stopped by means of the stopSimulation()
methodpublic SimulatedTS simHRSSA(int nSim, List<String> varsToBeSaved, int tMax, double delta, int epsilon, int gamma, int theta, double dT, double tsSampling) throws ExecutionException, SimulationStoppedException
variableName + Model.variableCompartmentSeparator + compartmentName
.
nSim
- number of parallel simulations that will be computedvarsToBeSaved
- the list of variable IDs whose time series will be stored in the SimulatedTS
objecttMax
- maximum time instant to be simulateddelta
- delta for calculating the fluctuation interval of variable statesepsilon
- minimum size of fluctuation intervalsgamma
- minimum molecule number of fast reactionstheta
- minimum number of reaction firing of fast reactionsdT
- discretization step used to simulate fast reactionstsSampling
- the time sampling used for storing time series in the SimulatedTS
object
ExecutionException
- if an error occurred during the simulation process
SimulationStoppedException
- if the simulation process has been prematurely stopped by means of the stopSimulation()
methodpublic void stopSimulation()
public void pauseSimulation()
resumeSimulation()
or definitively stopped by means of the method stopSimulation()
.
public boolean isSimulationPaused()
public void resumeSimulation()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |