pep.pep.NumericalPsystem¶
-
class
pep.pep.
NumericalPsystem
[source]¶ Numerical P systems class
Variables: - H (array(str)) – array of strings (names of membranes)
- membranes (dict) – map (dictioanry) between String membrane_name: Membrane object
- structure (MembraneStructure) – MembraneStructure object (list of structural elements) [1 [2 ]2 ]1
- variables (list(Pobject)) – list of Pobjects that appear throughtout the P system
- enzymes (list(Pobject)) – list of enzyme Pobjects that appear throughtout the P system
- csvFile (file) – file used for Comma Separated Value output
Methods
__init__
()openCsvFile
()Opens a .csv (Comma Separated Value) file where the values of all variables and enzymes are printed at each simulation step print
([indentSpaces, toString, withPrograms])Print the entire Numerical P system with a given indentation level runSimulationStep
()Runs 1 simulation step consisting of executing one program (production & dispersion functions) for all membranes that have programs simulate
([stepByStepConfirm, …])Simulates the numericP system until one of the imposed limits is reached -
openCsvFile
()[source]¶ Opens a .csv (Comma Separated Value) file where the values of all variables and enzymes are printed at each simulation step The output file is named using the pattern pep_DAY-MONTH-YEAR_HOUR-MINUTE-SECOND.csv
-
print
(indentSpaces=2, toString=False, withPrograms=False)[source]¶ Print the entire Numerical P system with a given indentation level
IndentSpaces: number of spaces used for indentation ToString: write to a string instead of stdout WithPrograms: print out the programs from each membrane, along with the membrane variables Returns: string print of the membrane if toString = True otherwise returns None
-
runSimulationStep
()[source]¶ Runs 1 simulation step consisting of executing one program (production & dispersion functions) for all membranes that have programs If a membrane has more than one program, one is chosen randomly for execution
-
simulate
(stepByStepConfirm=False, printEachSystemState=True, maxSteps=-1, maxTime=-1)[source]¶ Simulates the numericP system until one of the imposed limits is reached
StepByStepConfirm: True / False - whether or not to wait for confirmation before starting the next simulation step PrintEachSystemState: True / False - whether or not to print the P system state after the execution ofeach simulation step MaxSteps: The maximmum number of simulation steps to run MaxTime: The maximum time span that the entire simulation can last