Пример #1
0
        public static BuildingResult _GetBuildingCarbonProduction(ComputationUnit building)
        {
            BuildingResult result = new BuildingResult();

            if (building.Type == BuildingType.GreenField || building.Type == BuildingType.Unknown)
            {
                return(result);
            }

            double energyUsingRatio      = 1 - building.EnergySavingCoefficient.Value / 100;
            double otherCleanEnergyRatio = Parameter.Base.OtherCleanEnergyRatio / 100;

            BuildingType computeBuildingType = building.Type;

            if (building.Type == BuildingType.Education || building.Type == BuildingType.Industry || building.Type == BuildingType.Other || building.Type == BuildingType.Office)
            {
                computeBuildingType = building.IsHighBuilding() ? BuildingType.HighOffice : BuildingType.HighOffice;
            }
            else if (building.Type == BuildingType.Residencial)
            {
                computeBuildingType = building.IsHighBuilding() ? BuildingType.HighResidencial : BuildingType.MidHighResidencial;
            }

            // 1. 建材准备
            result.Material = building.Floor * GetPrepareConstructionProduction(computeBuildingType, Parameter.Building) * energyUsingRatio;

            // 2. 建造过程
            result.Construction = building.Floor * GetConstructionProduction(computeBuildingType, building.Structure) * energyUsingRatio;

            // 3. 运行维护
            // a. 空调
            result.Maintenance.AirConditioning = building.Floor *
                                                 GetOperationProduction(computeBuildingType, Parameter.Maintenance.AirConditioning) *
                                                 Parameter.Base.ElectricityProductionFactor *
                                                 (1 - otherCleanEnergyRatio) * energyUsingRatio;
            // b. 照明
            result.Maintenance.Lighting = building.Floor *
                                          GetOperationProduction(computeBuildingType, Parameter.Maintenance.Lighting) *
                                          Parameter.Base.ElectricityProductionFactor * (1 - otherCleanEnergyRatio) *
                                          energyUsingRatio;
            // c. 设备
            result.Maintenance.Equipment = building.Floor *
                                           GetOperationProduction(computeBuildingType, Parameter.Maintenance.Equipment) *
                                           Parameter.Base.ElectricityProductionFactor * (1 - otherCleanEnergyRatio) *
                                           energyUsingRatio;
            // d. 供暖
            result.Maintenance.Heating = building.Floor *
                                         GetOperationProduction(computeBuildingType, Parameter.Maintenance.Heating) *
                                         Parameter.Base.GasProductionFactor * (1 - otherCleanEnergyRatio) *
                                         energyUsingRatio;

            // 4. 拆毁回收
            result.Recycle = building.Floor * GetRecycleProduction(computeBuildingType, building.Structure) * energyUsingRatio;

            return(result);
        }
Пример #2
0
        public static BuildingResult GetBuildingCarbonProduction(ComputationUnit building)
        {
            BuildingResult result = new BuildingResult();

            if (building.Type == BuildingType.Mixed)
            {
                List <BuildingResult> resultList = new List <BuildingResult>();
                if (building.MixEducationPercent != 0.0 || building.MixIndustryPercent != 0.0 ||
                    building.MixOfficePercent != 0.0 || building.MixOtherPercent != 0.0)    // 教育和工业属同一类型:办公
                {
                    ComputationUnit tmp = new ComputationUnit(building);
                    tmp.Area = building.Area * (building.MixEducationPercent + building.MixIndustryPercent + building.MixOfficePercent + building.MixOtherPercent);
                    if (tmp.IsHighBuilding())
                    {
                        tmp.Type = BuildingType.HighOffice;
                    }
                    else
                    {
                        tmp.Type = BuildingType.MidHighOffice;
                    }
                    resultList.Add(_GetBuildingCarbonProduction(tmp));
                }
                if (building.MixGreenFieldPercent != 0.0)
                {
                    ComputationUnit tmp = new ComputationUnit(building);
                    tmp.Area = building.Area * building.MixRetailPercent;
                    tmp.Type = BuildingType.GreenField;
                    resultList.Add(_GetBuildingCarbonProduction(tmp));
                }
                if (building.MixHotelPercent != 0.0)
                {
                    ComputationUnit tmp = new ComputationUnit(building);
                    tmp.Area = building.Area * building.MixHotelPercent;
                    tmp.Type = BuildingType.Hotel;
                    resultList.Add(_GetBuildingCarbonProduction(tmp));
                }
                if (building.MixResidencialPercent != 0.0)
                {
                    ComputationUnit tmp = new ComputationUnit(building);
                    tmp.Area = building.Area * building.MixResidencialPercent;
                    if (tmp.IsHighBuilding())
                    {
                        tmp.Type = BuildingType.HighResidencial;
                    }
                    else
                    {
                        tmp.Type = BuildingType.MidHighResidencial;
                    }
                    resultList.Add(_GetBuildingCarbonProduction(tmp));
                }
                if (building.MixRetailPercent != 0.0)
                {
                    ComputationUnit tmp = new ComputationUnit(building);
                    tmp.Area = building.Area * building.MixRetailPercent;
                    tmp.Type = BuildingType.Retail;
                    resultList.Add(_GetBuildingCarbonProduction(tmp));
                }
                foreach (var r in resultList)
                {
                    result.Material     += r.Material;
                    result.Construction += r.Construction;
                    result.Maintenance.AirConditioning += r.Maintenance.AirConditioning;
                    result.Maintenance.Lighting        += r.Maintenance.Lighting;
                    result.Maintenance.Equipment       += r.Maintenance.Equipment;
                    result.Maintenance.Heating         += r.Maintenance.Heating;
                    result.Recycle += r.Recycle;
                }
                building.CarbonProduction = result;
                return(result);
            }
            else
            {
                result = _GetBuildingCarbonProduction(building);
            }
            building.CarbonProduction = result;
            return(result);
        }