NumberChem
PyCellChemistry documentation index
source code: src/NumberChem.py

#---------------------------------------------------------------------------
#
# NumberChem.py: number division chemistry, AC book ch. 2
#
# by Lidia Yamamoto, Belgium, June 2013
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# 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
sys


Classes
NumberChem


class NumberChem
Methods defined here:
__init__(self, popsize=100, minn=2, maxn=1000)
create a random soup of 'popsize' numbers ranging from 'minn'
to 'maxn'
nprimes(self)
count the number of prime numbers in the soup
run(self, niter=10000)
run 'niter' iterations of the number chemistry
trace(self, i, reaction)
print a tab-separated data line for plotting
trace_title(self)
print a tab-separated title line for plotting


Functions
isprime(n)
check if n is a prime, adapted from:
http://www.daniweb.com/software-development/python/code/216880/
check-if-a-number-is-a-prime-number-python


Generated automatically by pydoc, July 10, 2015


Generated automatically by pydoc, July 10, 2015