# Path: stochpy/implementations/StochPyTools.py
# class Species():
# class StochPySSA_Shared(): 
#     def __init__(self):
#     def Parse(self,model_file,model_dir,IsTauleaping=False,IsNRM=False,IsDelayed = False,IsSMM = False,IsQuiet=False):
#     def SpeciesSelection(self):
#     def RateSelection(self):
#     def SetEvents(self):
#     def Propensities(self,IsTauleaping=False):
#     def BuildPropensityCodes(self, propensities = None): # 21-11-2013 
#     def HandleEvents(self,IsTauleapingStep=False):    
#     def AssignmentRules(self):
#     def rateFunc(self,rate_eval_code,r_vec):
#     def Initial_Conditions(self,IsTauleaping = False):              
#     def GenerateOutput(self,IsTauleaping = False,completion_delayed = False):


import sys,copy,time,os,operator
from .StochPyTools import __species__,StochPySSA_Shared,np
#! /usr/bin/env python
"""
Direct Method
=============
This module performs the Direct Stochastic Simulation Algorithm from Gillespie (1977) [1].

This algorithm is used to generate exact realizations of the Markov jump process. Of course, the algorithm is stochastic, so these realizations are different for each run.

Only molecule populations are specified. Positions and velocities, such as in Molecular Dynamics (MD) are ignored. This makes the algorithm much faster, because non-reactive molecular collisions can be ignored.different
Still, this exact SSA is quite slow, because it insists on simulating every individual reaction event, which takes a lot of time if the reactant population is large. Furthermore, even larger problems arise if the model contains distinct processes operating on different time scales [2].

[1] Gillespie D.T (1977), "Exact stochastic simulation of coupled chemical reactions", J.Phys. Chem. 81:2340-2361
[2] Wilkinson D.J (2009), "Stochastic Modelling for quantitative description of heterogeneous biological systems", Nat Rev Genet; 0(2):122-133 

Written by T.R. Maarleveld, Amsterdam, The Netherlands
E-mail: tmd200@users.sourceforge.net
Last Change: June 23, 2015
"""

from __future__ import division, print_function, absolute_import

__doc__ = """
          Direct Method
          =============

# Path: stochpy/implementations/StochPyTools.py
# class Species():
# class StochPySSA_Shared(): 
#     def __init__(self):
#     def Parse(self,model_file,model_dir,IsTauleaping=False,IsNRM=False,IsDelayed = False,IsSMM = False,IsQuiet=False):
#     def SpeciesSelection(self):
#     def RateSelection(self):
#     def SetEvents(self):
#     def Propensities(self,IsTauleaping=False):
#     def BuildPropensityCodes(self, propensities = None): # 21-11-2013 
#     def HandleEvents(self,IsTauleapingStep=False):    
#     def AssignmentRules(self):
#     def rateFunc(self,rate_eval_code,r_vec):
#     def Initial_Conditions(self,IsTauleaping = False):              
#     def GenerateOutput(self,IsTauleaping = False,completion_delayed = False):


# Path: stochpy/implementations/DirectMethod.py
import sys,copy,time,os,operator
from .StochPyTools import __species__,StochPySSA_Shared,np

#! /usr/bin/env python
"""
Direct Method
=============
This module performs the Direct Stochastic Simulation Algorithm from Gillespie (1977) [1].

This algorithm is used to generate exact realizations of the Markov jump process. Of course, the algorithm is stochastic, so these realizations are different for each run.

Only molecule populations are specified. Positions and velocities, such as in Molecular Dynamics (MD) are ignored. This makes the algorithm much faster, because non-reactive molecular collisions can be ignored.different
Still, this exact SSA is quite slow, because it insists on simulating every individual reaction event, which takes a lot of time if the reactant population is large. Furthermore, even larger problems arise if the model contains distinct processes operating on different time scales [2].

[1] Gillespie D.T (1977), "Exact stochastic simulation of coupled chemical reactions", J.Phys. Chem. 81:2340-2361
[2] Wilkinson D.J (2009), "Stochastic Modelling for quantitative description of heterogeneous biological systems", Nat Rev Genet; 0(2):122-133 

Written by T.R. Maarleveld, Amsterdam, The Netherlands
E-mail: tmd200@users.sourceforge.net
Last Change: June 23, 2015
"""

from __future__ import division, print_function, absolute_import

__doc__ = """
          Direct Method
          =============

          This program performs the direct Stochastic Simulation Algorithm from Gillespie (1977) [1].This algorithm is used to generate exact realizations of the Markov jump process. Of course, the algorithm is stochastic, so these realizations are different for each run.