示例#1
0
        static void Main()
        {
            SimulatorController controller = new SimulatorController();

            controller.Setup();
            controller.Run();
        }
示例#2
0
        private void StartSimulation()
        {
            Thread myThread = new Thread(new ThreadStart(subjectListener));
            SimulatorController controller = new SimulatorController();

            running = true;
            myThread.Start();

            controller.Run("../../../SimulationData/Short Race Simulation-01.csv");

            myThread.Abort();
        }
示例#3
0
        private void button1_Click(object sender, EventArgs e)
        {
            List <string> checkedItems = new List <string>();

            foreach (object Item in checkedListBox1.CheckedItems)
            {
                checkedItems.Add(Item.ToString());
            }
            foreach (string Item in checkedItems)
            {
                if (Item == "Report to console")
                {
                    observersToAdd.Add(new ConsoleObserver());
                }
                else if (Item == "Report athletes in list")
                {
                    ListObserver myLO = new ListObserver();
                    observersToAdd.Add(myLO);
                    Thread myThread = new Thread(() => Application.Run(myLO));
                    myThread.Start();
                }
                else if (Item == "Report athletes on a 1D line")
                {
                    _1DLineObserver my1D = new _1DLineObserver();
                    observersToAdd.Add(my1D);

                    Thread OneDThread = new Thread(() => Application.Run(my1D));
                    OneDThread.Start();
                }
                else if (Item == "Compare 2 athletes")
                {
                    AthleteComparisonObserver myACO = new AthleteComparisonObserver();
                    observersToAdd.Add(myACO);

                    Thread ACOThread = new Thread(() => Application.Run(myACO));
                    ACOThread.Start();
                }
            }
            controller.Run($"../../../SimulationData/{myCourse.Races.ElementAt(0).Title}.csv", myCourse.Races[0], observersToAdd);
        }