// // public void RunLandUseScenarios() { if (DWDM != null) { // prep for output string FileFormat = "CSV"; string errMsg = ""; saveFileDialog1.Filter = "CSV|*.csv"; // open save dialog and run if (saveFileDialog1.ShowDialog() == DialogResult.OK) { string Filename = saveFileDialog1.FileName; //double[] Options = new double[2]; //Options[0] = 0.1; //Options[1] = 0.2; double[] Options = new double[5]; Options[0] = 0.1; Options[1] = 0.2; Options[2] = 0.3; Options[3] = 0.4; Options[4] = 0.5; toolStripStatusLabel1.Text = "Creating Scenarios"; // Generate the scenarios // DemandScenarioList DSL = DWDM.GenerateLandScenarios(Options); int SNCount = DSL.Count; int AgCount = 0; foreach (DemandScenario DS in DSL) { AgCount += DS.HouseholdList.Count; } label3.Text = "Scenarios " + SNCount.ToString() + " Agents " + AgCount.ToString(); Application.DoEvents(); // Run the scenarios bool test = DWDM.RunScenario(DSL, FileFormat, Filename, report, 100, out errMsg); if (!test) { MessageBox.Show(errMsg); } else { // write documentation } //string AllScnData = DWDM.RunScenario(DSL, "CSV", report, 100); } } }
public void RunGSFOnVarAndDUAScenarios() { if (DWDM != null) { // prep for output string FileFormat = "CSV"; string errMsg = ""; saveFileDialog1.Filter = "CSV|*.csv"; // open save dialog and run if (saveFileDialog1.ShowDialog() == DialogResult.OK) { toolStripStatusLabel1.Text = "Creating Scenarios"; Application.DoEvents(); string Filename = saveFileDialog1.FileName; DemandScenarioList MyGSFScenarios = new DemandScenarioList(); double[] HighresChangeList = new double[61]; double change = 0; for (int k = 0; k < HighresChangeList.Length; k++) { HighresChangeList[k] = change; change += .01; } double[] ChangeList = new double[] { 0, .1, .2, .3 }; toolStripStatusLabel1.Text = "Creating Scenarios"; Application.DoEvents(); MyGSFScenarios = DWDM.GenerateGSFScenariosOnVarAndChange(HighresChangeList, 1); toolStripStatusLabel1.Text = "Running " + MyGSFScenarios.Count.ToString() + " Scenarios"; Application.DoEvents(); bool test = DWDM.RunScenario(MyGSFScenarios, FileFormat, Filename, report, 100, out errMsg); if (!test) { MessageBox.Show(errMsg); } else { toolStripStatusLabel1.Text = "Done"; Application.DoEvents(); } } } }
void RunDynamicScenarios() { if (DWDM != null) { // prep for output string FileFormat = "CSV"; string errMsg = ""; saveFileDialog1.Filter = "CSV|*.csv"; // open save dialog and run if (saveFileDialog1.ShowDialog() == DialogResult.OK) { string Filename = saveFileDialog1.FileName; bool UseGSFVar = checkBoxUseGSFVar.Checked; bool UseGSFChnage = checkBoxUseGSFCHange.Checked; bool UseLandUse = checkBoxUseLLUChange.Checked; // // int ValueSelected = comboBoxDUA.SelectedIndex; int DUASelector = ValueSelected - 1; int ErrNumber = -1; double[] Options = null; if (UseLandUse) { double[] TempList = GetValuesFromMultiLIneTextBox(textBoxLandUsePCT, out ErrNumber); if (TempList.Length > 0) { Options = TempList; } } else { Options = new double[1]; Options[0] = .30; } double[] GSFCHangeLIst = null; if (UseGSFChnage) { double[] TempList = GetValuesFromMultiLIneTextBox(textBoxGSFPCT, out ErrNumber); if (TempList.Length > 0) { GSFCHangeLIst = TempList; } } toolStripStatusLabel1.Text = "Creating Dynamic Scenarios"; // Generate the scenarios // //DemandScenarioList DSL = DWDM.GenerateLandAndGSFScenarios(Options, UseGSFVar, GSFCHangeLIst, DUASelector); DemandScenarioList DSL = DWDM.GenerateLandAndGSFScenarios(Options, UseGSFVar, GSFCHangeLIst, DUASelector); int SNCount = DSL.Count; int AgCount = 0; foreach (DemandScenario DS in DSL) { AgCount += DS.HouseholdList.Count; } label3.Text = "Scenarios " + SNCount.ToString() + " Agents " + AgCount.ToString(); Application.DoEvents(); // Run the scenarios bool test = DWDM.RunScenario(DSL, FileFormat, Filename, report, 100, out errMsg); if (!test) { MessageBox.Show(errMsg); } else { // write documentation } //string AllScnData = DWDM.RunScenario(DSL, "CSV", report, 100); } } }