internal bool parameterCheck(MyParameterInfo MP, int i) { TempParam = ws.ParamManager.Model_Parameter(MP.TheMP.ModelParam); ModelParameterClass TheMP = ws.ParamManager.Model_Parameter(MP.Fieldname); bool result = true; int[] Data = new int[33]; for (int j = 0; j < 33; j++) { Data[j] = i; } switch (TheMP.ParamType) { case modelParamtype.mptInputBase: //TheMP.Value = Data[0]; TempParam.Value = Data[0]; break; case modelParamtype.mptInputProvider: ProviderIntArray PData = new ProviderIntArray(); PData.Values = Data; TheMP.ProviderProperty.setvalues(PData); break; } // ws.ParamManager.Model_Parameter("DROUSCEN").Value = 3; int data = i; for (int j = 0; j < 33; j++) { MP.Data[j] = i; } return(result); }
// ==================================================================================================================================== // public void RunSpecial(List <int[]> RunList, int totalCount, string[] flds, WaterSimManager_SIO ws, MyParameterInfo MPC) { int set = 0; int count = 0; ModelParameterBaseClass MP; foreach (var value in RunList) { ws.Simulation_Initialize(); set_parmIncludeMeteorology = false; // foreach (int emp in ws.ParamManager.eModelParameters()) { //MP = ws.ParamManager.Model_ParameterBaseClass(emp); MP = ws.ParamManager.Model_Parameter(emp); if (MP.Fieldname == flds[count]) { parameterZeroOut(MP, MPC); count++; if (count == totalCount) { break; } } } count = 0; foreach (int emp in ws.ParamManager.eModelParameters()) { MP = ws.ParamManager.Model_ParameterBaseClass(emp); if (MP.Fieldname == flds[count]) { parameterSet(MP, MPC, value[count]); count++; if (count == totalCount) { break; } } } // // runOnly(); set++; // runOutputs(MPC, set, runningCount); runningCount++; readyToRun = false; break; } }
public void Add(MyParameterInfo parms) { myList.Add(parms); }
public void scenarios(WaterSimManager_SIO ws) { int ScnCnt = 1; DateTime value = new DateTime(2016, 8, 10); String Filename = "Sensitivity.txt"; MySW = new System.IO.StreamWriter(Filename); // int Count = 0; ScnGenForm(); myParameters(); FO = new FileOutputs(ws); int Count = 0; // MyParameterInfo MP = new MyParameterInfo(); if (get_ValidModelRun == true) { // string[] MyWaterUseFlds = new string[ws.WaterUseGroup.Count]; string[] MyEffluentFlds = new string[ws.EffluentGroup.Count]; string[] MyReclaimedFlds = new string[ws.ReclaimedGroup.Count]; // foreach (MyParameterInfo MPC in pl.myList) { ModelParameterClass TheMP = ws.ParamManager.Model_Parameter(MPC.Fieldname); // if (ws.WaterUseGroup.isMember(TheMP.ModelParam)) { //GenericCreateCountList(MPC, MyWaterUseFlds, ws.WaterUseGroup.Count); //if (readyToRun) //{ // RunSpecial(aValuesList, ws.WaterUseGroup.Count, MyWaterUseFlds, ws, MPC); //} } else if (ws.EffluentGroup.isMember(TheMP.ModelParam)) { //GenericCreateCountList(MPC, MyEffluentFlds, ws.EffluentGroup.Count); //if (readyToRun) //{ // RunSpecial(aValuesList, ws.EffluentGroup.Count, MyEffluentFlds, ws, MPC); //} } else if (ws.ReclaimedGroup.isMember(TheMP.ModelParam)) { //GenericCreateCountList(MPC, MyReclaimedFlds, ws.ReclaimedGroup.Count); //if (readyToRun) //{ // RunSpecial(aValuesList, ws.ReclaimedGroup.Count, MyReclaimedFlds, ws, MPC); //} } else { if (0 < MPC.MinIntValue) { Count = 1; } for (int i = MPC.MinIntValue; i < MPC.MaxIntValue + 1; i += MPC.RangeInterval * Count - i) { // ws.Simulation_Initialize(); set_parmIncludeMeteorology = false; if (parameterCheck(MPC, i)) { // runOnly(); } Count += 1; // runOutputs(MPC, i, ScnCnt); ScnCnt++; } Count = 0; } } ; } MySW.Flush(); MySW.Close(); }