roadrunner  2.6.0
Fast simulator for SBML models
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
rr::Solver Class Referenceabstract

Base class for all integrators and steady state solvers. More...

#include <Solver.h>

Inheritance diagram for rr::Solver:
rr::Registrable rr::Integrator rr::SensitivitySolver rr::SteadyStateSolver rr::CVODEIntegrator rr::EulerIntegrator rr::GillespieIntegrator rr::RK45Integrator rr::RK4Integrator rr::SteadyStateSensitivitySolver rr::TimeSeriesSensitivitySolver rr::KinsolSteadyStateSolver rr::NLEQSolver rr::SteadyStateSolverDecorator

Public Types

using SettingsList = std::vector< std::string >
 
using SettingsMap = std::unordered_map< std::string, Setting >
 
using DisplayNameMap = std::unordered_map< std::string, std::string >
 
using HintMap = std::unordered_map< std::string, std::string >
 
using DescriptionMap = std::unordered_map< std::string, std::string >
 

Public Member Functions

 Solver (ExecutableModel *model)
 
void updateSettings (Dictionary *inputSettings)
 Update settings values. More...
 
std::vector< std::string > getSettings () const
 Get a list of all settings for this solver. More...
 
std::unordered_map< std::string, Setting > & getSettingsMap ()
 get settings for this solver More...
 
virtual void resetSettings ()
 Reset all settings to their respective default values.
 
virtual Setting getValue (const std::string &key) const
 Get the value of an integrator setting. More...
 
virtual Setting hasValue (const std::string &key) const
 Return true if this setting is supported by the integrator. More...
 
virtual size_t getNumParams () const
 Get the number of parameters. More...
 
virtual std::string getParamName (size_t n) const
 Get the name of the parameter at index n. More...
 
virtual std::string getParamDisplayName (int n) const
 Get the display name of the parameter at index n. More...
 
virtual std::string getParamHint (int n) const
 Get the hint of the parameter at index n. More...
 
virtual std::string getParamDesc (int n) const
 Get the description of the parameter at index n. More...
 
virtual std::string getValueAsString (const std::string &key)
 Wrapper for getValue which converts output to a specific type. More...
 
virtual void setValue (const std::string &key, Setting value)
 
virtual std::string getSettingsRepr () const
 Get the solver settings as a std::string. More...
 
virtual std::string settingsPyDictRepr () const
 Python dictionary-style std::string representation of settings. More...
 
virtual std::string toString () const
 Return a std::string representation of the solver. More...
 
virtual std::string toRepr () const
 Return std::string representation a la Python repr method. More...
 
const std::string & getDisplayName (const std::string &key) const
 Gets the hint associated with a given key. More...
 
const std::string & getHint (const std::string &key) const
 Gets the hint associated with a given key. More...
 
const std::string & getDescription (const std::string &key) const
 Gets the description associated with a given key. More...
 
Setting::TypeId getType (const std::string &key) const
 Gets the type associated with a given key. More...
 
virtual void syncWithModel (ExecutableModel *m)=0
 Called whenever a new model is loaded to allow integrator to reset internal state. More...
 
virtual ExecutableModelgetModel () const
 returns the pointer to the ExecutableModel
 
virtual std::string getName () const=0
 Gets the name associated with this Solver type. More...
 
virtual std::string getHint () const=0
 Gets the hint associated with this Solver type. More...
 
virtual std::string getDescription () const=0
 Gets the description associated with this Solver type. More...
 
- Public Member Functions inherited from rr::Registrable
virtual std::string getName () const =0
 Gets the name associated with this Solver type. More...
 
virtual std::string getDescription () const =0
 Gets the description associated with this Solver type. More...
 
virtual std::string getHint () const =0
 Gets the hint associated with this Solver type. More...
 
virtual Solverconstruct (ExecutableModel *model) const =0
 Constructs a new Solver of a given type. More...
 

Public Attributes

SettingsList sorted_settings
 
SettingsMap settings
 
DisplayNameMap display_names_
 
HintMap hints
 
DescriptionMap descriptions
 

Protected Member Functions

void addSetting (const std::string &name, const Setting &val, const std::string &display_name, const std::string &hint, const std::string &description)
 

Protected Attributes

ExecutableModelmModel = nullptr
 non-owning pointer to model
 

Detailed Description

Base class for all integrators and steady state solvers.

Author
JKM

Member Function Documentation

◆ getDescription() [1/2]

virtual std::string rr::Registrable::getDescription

Gets the description associated with this Solver type.

Author
JKM, WBC

◆ getDescription() [2/2]

const std::string & rr::Solver::getDescription ( const std::string &  key) const

Gets the description associated with a given key.

Author
WBC

◆ getDisplayName()

const std::string & rr::Solver::getDisplayName ( const std::string &  key) const

Gets the hint associated with a given key.

Author
WBC

◆ getHint() [1/2]

virtual std::string rr::Registrable::getHint

Gets the hint associated with this Solver type.

Author
JKM, WBC

◆ getHint() [2/2]

const std::string & rr::Solver::getHint ( const std::string &  key) const

Gets the hint associated with a given key.

Author
WBC

◆ getName()

virtual std::string rr::Registrable::getName

Gets the name associated with this Solver type.

Author
JKM, WBC

◆ getNumParams()

size_t rr::Solver::getNumParams ( ) const
virtual

Get the number of parameters.

Author
JKM

◆ getParamDesc()

std::string rr::Solver::getParamDesc ( int  n) const
virtual

Get the description of the parameter at index n.

Author
JKM

◆ getParamDisplayName()

std::string rr::Solver::getParamDisplayName ( int  n) const
virtual

Get the display name of the parameter at index n.

Author
JKM

◆ getParamHint()

std::string rr::Solver::getParamHint ( int  n) const
virtual

Get the hint of the parameter at index n.

Author
JKM

◆ getParamName()

std::string rr::Solver::getParamName ( size_t  n) const
virtual

Get the name of the parameter at index n.

Author
JKM

◆ getSettings()

std::vector< std::string > rr::Solver::getSettings ( ) const

Get a list of all settings for this solver.

Author
JKM

◆ getSettingsMap()

std::unordered_map< std::string, Setting > & rr::Solver::getSettingsMap ( )

get settings for this solver

Returns
mapping of keys which are setting names to values stored as Variants.
See also
getSettings

◆ getSettingsRepr()

std::string rr::Solver::getSettingsRepr ( ) const
virtual

Get the solver settings as a std::string.

Author
JKM

◆ getType()

Setting::TypeId rr::Solver::getType ( const std::string &  key) const

Gets the type associated with a given key.

Author
WBC

◆ getValue()

Setting rr::Solver::getValue ( const std::string &  key) const
virtual

Get the value of an integrator setting.

Author
JKM, WBC
Note
Use one of the type-concrete versions like getValueAsInt to avoid type conversion gotchas

◆ getValueAsString()

std::string rr::Solver::getValueAsString ( const std::string &  key)
virtual

Wrapper for getValue which converts output to a specific type.

Author
WBC, JKM

◆ hasValue()

Setting rr::Solver::hasValue ( const std::string &  key) const
virtual

Return true if this setting is supported by the integrator.

Author
JKM

◆ settingsPyDictRepr()

std::string rr::Solver::settingsPyDictRepr ( ) const
virtual

Python dictionary-style std::string representation of settings.

Author
JKM

◆ syncWithModel()

virtual void rr::Solver::syncWithModel ( ExecutableModel m)
pure virtual

Called whenever a new model is loaded to allow integrator to reset internal state.

Author
JKM

Implemented in rr::SteadyStateSolverDecorator, rr::RK4Integrator, rr::NLEQSolver, rr::KinsolSteadyStateSolver, rr::GillespieIntegrator, rr::CVODEIntegrator, rr::RK45Integrator, rr::Integrator, and rr::ForwardSensitivitySolver.

◆ toRepr()

std::string rr::Solver::toRepr ( ) const
virtual

Return std::string representation a la Python repr method.

Author
JKM

Reimplemented in rr::SteadyStateSolver, rr::ForwardSensitivitySolver, rr::EulerIntegrator, and rr::Integrator.

◆ toString()

std::string rr::Solver::toString ( ) const
virtual

Return a std::string representation of the solver.

Author
JKM

Reimplemented in rr::SteadyStateSolver, rr::ForwardSensitivitySolver, rr::EulerIntegrator, and rr::Integrator.

◆ updateSettings()

void rr::Solver::updateSettings ( Dictionary inputSettings)

Update settings values.

update the values of keys in

Parameters
inputSettingswith the values. Keys that are not in Solver are ignored

The documentation for this class was generated from the following files: