示例#1
0
        public override void SetupSimulation()
        {
            logFrequency        = 1;
            nbCellTypes         = 3;
            nbOfSimulationSteps = 10;

            //*
            popSize    = 148;
            popMaxSize = 343;

            Tissue        t1         = new Tissue(25, 125, new Cylinder34(new Vector(.5f, .5f, .5f)));
            Tissue        t2         = new Tissue(98, popMaxSize, new Cylinder34(new Vector(.5f, 1f, .5f)));
            Tissue        t3         = new Tissue(25, 125, new Cylinder34(new Vector(.5f, .5f, .5f)));
            List <Tissue> tissueList = new List <Tissue>()
            {
                t1, t2, t3
            };

            cellPopulation = new CellPopulation(popSize, popMaxSize, tissueList, true);
            //Helper.SetNCubedInN(125);
            //t1.PositionCells(false);
            //Helper.SetNCubedInN(popMaxSize);
            //t2.PositionCells(false, new Vector(0, t1.reference.y + t1.mesh.innerRadius.y + t2.mesh.innerRadius.y, 0));

            Helper.SetNCubedInN(popMaxSize);
            t2.PositionCells(false);
            Helper.SetNCubedInN(125);
            t1.PositionCells(false, new Vector(0, t2.reference.y - 4 * t2.mesh.innerRadius.y - t1.mesh.innerRadius.y, 0));
            Helper.SetNCubedInN(125);
            t3.PositionCells(false, new Vector(0, t2.reference.y + t3.mesh.innerRadius.y, 0));
            //*/

            nbCellTypes = tissueList.Count;
        }
示例#2
0
 public void Urbanize()
 {
     UrbanLevel++;
     if (CellPopulation.dFactor(1) > 0.5 && !Walled)
     {
         Walled = true;
     }
     if (plantLevel == 0)
     {
         farmLevel--;
     }
     else
     {
         plantLevel--;
     }
 }
示例#3
0
        public override void SetupSimulation()
        {
            logFrequency        = 1;
            logVTK              = true;
            nbOfSimulationSteps = 1000;
            popSize             = 1;
            popMaxSize          = 128;

            Tissue        t1         = new Tissue(1, popMaxSize);
            List <Tissue> tissueList = new List <Tissue>()
            {
                t1
            };

            nbCellTypes    = tissueList.Count;
            cellPopulation = new CellPopulation(popSize, popMaxSize, tissueList);

            Helper.SetNCubedInN(popMaxSize);
            cellPopulation.PositionCells(false);
        }
        public override void SetupSimulation()
        {
            nbOfSimulationSteps = 2000;
            logFrequency        = 10;
            //logVTK = true;

            popSize    = 8;
            popMaxSize = 64;

            Cylinder34 mesh = new Cylinder34(new Vector(.5f, 1f, .5f), false);

            Tissue        t1         = new Tissue(8, popMaxSize, mesh);
            List <Tissue> tissueList = new List <Tissue>()
            {
                t1
            };

            nbCellTypes    = tissueList.Count;
            cellPopulation = new CellPopulation(popSize, popMaxSize, tissueList, 2);

            Helper.SetNCubedInN(popMaxSize);
            cellPopulation.PositionCells(false);
        }
示例#5
0
        public override void SetupSimulation()
        {
            nbOfSimulationSteps = 1000;
            logFrequency        = 1;
            logVTK = false;

            popSize    = 4;
            popMaxSize = 8;

            Icosahedron42 mesh = new Icosahedron42();

            Tissue        t1         = new Tissue(4, popMaxSize, mesh);
            List <Tissue> tissueList = new List <Tissue>()
            {
                t1
            };

            nbCellTypes    = tissueList.Count;
            cellPopulation = new CellPopulation(popSize, popMaxSize, tissueList, 1);

            Helper.SetNCubedInN(popMaxSize);
            cellPopulation.PositionCells(false);
        }
示例#6
0
        public override void SetupSimulation()
        {
            nbCellTypes         = 1;
            nbOfSimulationSteps = 1000;
            popSize             = 25;
            popMaxSize          = 125;

            //Cylinder34 mesh = new Cylinder34();

            //HexagonalCylinder42 mesh = new HexagonalCylinder42(1f);

            //Console.WriteLine(mesh.innerRadius);
            Tissue        t1         = new Tissue(25, popMaxSize, new Cylinder34(new Vector(.5f, .5f, .5f)));
            List <Tissue> tissueList = new List <Tissue>()
            {
                t1
            };

            nbCellTypes    = tissueList.Count;
            cellPopulation = new CellPopulation(popSize, popMaxSize, tissueList);

            Helper.SetNCubedInN(popMaxSize);
            cellPopulation.PositionCells(false);
        }
示例#7
0
 public void Tick()
 {
     //If populated...
     if (CellPopulation.Count > 0)
     {
         CellPopulation.Tick();
         if (CellPopulation.Count < Sustainability * WorldMetrics.popRuralMultiplier)
         {
             settlingRural++;
             if (settlingRural >= WorldMetrics.popStepsRequired)
             {
                 if (PlantLevel > 0)
                 {
                     BuildFarms();
                 }
                 settlingRural = 0;
             }
         }
         if (CellPopulation.Count < (Sustainability) * WorldMetrics.popUrbanMultiplier)
         {
             settlingUrban++;
             if (settlingUrban >= WorldMetrics.popStepsRequired)
             {
                 if (PlantLevel > 0 || FarmLevel > 0)
                 {
                     Urbanize();
                 }
                 settlingUrban = 0;
             }
         }
     }
     if (CellPopulation.Count > (Sustainability) * (WorldMetrics.popUrbanMultiplier + WorldMetrics.popRuralMultiplier))
     {
         //Do stuff?
     }
 }