コード例 #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;
        }
コード例 #2
0
        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;
        }
コード例 #3
0
 private void AutoAdvanceTimer_Tick(object sender, EventArgs e)
 {
     Simulation.Advance((float)AutoAdvanceTimer.Interval / 1000.0f);
     ScenarioRenderingBox.Refresh();
 }
コード例 #4
0
 private void Advance100msButton_Click(object sender, EventArgs e)
 {
     Simulation.Advance(0.1f);
     ScenarioRenderingBox.Refresh();
 }