List of all members.
This is one of the more complex classes in NFsim. It is written in order to handle distribution of rates reactions. These types of reactions have many reactants, but each reactant can participate with a different rate. The rate is determined by the set of molecules that the reactant is connected to. Therefore, we need a tree (or we could have also used logarithmic classes) to efficiently select the next reactant weighted by each of its propensities.
A key example of this is in the chemotaxis system. Clusters of receptors influence the rate of CheA autophosphorylation.
Public Member Functions
|ReactantTree (unsigned int reactantIndex, TransformationSet *ts, unsigned int init_capacity)|
|virtual int||size () const|
|virtual MappingSet *||pushNextAvailableMappingSet ()|
|void||confirmPush (int mappingSetId, double rateFactor)|
|virtual void||popLastMappingSet ()|
|virtual void||removeMappingSet (unsigned int mappingSetId)|
|void||pickReactantFromValue (MappingSet *&ms, double value, double baseRate)|
|void||updateValue (unsigned int mappingSetId, double newRateFactor)|
|virtual MappingSet *||getMappingSet (unsigned int mappingSetId) const|
|virtual void||printDetails () const|
|double||getRateFactorSum () const|
|int||getDepthOfTree () const|
Protected Member Functions
|void||removeFromTreeOnly (int msTreeArrayPosition, unsigned int mappingSetId)|
|void||expandTree (int newCapacity)|
Create a reactant tree, based on the given transformation set (so we can create mappings at the given reactant index. The tree will be initialized such that it can immediately hold the number of objects specified by the init_capacity.
Standard deconstructor for the tree
|virtual int NFcore::ReactantTree::size||(||)|| const
Returns the number of mappingSets that have been added to this tree
|MappingSet * ReactantTree::pushNextAvailableMappingSet||(||)||
Adds a new MappingSet to this tree and returns a pointer to the new mapping set for you to map (usually by comparing to some template molecule). Warning: even if you don't use this mapping set, it will be counted until you pop it or remove it! (see removeMappingSet()). This has a special behavior in the ReactantTree. This method merely gets you a pointer to the next available mappingset: if you decide to keep the mapping, you have to confirm it. Confirming the mapping actually places it in the tree. If you don't do this, it won't ever be selected by the tree.
Once you have pushed on the next available mappingSet, you have to confirm that push. In the event that mappingsets are cloned, this will confirm all mappingsets that have been cloned off of the given mapping set.
Removes the very last mappingSet that was added to the list. You should actually now use the removeMappingSet function instead, just to be careful.
|void ReactantTree::removeMappingSet||(||unsigned int||mappingSetId||)||
Removes the mapping set with the specified mappingSetId. Be careful here: make sure the mapping set is actually on the list before trying to remove or else this will give you an error!
|void ReactantTree::pickReactantFromValue||(||MappingSet *&||ms,|
This is the key utility of a reactant tree: given a random value, we can select the next reactant to fire with this function that weights the selection of any particular reactant by
|void ReactantTree::updateValue||(||unsigned int||mappingSetId,|
When a local function value changes, it must update the value in the reactant tree. This method allows you to update values without changing the mappingSet membership of this tree.
|MappingSet * ReactantTree::getMappingSet||(||unsigned int||mappingSetId||)|| const
|void ReactantTree::printDetails||(||)|| const
Outputs basic details about this tree - used only for debugging, because it really does print out everything
|double NFcore::ReactantTree::getRateFactorSum||(||)|| const
Returns the combined rate factor sum of this tree, which is needed by the DOR reactionclass in order to properly update its propensity
|int NFcore::ReactantTree::getDepthOfTree||(||)|| const
Returns the depth of the tree (which you shouldn't ever really need...)
Removes a mapping set from the tree only. This method should only be used by the tree!
If we try to add more than this tree can handle, we have to expand it. Because the tree is a complete binary tree, this will necessarily double its capacity, or enlarge it more depending on the given new capacity.
Take special precaution here!! we don't want to actually reallocate the mappingSets! because then we would have to recompare each molecule to this template again! Instead, we will initialze only the end of this array, and fill in the rest of the array with the original elements, putting them in the proper position based on their id
|unsigned int NFcore::ReactantTree::reactantIndex
|unsigned int NFcore::ReactantTree::firstMappingTreeIndex