Пример #1
0
 //Sets up the model and factory to simulate numCells many cells with iterations many steps
 public void SetupCells(int numCells, int iterations)
 {
     cells = new List <Cell> [iterations + 1];
     for (int i = 0; i < cells.Length; i++)
     {
         cells[i] = new List <Cell>();
     }
     initalNumOfCells = numCells;
     BacteriaFactory.SetCellIterations(iterations);
     timeScaleFactor    = 1;
     cellBirthListeners = new List <ICellBirthListener>();
     allCells           = new List <Cell>();
     IterationHandler.GetInstance().Reset();
     averageLigandC = null;
 }
Пример #2
0
    // Dropdown
    private void Start()
    {
        // Create basic listeners for various elements
        simulateButton.onClick.AddListener(StartSimulation);
        i0Slider.onValueChanged.AddListener(delegate { EnvValueChanged(); });
        dSlider.onValueChanged.AddListener(delegate { EnvValueChanged(); });
        sourcesSlider.onValueChanged.AddListener(delegate { EnvValueChanged(); });
        nOfCellsSlider.onValueChanged.AddListener(delegate { CellValueChanged(); });
        nOfIterations.onValueChanged.AddListener(delegate { CellValueChanged(); });
        forwardSim.onValueChanged.AddListener(delegate { CellValueChanged(); });
        quitButton.onClick.AddListener(Quit);

        model = Model.GetInstance();

        BacteriaFactory.SetCellIterations(500);
        BacteriaFactory.SetCellDeathAndDivision(true);
        BacteriaFactory.SetCellRegulatorType(RegulatorType.ODE);

        //added just to make the program a lot less anoying to use

        createBasicEnv(i0, d);
        EnvValueChanged(); // bug fix for first value change
        CellValueChanged();
    }