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

#---------------------------------------------------------------------------
#
# KeyMultiset: a multiset indexed by a given key.
#
# the key is usually a substring of the molecule, akin to a binding site,
# but it can also be a shorter tag that is computed from the information
# within the molecule
#
# by Lidia Yamamoto, Belgium, October 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
KeyMultiset


class KeyMultiset
Methods defined here:
__init__(self)
initialize empty multiset
empty(self)
true if this multiset is empty
expel(self, key, mol, mult=1)
expel a given amount of a molecule from the multiset
expelrnd(self, key)
expel a random molecule with given key
inject(self, key, mol, mult=1)
inject a given amount of a molecule in the multiset,
indexed by the provided key
keys(self)
list of keys used to index molecules in the key multiset
mult(self, mol='')
multiplicity: number of molecules of species 'mol' present
in the multiset (regardless of key)
multk(self, key)
number of molecules (multiplicity) with the given key
nmolecules(self)
total number of molecules in the multiset
nspecies(self)
number of distinct molecular species in the multiset
rndmol(self, key)
peek at a random molecule with given key, without removing it
trace(self)
print the multiset object (typically for debug purposes)


Generated automatically by pydoc, July 10, 2015