コード例 #1
0
        //
        // 10.25.17 das what is RAY doing here? Why are we adding only two of the building types?
        //
        void SetupCommunityModel()
        {
            BuildList = DWDM.BuildTypeList;

            {
                BuildingType BT = BuildList.FindByCode("LSF");
                if (BT != null)
                {
                    DenverHouseholdData  DHD  = new DenverHouseholdData("LSF2.5_50", "LSF", "Low Single Family 2.5 Persons per Household 50 gallons Indoor GPCCD", "LSF", 2.5, 350, 50, BT.GallonsPerSqFtPervious, BT.DwellinUnitsPerAcre);
                    HouseHoldWaterDemand HHWD = DHD.NewHousehold();
                    //double units = 350 / 2.5;

                    //HouseHoldWaterDemand HHWD = new HouseHoldWaterDemand(BT, 2.5, units, 50);
                    DWDM.WaterDemandAgents.Add(HHWD);

                    BT = BuildList.FindByCode("HMF");
                    //units = 350 / 2.0;
                    if (BT != null)
                    {
                        DHD  = new DenverHouseholdData("HMF2.0_50", "HMF", "High Density2.0 Persons per Household 50 gallons Indoor GPCCD", "HMF", 2.0, 350, 50, BT.GallonsPerSqFtPervious, BT.DwellinUnitsPerAcre);
                        HHWD = DHD.NewHousehold();
                        //HHWD = new HouseHoldWaterDemand(BT, 2.0, units, 50);
                        DWDM.WaterDemandAgents.Add(HHWD);
                    }
                }
            }
            DWDM.Run();
            listBox1.Items.Clear();
            listBox1.Items.Add(DWDM.WaterDemandAgents.ToFieldHeaderString("CSV"));
            listBox1.Items.Add(DWDM.WaterDemandAgents.ToString("CSV"));
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: DCDCWaterSim/DemandModel
        void displayValues()
        {
            AcresDevelopment.Text = DM.TotalAcres().ToString();
            PerviousAcres.Text    = DM.TotalEstimatedPerviousAcres().ToString();
            IndoorDemand.Text     = DM.TotalAnnualIndoorDemand().ToString();
            SeasonalDemand.Text   = DM.TotalAnnualSeasonalDemand().ToString();
            TotalDemand.Text      = DM.TotalAnnualDemand().ToString();
            GPCD.Text             = DM.AverageGPCD().ToString();
            DwellingUnits.Text    = DM.TotalUnits().ToString();
            GallonsUnit.Text      = DM.AverageAnnualGallonsPerUnit().ToString();
            GallonsAcre.Text      = DM.AverageAnnualAcreFeetPerAcre().ToString();

            double count  = 0;
            double people = 0;
            double DA     = 0.0;
            double PA     = 0.0;
            double Units  = 0.0;
            double GU     = 0.0;
            double GA     = 0.0;

            foreach (WaterDemandAgent WDA in Community)
            {
                if (WDA is HouseHoldWaterDemand)
                {
                    HouseHoldWaterDemand HHWD = (WDA as HouseHoldWaterDemand);
                    DA    += HHWD.DevelopedAcres;
                    PA    += HHWD.PerviousSqFt;
                    Units += HHWD.NumberOfHouseholds;
                    //GU += HHWD.TotalDemand;
                    //GA += HHWD.TotalDemand;
                    people += HHWD.HouseHoldSize * HHWD.NumberOfHouseholds;
                    count++;
                }
            }
            PA = PA / 43560;
            //GU = GU / Units;
            //GA = GA / DA / 325851;

            double AllDemand = Community.TotalAllDemand();

            labelAD.Text   = DA.ToString();
            labelPA.Text   = PA.ToString();;
            labelID.Text   = (Community.TotalIndoorDemand() / 325851).ToString();
            labelOD.Text   = (Community.TotalOutdoorDemand() / 325851).ToString();
            labelTD.Text   = (AllDemand / 325851).ToString();;
            labelGPCD.Text = (AllDemand / people / 365).ToString();
            labelDU.Text   = Units.ToString();
            labelGU.Text   = (AllDemand / Units).ToString();
            labelGA.Text   = (AllDemand / 325851 / DA).ToString();
        }
コード例 #3
0
        void DisplayValues()
        {
            if (DWDM != null)
            {
                double count  = 0;
                double people = 0;
                double DA     = 0.0;
                double PA     = 0.0;
                double Units  = 0.0;
                // double GU = 0.0;
                //double GA = 0.0;
                foreach (WaterDemandAgent WDA in DWDM.WaterDemandAgents)
                {
                    if (WDA is HouseHoldWaterDemand)
                    {
                        HouseHoldWaterDemand HHWD = (WDA as HouseHoldWaterDemand);
                        DA    += HHWD.DevelopedAcres;
                        PA    += HHWD.PerviousSqFt;
                        Units += HHWD.NumberOfHouseholds;
                        //GU += HHWD.TotalDemand;
                        //GA += HHWD.TotalDemand;
                        people += HHWD.HouseHoldSize * HHWD.NumberOfHouseholds;
                        count++;
                    }
                }
                PA = PA / 43560;
                //GU = GU / Units;
                //GA = GA / DA / 325851;

                double AllDemand = DWDM.WaterDemandAgents.TotalAllDemand();
                labelAD.Text   = DA.ToString();
                labelPA.Text   = PA.ToString();;
                labelID.Text   = (DWDM.WaterDemandAgents.TotalIndoorDemand() / 325851).ToString();
                labelOD.Text   = (DWDM.WaterDemandAgents.TotalOutdoorDemand() / 325851).ToString();
                labelTD.Text   = (AllDemand / 325851).ToString();;
                labelGPCD.Text = (AllDemand / people / 365).ToString();
                labelDU.Text   = Units.ToString();
                labelGU.Text   = (AllDemand / Units).ToString();
                labelGA.Text   = (AllDemand / 325851 / DA).ToString();
            }
        }
コード例 #4
0
ファイル: Form1.cs プロジェクト: DCDCWaterSim/DemandModel
        void SetupCommunityModel()
        {
            if (BuildList != null)
            {
                BuildingType BT = BuildList.FindByCode("LSF");
                if (BT != null)
                {
                    double units = 700 / 2.5;
                    HouseHoldWaterDemand HHWD = new HouseHoldWaterDemand(BT, 2.5, units, 50);
                    Community.Add(HHWD);

                    //BT = BuildList.FindByCode("TSF");
                    //if (BT != null)
                    //{
                    //    BT = BuildList.FindByCode("TSF");
                    //    HHWD = new HouseHoldWaterDemand(BT, 2.5, units, 50);
                    //    Community.Add(HHWD);
                    //}
                }
            }
            Community.Run();
        }