Example #1
0
        private void ResetSimulationButton_Click(object sender, EventArgs e)
        {
            if (Simulation == null)
            {
                return;
            }

            if (int.TryParse(RandomSeedCombo.Text, out int seed))
            {
                Simulation.ReseedRandoms(seed);
            }
            else
            {
                Simulation.ReseedRandoms();
            }

            Simulation.ResetAgents(EditingProject.KB);

            ScenarioRenderingBox.Refresh();

            LogsTreeView.Nodes.Clear();
            LogDetailTextBox.Text = "";

            AbsoluteTime = 0.0f;
        }
        private void ResetSimulationButton_Click(object sender, EventArgs e)
        {
            if (Simulation == null)
            {
                return;
            }

            foreach (var agent in Simulation.Agents)
            {
                agent.Position = agent.StartPosition;

                agent.GenerateStartProperties(EditProject.KB);
                agent.Properties = new Dictionary <string, double>();
                foreach (var kvp in agent.StartProperties)
                {
                    agent.Properties.Add(kvp.Key, kvp.Value);
                }
            }

            ScenarioRenderingBox.Refresh();

            LogsTreeView.Nodes.Clear();
            LogDetailTextBox.Text = "";

            AbsoluteTime = 0.0f;
        }
Example #3
0
 private void AutoAdvanceTimer_Tick(object sender, EventArgs e)
 {
     Simulation.Advance((float)AutoAdvanceTimer.Interval / 1000.0f);
     ScenarioRenderingBox.Refresh();
 }
Example #4
0
 private void Advance100msButton_Click(object sender, EventArgs e)
 {
     Simulation.Advance(0.1f);
     ScenarioRenderingBox.Refresh();
 }