14 #ifndef GILLESPIEINTEGRATOR_H_
15 #define GILLESPIEINTEGRATOR_H_
20 #include "rrRoadRunnerOptions.h"
22 #include "tr1proxy/rr_random.h"
29 class ExecutableModel;
139 cxx11_ns::mt19937 engine;
144 int floatingSpeciesStart;
145 double* reactionRates;
146 double* reactionRatesBuffer;
149 double* stateVectorRate;
155 std::vector<unsigned char> eventStatus;
156 std::vector<unsigned char> previousEventStatus;
158 void testRootsAtInitialTime();
159 void applyEvents(
double timeEnd, std::vector<unsigned char> &previousEventStatus);
162 void setEngineSeed(
unsigned long seed);
163 unsigned long getSeed()
const;
165 inline double getStoich(uint species, uint reaction)
167 return stoichData[species * stoichCols + reaction];
176 void initializeFromModel();
RoadRunner's Gillespie SSA integrator.
Base class for all code generation systems; allows compiling and evaluating the model.
Definition: rrExecutableModel.h:118
RoadRunner's implementation of the Gillespie SSA.
Definition: GillespieIntegrator.h:36
static std::string getGillespieDescription()
Get the description for this integrator.
std::string getName() const
Get the name for this integrator.
void resetSettings()
Reset all integrator settings to their respective default values.
static std::string getGillespieHint()
Get the hint for this integrator.
void setValue(std::string setting, const Variant &value)
Sets the value of an integrator setting (e.g. absolute_tolerance)
IntegratorListenerPtr getListener()
Gets the integrator listener.
double integrate(double t0, double tf)
Main integration routine.
void restart(double timeStart)
Reset time to zero and reinitialize model.
std::string getHint() const
Get the hint for this integrator.
virtual void syncWithModel(ExecutableModel *m)
Called whenever a new model is loaded to allow integrator to reset internal state.
void setListener(IntegratorListenerPtr)
Sets the integrator listener.
std::string getDescription() const
Get the description for this integrator.
IntegrationMethod getIntegrationMethod() const
Always stochastic for Gillespie.
static std::string getGillespieName()
Get the name for this integrator.
Definition: GillespieIntegrator.h:183
virtual std::string getDescription() const
Gets the description associated with this integrator type.
Definition: GillespieIntegrator.h:197
virtual Integrator * construct(ExecutableModel *model) const
Constructs a new integrator of a given type.
Definition: GillespieIntegrator.h:213
virtual std::string getName() const
Gets the name associated with this integrator type.
Definition: GillespieIntegrator.h:189
virtual std::string getHint() const
Gets the hint associated with this integrator type.
Definition: GillespieIntegrator.h:205
Definition: Integrator.h:62
Handles constructing an integrator and contains meta information about it.
Definition: Integrator.h:161
Base class for all code generators in RoadRunner.