Attachment 'RountreeInitializerPresentation.py'
Download 1 def configureSimulation(sim):
2 import CompuCellSetup
3 from XMLUtils import ElementCC3D
4
5 cc3d=ElementCC3D("CompuCell3D")
6 potts=cc3d.ElementCC3D("Potts")
7 potts.ElementCC3D("Dimensions",{"x":100,"y":100,"z":1})
8 potts.ElementCC3D("Steps",{},1000000)
9 potts.ElementCC3D("Anneal",{},10)
10 potts.ElementCC3D("DebugOutputFrequency",{},0)
11 potts.ElementCC3D("Temperature",{},10)
12 potts.ElementCC3D("LatticeType",{},"Hexagonal")
13 potts.ElementCC3D("NeighborOrder",{},2)
14
15
16 cellType=cc3d.ElementCC3D("Plugin",{"Name":"CellType"})
17 cellType.ElementCC3D("CellType", {"TypeName":"Medium", "TypeId":"0"})
18 cellType.ElementCC3D("CellType", {"TypeName":"CellOfType1", "TypeId":"1"})
19 cellType.ElementCC3D("CellType", {"TypeName":"Apoptotic", "TypeId":"2"})
20
21
22 volume=cc3d.ElementCC3D("Plugin",{"Name":"Volume"})
23
24 surface=cc3d.ElementCC3D("Plugin",{"Name":"Surface"})
25
26 cc3d.ElementCC3D("Plugin",{"Name":"NeighborTracker"})
27
28
29 contact=cc3d.ElementCC3D("Plugin",{"Name":"Contact"})
30 contact.ElementCC3D("Energy", {"Type1":"Medium", "Type2":"Medium"},0)
31 contact.ElementCC3D("Energy", {"Type1":"CellOfType1", "Type2":"CellOfType1"},15)
32 contact.ElementCC3D("Energy", {"Type1":"CellOfType1", "Type2":"Medium"},15)
33 contact.ElementCC3D("Energy",{"Type1":"CellOfType1", "Type2":"Apoptotic"},5)
34 contact.ElementCC3D("Energy", {"Type1":"Apoptotic", "Type2":"Medium"},7)
35 contact.ElementCC3D("Energy", {"Type1":"Apoptotic", "Type2":"Apoptotic"},25)
36 contact.ElementCC3D("NeighborOrder", {}, 2)
37
38
39 blobInitializer=cc3d.ElementCC3D("Steppable",{"Type":"BlobInitializer"})
40
41 blobInitializer.ElementCC3D("Width",{},5)
42 blobInitializer.ElementCC3D("Radius",{},40)
43
44
45 CompuCellSetup.setSimulationXMLDescription(cc3d)
46
47 import sys
48 from os import environ
49 import string
50 sys.path.append(environ["PYTHON_MODULE_PATH"])
51
52 import CompuCellSetup
53
54 ##CompuCellSetup.simulationPaths.simulationPythonScriptName = "something"
55 sim,simthread = CompuCellSetup.getCoreSimulationObjects()
56 configureSimulation(sim)
57
58 import CompuCell
59 CompuCellSetup.initializeSimulationObjects(sim,simthread)
60
61
62 pyAttributeAdderDict,dictAdder=CompuCellSetup.attachDictionaryToCells(sim)
63
64 from PySteppables import SteppableRegistry
65 steppableRegistry=SteppableRegistry()
66
67 from SteppablePresentation import CellPropertyandModifier
68 steppableRegistry.registerSteppable(CellPropertyandModifier(_simulator=sim,_frequency=500))
69
70 ##from SteppablePresentation import CellTypeVisualizer
71 ##steppableRegistry.registerSteppable(CellTypeVisualizer(_simulator=sim,_frequency=1))
72 ##
73 ##from SteppablePresentation import Output
74 ##steppableRegistry.registerSteppable(Output(_simulator=sim,_frequency=5))
75 ##
76 ##from SteppablePresentation import ApoptosisCheck
77 ##steppableRegistry.registerSteppable(ApoptosisCheck(_simulator=sim,_frequency=1))
78 ##
79 ##from SteppablePresentation import Apoptosis
80 ##steppableRegistry.registerSteppable(Apoptosis(_simulator=sim,_frequency=1))
81 ##
82 ##from SteppablePresentation import PropertySwitcher
83 ##steppableRegistry.registerSteppable(PropertySwitcher(_simulator=sim,_frequency=1))
84 ##
85 ##from SteppablePresentation import MassConservationViaMacrophage
86 ##steppableRegistry.registerSteppable(MassConservationViaMacrophage(_simulator=sim,_frequency=5))
87 ##
88 ##from SteppablePresentation import Mitosis
89 ##steppableRegistry.registerSteppable(Mitosis(_simulator=sim,_frequency=10))
90
91
92 CompuCellSetup.mainLoop(sim,simthread,steppableRegistry)
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.