Example #1
0
 public Model(Simulation simulation, Results results)
 {
     this.simulation = simulation;
     this.results = results;
     this.map = new Map();
     this.agents = new List<Agent>();
 }
Example #2
0
        public View()
        {
            InitializeComponent();

            PANEL_SIZE = panelMap.Size.Width;
            Simulation simulation = new Simulation();
            simulation.setAlgorithmType((AlgorithmType)algorithmType.SelectedIndex);
            simulation.setHeuristicMethod((Node.Method)heuristicMethod.SelectedIndex);
            simulation.set(ViewNumericUpDown.FieldOfView, FIELD_OF_VIEW_INIT);

            simulation.set(ViewNumericUpDown.NumberOfAgents, NUMBER_OF_AGENTS_INIT);
            simulation.set(ViewNumericUpDown.PercentWalkable, PERCENT_WALKABLE_INIT);
            simulation.set(ViewNumericUpDown.MaxSteps, MAX_STEPS_INIT);
            simulation.set(ViewNumericUpDown.StepDelay, STEP_DELAY_INIT);
            simulation.set(ViewNumericUpDown.MapSize, MAP_SIZE_INIT);
            simulation.setCellSize(CELL_SIZE_INT);

            Results results = new Results(this.simulationListView, new String[] {
                "Agent ID",
                "Map ID",
                "Field of View",
                "Steps",
                "Visible",
                "Visible Walkable",
                "Visible Non-Walkable",
                "Evaluated",
                "Shared",
                "Possible",
                "Success",

                "Algorithm",
                "Heuristic Method",

                "Field of View Method",
                "Cooperation",
                "Map Size",
                "% Walkalbe",
                "Agents",
            });
            Model model = new Model(simulation, results);
            controller = new Controller(model, this);

            eventHandlerInit(model);
            customViewInit(model);
        }