HighOrderChem
PyCellChemistry documentation index
/Users/lidia/main/research/acbook/web/website/ac-home/pycellchem/pycellchem-2.0/src/HighOrderChem.py

#---------------------------------------------------------------------------
#
# HighOrderChem.py:
#
# a simplified high-order chemistry in which the rules are written as
# strings containing a python method call. these strings are inserted
# into a multiset of rules that can in principle be operated upon like
# other multisets of molecules, although at this stage this is not
# done yet.
#
# - rules must have the form function(args), where function is a python
# function call and args are the parameters for the function
# - rules must return a list of products of the chemical reaction
#
# by Lidia Yamamoto, Belgium, May 2014
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# Copyright (C) 2015 Lidia A. R. Yamamoto
# Contact: http://www.artificial-chemistries.org/
#
# This file is part of PyCellChemistry.
#
# PyCellChemistry is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 3, as published by the Free Software Foundation.
#
# PyCellChemistry is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with PyCellChemistry, see file COPYING. If not, see
# http://www.gnu.org/licenses/
#


Modules
numpy
re
sys


Classes
HighOrderChem


class HighOrderChem
Methods defined here:
__init__(self)
initialize empty data and rule multisets
is_effective(self, educts, products)
true if the reaction defined by educts --> products is
effective, that is the product multiset is different from the
educt multiset
isrule(self, mol)
true if molecule 'mol' contains a reaction rule of the form
function(args), where function is a python function call
and args are the parameters for the function
iterate(self)
run one iteration of high-order algorithm: pick a random
reaction rule, fill its binding sites with as many molecules
as needed, and fire it.
returns a triple (r, e, p) where r is the rule that has
been fired, 'e' is the educt list and 'p' is the product
list


Generated automatically by pydoc, July 10, 2015