Ejemplo n.º 1
0
        public bool NextStep()
        {
            switch (status)
            {
            case SimulationStatus.Growthing:
                status = Growth();
                break;

            case SimulationStatus.EndGrowth:
                status = StartRecrystallization();
                return(false);

            case SimulationStatus.Recrystallizationing:
                status = Recrystallization();
                break;

            case SimulationStatus.MC:
                MCIteration();
                break;

            case SimulationStatus.EndMC:
            case SimulationStatus.EndRecrystallization:
                return(false);
            }

            return(true);
        }
Ejemplo n.º 2
0
        public SimulationStatusChangedEventArgs(SimulationStatus status)
        {
            //logger.Info("Inicio Estado de simulación cambiando Args de evento");
            this.Status = status;

            //logger.Info("Fin Estado de simulación cambiando Args de evento");
        }
Ejemplo n.º 3
0
 public void ChangeStatus(SimulationStatus status)
 {
     try
     {
         //logger.Info("Inicio Cambiar de estado");
         this.SimulationStatusChanged(this, new SimulationStatusChangedEventArgs(status));
         this.simulationStatus = status;
         //logger.Info("Fin Cambiar de estado");
     }
     catch (Exception ex)
     {
         logger.Error(ex.Source + " - " + ex.Message + ": " + ex.StackTrace);
         throw ex;
     }
 }
Ejemplo n.º 4
0
        public void StartMC(int seeds, int width, int height)
        {
            this.width  = (width += 2);
            this.height = (height += 2);
            mapController.CreateNewMap(width, height, BoundaryValue.Periodic);

            seedColorsMC = new List <Color>();
            while (seeds-- > 0)
            {
                seedColorsMC.Add(GenerateColor());
            }
            for (int x = 1; x < width - 1; x++)
            {
                for (int y = 1; y < height - 1; y++)
                {
                    mapController.SetPixesl(x, y, seedColorsMC[random.Next(seedColorsMC.Count)]);
                }
            }
            mapController.Commit();
            status = SimulationStatus.MC;
        }
Ejemplo n.º 5
0
        protected IEnumerator breedingCoroutine()
        {
            status = SimulationStatus.Busy;

            status = SimulationStatus.Simulating;
            yield break;
        }
Ejemplo n.º 6
0
        protected IEnumerator simulationCoroutine()
        {
            status = SimulationStatus.Busy;

            for (int i = 0; i < WORKER_COUNT; i++)
            {
                workers[i].shutDown = false;
                workerThreads[i].Start();
            }
            yield return new WaitForSeconds(SIMULATION_TIME);

            for (int i = 0; i < WORKER_COUNT; i++)
            {
                workers[i].shutDown = true;
            }
            for (int i = 0; i < WORKER_COUNT; i++)
            {
                workerThreads[i].Join();
            }

            status = SimulationStatus.Evaluating;
            yield break;
        }