14 # ifndef RR_INTEGRATOR_H_
15 # define RR_INTEGRATOR_H_
19 # include "rrLogger.h"
20 # include "rrOSSpecifics.h"
21 # include "Dictionary.h"
22 # include "rrException.h"
25 # include "tr1proxy/rr_memory.h"
26 # include "tr1proxy/rr_unordered_map.h"
35 class ExecutableModel;
56 typedef cxx11_ns::shared_ptr<IntegratorListener> IntegratorListenerPtr;
69 using Solver::setValue;
71 enum IntegrationMethod {
80 virtual IntegrationMethod getIntegrationMethod()
const = 0;
89 virtual void loadConfigSettings();
91 virtual void loadSBMLSettings(
const std::string &filename);
93 virtual double integrate(
double t0,
double hstep) = 0;
95 virtual void restart(
double t0) = 0;
128 virtual void setListener(IntegratorListenerPtr) = 0;
130 virtual IntegratorListenerPtr getListener() = 0;
146 std::runtime_error(what) {
151 std::runtime_error(what +
"; In " + where) {
227 std::size_t size()
const;
229 std::string name(std::size_t n)
const;
231 std::string hint(std::size_t n)
const;
233 std::string description(std::size_t n)
const;
242 typedef std::vector<IntegratorRegistrar *> IntegratorRegistrars;
243 IntegratorRegistrars mRegisteredIntegrators;
Contains the base class for RoadRunner solvers.
Base class for all code generation systems; allows compiling and evaluating the model.
Definition: rrExecutableModel.h:118
Definition: Integrator.h:143
Constructs new integrators.
Definition: Integrator.h:200
Integrator * New(std::string name, ExecutableModel *m) const
Constructs a new integrator given the name (e.g. cvode, gillespie)
static IntegratorFactory & getInstance()
Returns the singleton instance of the integrator factory.
void registerSolver(IntegratorRegistrar *i)
Registers a new integrator with the factory so that it can be constructed.
Definition: Integrator.h:62
virtual void setIndividualTolerance(string sid, double value)
Set tolerance for floating species or variables that have a rate rule, will only be used in CVODEInte...
virtual void syncWithModel(ExecutableModel *m)
Called whenever a new model is loaded to allow integrator to reset internal state.
virtual std::string toRepr() const
Return string representation a la Python repr method.
virtual std::vector< double > getConcentrationTolerance()
Get tolerance based on concentration of species, will only be used in CVODEIntegrator.
virtual void setConcentrationTolerance(const Variant &value)
Set tolerance based on concentration of species, will only be used in CVODEIntegrator.
virtual void tweakTolerances()
Fix tolerances for SBML tests.
std::string toString() const
Return a string representation of the solver.
Definition: Integrator.h:40
virtual uint onEvent(Integrator *integrator, ExecutableModel *model, double time)=0
virtual uint onTimeStep(Integrator *integrator, ExecutableModel *model, double time)=0
Handles constructing an integrator and contains meta information about it.
Definition: Integrator.h:161
virtual std::string getHint() const =0
Gets the hint associated with this integrator type.
virtual std::string getName() const =0
Gets the name associated with this integrator type.
virtual Integrator * construct(ExecutableModel *model) const =0
Constructs a new integrator of a given type.
virtual std::string getDescription() const =0
Gets the description associated with this integrator type.
@ LOG_ERROR
A critical error. The application might not be able to continue running successfully.
Definition: rrLogger.h:65
Base class for all integrators and steady state solvers.
Definition: Solver.h:37