Volume and Cell Growth ============================ Related: `Global Volume and Surface Constraints [Mathematics] `_ Relevant Examples: * `Example: Contact-Inhibited Cell Growth `_ Properties **************************** **cell.targetVolume**: the "goal" volume that a cell tries to shrink or grow to whenever possible **cell.lambdaVolume**: the strength of the volume constraint; that is, how fast a cell will shrink/grow towards its targetVolume **************************** **How to Add the Volume Plugin in XML** * As you create your simulation, check the box for either **VolumeFlex** or **VolumeLocalFlex**. * Otherwise, add in the XML manually with this button in **Twedit++**: .. image:: images/CC3DML_volume_dialog.PNG :height: 450px Your complete ``.xml`` file should look like this. Yours may have extra code, but that's fine. .. code-block:: xml 1 10 100000 10.0 1
51 0 7 CellA,CellB VolumeFlex vs VolumeLocalFlex ********************************************** VolumeFlex is designed so that lambda volume and target volume are defined in XML. When using VolumeLocalFlex, the lambda volume and target volume must be defined in Python. (The same is true for SurfaceLocalFlex, lambda surface, and target surface). **Example 1:** VolumeFlex XML .. code-block:: xml **Example 2:** (a separate project) VolumeLocalFlex XML .. code-block:: xml Python Steppable .. code-block:: python def start(self): for cell in self.cell_list: cell.targetVolume = 25 cell.lambdaVolume = 5.0 What is Lambda? ********************************************** Think of a simulation in CompuCell3D as a lazy person who wants to *minimize their energy usage* at all times, although they have a certain probability of going out of their way to do something. A lazy person may have competing interests in mind at the same time. If their "hunger" is 2 and their "sleepiness" is 100, then they will be much more likely to go to sleep than eat something. Likewise, CC3D is more likely to accept a lattice site copy attempt when the result will lower the simulation's total energy. Essentially, **lambda is a multiplier used to control a decision about the lattice**.