private void btnOpenModeling_Click(object sender, EventArgs e) { if (rbRandomFlow.Checked == true) { try { switch (cbChooseDistributionLaw.SelectedIndex) { case (int)DistributionLaws.UniformDistribution: randNumGenerator = new UniformDistribution((double)nudUniformDistParamA.Value, (double)nudUniformDistParamB.Value); break; case (int)DistributionLaws.NormalDistribution: randNumGenerator = new NormalDistribution((double)nudNormalDistrExpectedValue.Value, (double)nudNormalDistrVariance.Value); break; case (int)DistributionLaws.ExponentialDistribution: randNumGenerator = new ExponentialDistribution((double)nudExponentialDistrLambda.Value); break; default: break; } } catch (Exception exc) { MessageBox.Show(exc.Message); return; } } else { randNumGenerator = new DeterminedDistribution((double)nudDeterminedFlow.Value); } TrafficFlow trafficFlow = new TrafficFlow(randNumGenerator, (double)nudProbabilityOfStoppingAtGasStation.Value); ModelingForm modeling = new ModelingForm(topology, trafficFlow); modeling.Show(); Dispose(); Close(); }
private void modelingToolStripMenuItem_Click(object sender, EventArgs e) { var form = new ModelingForm(); form.Show(); }