#include <RateTerm.h>
Public Member Functions | |
ZeroOrder (double k) | |
double | operator() (const double *S) const |
Computes the rate. The argument is the molecule array. | |
void | setK (double k) |
void | setRates (double k1, double k2) |
void | setR1 (double k1) |
Used by Zombie to assign rate terms. | |
void | setR2 (double k2) |
Used by Zombie to assign rate terms. | |
double | getR1 () const |
Used by Zombie to return rate terms. | |
double | getR2 () const |
Used by Zombie to return rate terms. | |
unsigned int | getReactants (vector< unsigned int > &molIndex) const |
void | rescaleVolume (short comptIndex, const vector< short > &compartmentLookup, double ratio) |
RateTerm * | copyWithVolScaling (double vol, double sub, double prd) const |
Protected Attributes | |
double | k_ |
ZeroOrder::ZeroOrder | ( | double | k | ) | [inline] |
References k_.
Referenced by copyWithVolScaling().
RateTerm* ZeroOrder::copyWithVolScaling | ( | double | vol, | |
double | sub, | |||
double | prd | |||
) | const [inline, virtual] |
Duplicates rate term and then applies volume scaling. Arguments are volume of reference voxel, product of vol/refVol for all substrates: applied to R1 product of vol/refVol for all products: applied to R2
Note that unless the reaction is cross-compartment, the vol/refVol will be one.
Implements RateTerm.
Reimplemented in Flux, FirstOrder, SecondOrder, StochSecondOrderSingleSubstrate, NOrder, and StochNOrder.
References k_, and ZeroOrder().
Referenced by BidirectionalReaction::copyWithVolScaling().
double ZeroOrder::getR1 | ( | ) | const [inline, virtual] |
Used by Zombie to return rate terms.
Implements RateTerm.
References k_.
Referenced by BidirectionalReaction::getR1(), and BidirectionalReaction::getR2().
double ZeroOrder::getR2 | ( | ) | const [inline, virtual] |
Used by Zombie to return rate terms.
Implements RateTerm.
unsigned int ZeroOrder::getReactants | ( | vector< unsigned int > & | molIndex | ) | const [inline, virtual] |
This function finds the reactant indices in the vector S. It returns the number of substrates found, which are the first entries in molIndex. The products are the remaining ones. Note that it does NOT find products for unidirectional reactions, which is a bit of a problem.
Implements RateTerm.
Reimplemented in Flux, FirstOrder, SecondOrder, StochSecondOrderSingleSubstrate, and NOrder.
Referenced by BidirectionalReaction::getReactants().
double ZeroOrder::operator() | ( | const double * | S | ) | const [inline, virtual] |
Computes the rate. The argument is the molecule array.
Implements RateTerm.
Reimplemented in Flux, FirstOrder, SecondOrder, StochSecondOrderSingleSubstrate, NOrder, and StochNOrder.
References k_.
void ZeroOrder::rescaleVolume | ( | short | comptIndex, | |
const vector< short > & | compartmentLookup, | |||
double | ratio | |||
) | [inline, virtual] |
This is used to rescale the RateTerm kinetics when the compartment volume changes. This is needed because the kinetics are in extensive units, that is, mol numbers, rather than in intensive units like concentration. So when the volume changes the rate terms change. Each Rate term checks if any of its reactant molecules are affected, and if so, rescales. Ratio is newVol / oldVol
Implements RateTerm.
Reimplemented in Flux, FirstOrder, SecondOrder, StochSecondOrderSingleSubstrate, and NOrder.
Referenced by BidirectionalReaction::rescaleVolume().
void ZeroOrder::setK | ( | double | k | ) | [inline] |
References k_.
Referenced by BidirectionalReaction::setR1(), setR1(), BidirectionalReaction::setR2(), BidirectionalReaction::setRates(), and setRates().
void ZeroOrder::setR1 | ( | double | k1 | ) | [inline, virtual] |
void ZeroOrder::setR2 | ( | double | k2 | ) | [inline, virtual] |
Used by Zombie to assign rate terms.
Implements RateTerm.
void ZeroOrder::setRates | ( | double | k1, | |
double | k2 | |||
) | [inline, virtual] |
double ZeroOrder::k_ [protected] |
Referenced by StochNOrder::copyWithVolScaling(), NOrder::copyWithVolScaling(), StochSecondOrderSingleSubstrate::copyWithVolScaling(), SecondOrder::copyWithVolScaling(), FirstOrder::copyWithVolScaling(), Flux::copyWithVolScaling(), copyWithVolScaling(), getR1(), NOrder::operator()(), StochSecondOrderSingleSubstrate::operator()(), SecondOrder::operator()(), FirstOrder::operator()(), Flux::operator()(), operator()(), StochNOrder::operator()(), NOrder::rescaleVolume(), StochSecondOrderSingleSubstrate::rescaleVolume(), SecondOrder::rescaleVolume(), setK(), and ZeroOrder().