Lattice Microbes 2.5
This is for whole cell modeling
Loading...
Searching...
No Matches
NextReactionSolver.h
Go to the documentation of this file.
1/*
2 * University of Illinois Open Source License
3 * Copyright 2010-2018 Luthey-Schulten Group,
4 * All rights reserved.
5 *
6 * Developed by: Luthey-Schulten Group
7 * University of Illinois at Urbana-Champaign
8 * http://www.scs.uiuc.edu/~schulten
9 *
10 * Permission is hereby granted, free of charge, to any person obtaining a copy of
11 * this software and associated documentation files (the Software), to deal with
12 * the Software without restriction, including without limitation the rights to
13 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
14 * of the Software, and to permit persons to whom the Software is furnished to
15 * do so, subject to the following conditions:
16 *
17 * - Redistributions of source code must retain the above copyright notice,
18 * this list of conditions and the following disclaimers.
19 *
20 * - Redistributions in binary form must reproduce the above copyright notice,
21 * this list of conditions and the following disclaimers in the documentation
22 * and/or other materials provided with the distribution.
23 *
24 * - Neither the names of the Luthey-Schulten Group, University of Illinois at
25 * Urbana-Champaign, nor the names of its contributors may be used to endorse or
26 * promote products derived from this Software without specific prior written
27 * permission.
28 *
29 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
32 * THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
33 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
34 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
35 * OTHER DEALINGS WITH THE SOFTWARE.
36 *
37 * Author(s): Elijah Roberts
38 */
39
40#ifndef LM_CME_NEXTREACTIONSOLVER_H_
41#define LM_CME_NEXTREACTIONSOLVER_H_
42
43#include <map>
44#include <list>
45#include <string>
46#include "cme/CMESolver.h"
47#include "FirstPassageTimes.pb.h"
50#include "rng/RandomGenerator.h"
51
52using std::map;
53using std::list;
54using std::string;
58
59namespace lm {
60namespace cme {
61
63{
64public:
67 virtual ~NextReactionSolver();
68 virtual bool needsReactionModel() {return true;}
69 virtual bool needsDiffusionModel() {return false;}
70 virtual void buildModel(const uint numberSpecies, const uint numberReactions, const uint * initialSpeciesCounts, const uint * reactionType, const double * k, const int * S, const uint * D, const uint kCols=1);
71 virtual void generateTrajectory();
72
73protected:
74 virtual void destroyModel();
75 inline int updateAllReactionEvents(double time, int rngNext, double * expRngValues);
76 inline int updateReactionEvents(uint sourceReaction, double time, int rngNext, double * expRngValues);
77
78protected:
80
81protected:
82 virtual int hookSimulation(double time);
83};
84
85}
86}
87
88#endif
unsigned int uint
Definition Types.h:52
Distributions
Types of random number generators that are allowed.
Definition RandomGenerator.h:56
uint numberReactions
Definition CMESolver.h:273
RandomGenerator::Distributions neededDists
Definition CMESolver.h:264
int * S
Definition CMESolver.h:277
CMESolver(RandomGenerator::Distributions neededDists)
Definition CMESolver.cpp:74
uint * initialSpeciesCounts
Definition CMESolver.h:274
uint * D
Definition CMESolver.h:278
virtual void destroyModel()
Definition NextReactionSolver.cpp:99
int updateReactionEvents(uint sourceReaction, double time, int rngNext, double *expRngValues)
Definition NextReactionSolver.cpp:394
NextReactionSolver()
Definition NextReactionSolver.cpp:79
virtual void buildModel(const uint numberSpecies, const uint numberReactions, const uint *initialSpeciesCounts, const uint *reactionType, const double *k, const int *S, const uint *D, const uint kCols=1)
Definition NextReactionSolver.cpp:91
virtual void generateTrajectory()
Actually run the simulation.
Definition NextReactionSolver.cpp:107
virtual int hookSimulation(double time)
Definition NextReactionSolver.cpp:438
ReactionQueue * reactionQueue
Definition NextReactionSolver.h:79
virtual ~NextReactionSolver()
Definition NextReactionSolver.cpp:87
virtual bool needsReactionModel()
Tells whether the solver needs a reaction model.
Definition NextReactionSolver.h:68
int updateAllReactionEvents(double time, int rngNext, double *expRngValues)
Definition NextReactionSolver.cpp:372
virtual bool needsDiffusionModel()
Tells whether the solver needs a reaction model.
Definition NextReactionSolver.h:69
An object that tracks the available resources for the main simulation runner.
Definition ResourceAllocator.h:57
A queue that contains information on reaction events.
Definition ReactionQueue.h:51
Base class for random number generators in Lattice Microbes.
Definition RandomGenerator.h:51
uint numberSpecies
Definition lm_setp.cpp:72
Definition CMESolver.cpp:72
Definition Capsule.cpp:46