예제 #1
0
    def prepareSimulation(self):

        import CompuCellSetup
        # CompuCellSetup.setSimulationXMLFileName(self.xmlFileName)
        (self.sim, self.simthread) = CompuCellSetup.getCoreSimulationObjects()

        import CompuCell
        CompuCellSetup.initializeSimulationObjects(self.sim, self.simthread)
        CompuCellSetup.extraInitSimulationObjects(self.sim, self.simthread)
        self.simulationInitialized = True
        self.callingWidget.sim = self.sim
예제 #2
0
 def prepareSimulation(self):
 
     import CompuCellSetup
     # CompuCellSetup.setSimulationXMLFileName(self.xmlFileName)
     (self.sim, self.simthread) = CompuCellSetup.getCoreSimulationObjects()
     
     import CompuCell         
     CompuCellSetup.initializeSimulationObjects(self.sim, self.simthread)
     CompuCellSetup.extraInitSimulationObjects(self.sim, self.simthread)
     self.simulationInitialized=True
     self.callingWidget.sim=self.sim
    def _run(self):
        """
        Start the simulation.
        """
        self.execConfig.parameterStore.addObj(self)
        for cellType in self.cellTypes:
            self.execConfig.parameterStore.addObj(cellType)

        CompuCellSetup.setSimulationXMLDescription(self._configureSimulation())
        CompuCellSetup.initializeSimulationObjects(self.sim, self.simthread)

        pyAttributeDictionaryAdder, dictAdder = CompuCellSetup.attachDictionaryToCells(self.sim)

        # Add Python steppables here:
        steppableRegistry = CompuCellSetup.getSteppableRegistry()
        for steppable in self._getSteppables():
            steppableRegistry.registerSteppable(steppable)

        CompuCellSetup.mainLoop(self.sim, self.simthread, steppableRegistry)
예제 #4
0
import sys
from os import environ
from os import getcwd
import string
from PySteppablesExamples import SimulationFileStorage

sys.path.append(environ["PYTHON_MODULE_PATH"])

import CompuCellSetup

sim, simthread = CompuCellSetup.getCoreSimulationObjects()

# Create extra player fields here or add attributes

CompuCellSetup.initializeSimulationObjects(sim, simthread)

# Add Python steppables here
steppableRegistry = CompuCellSetup.getSteppableRegistry()

from helpfile_steppables_CellDraw import HelpfileCellDrawSteppable

theHelpfileCellDrawSteppable = HelpfileCellDrawSteppable(_simulator=sim,
                                                         _frequency=100)

steppableRegistry.registerSteppable(theHelpfileCellDrawSteppable)

# sfs=SimulationFileStorage(_simulator=sim,_frequency=10)
# sfs.addFileNameToStore("examples_PythonTutorial/cellsort_2D_info_printer/cellsort_2D.xml")
# sfs.addFileNameToStore("examples_PythonTutorial/cellsort_2D_info_printer/cellsort_2D_info_printer.py")
# sfs.addFileNameToStore("examples_PythonTutorial/cellsort_2D_info_printer/cellsort_2D_steppables_info_printer.py")
# steppableRegistry.registerSteppable(sfs)
#PUT YOUR CODE HERE
#PUT YOUR CODE HERE
#PUT YOUR CODE HERE


import XMLUtils
steppableList=CompuCellSetup.cc3dXML2ObjConverter.root.getElements("Plugin")
steppableListPy=XMLUtils.CC3DXMLListPy(steppableList)

for element in steppableListPy:
    print "Element",element.name
#     ," name", element.getNumberOfChildren()



CompuCellSetup.initializeSimulationObjects(sim,simthread)


steppableRegistry=CompuCellSetup.getSteppableRegistry()
#Add Python steppables here
#PUT YOUR CODE HERE
#PUT YOUR CODE HERE
#PUT YOUR CODE HERE




# sim.ps.steppableCC3DXMLElementVector()
CompuCellSetup.mainLoop(sim,simthread,steppableRegistry)#main loop - simulation is invoked inside this function

예제 #6
0
import sys
from os import environ
from os import getcwd
import string
sys.path.append(environ["PYTHON_MODULE_PATH"])
import CompuCellSetup
sim, simthread = CompuCellSetup.getCoreSimulationObjects()
# add extra attributes here
pyAttributeDictionaryAdder, dictAdder = CompuCellSetup.attachDictionaryToCells(
    sim)
CompuCellSetup.initializeSimulationObjects(sim, simthread)
# Definitions of additional Python-managed fields go here
#Add Python steppables here
steppableRegistry = CompuCellSetup.getSteppableRegistry()
from bistabSwitch2Steppables import EMT_switch1Steppable
steppableInstance = EMT_switch1Steppable(sim, _frequency=100)
steppableRegistry.registerSteppable(steppableInstance)
CompuCellSetup.mainLoop(sim, simthread, steppableRegistry)

예제 #7
0
import sys
from os import environ
from os import getcwd
import string
sys.path.append(environ["PYTHON_MODULE_PATH"])

import CompuCellSetup

sim,simthread = CompuCellSetup.getCoreSimulationObjects()
            
# add extra attributes here
        
pyAttributeDictionaryAdder,dictAdder=CompuCellSetup.attachDictionaryToCells(sim)
            
CompuCellSetup.initializeSimulationObjects(sim,simthread)
# Definitions of additional Python-managed fields go here
        
#Add Python steppables here
steppableRegistry=CompuCellSetup.getSteppableRegistry()
        
from bistabSwitch2Steppables import EMT_switch1Steppable
steppableInstance=EMT_switch1Steppable(sim,_frequency=100)
steppableRegistry.registerSteppable(steppableInstance)
        
CompuCellSetup.mainLoop(sim,simthread,steppableRegistry)