Example #1
0
        public MiscCityStatistics(
            IEnumerable <IQueryCrimeResult> queryCrimeResults,
            IEnumerable <IQueryFireHazardResult> queryFireHazardResults,
            IEnumerable <IQueryLandValueResult> queryLandValueResults,
            IEnumerable <IQueryPollutionResult> queryPollutionResults,
            IEnumerable <int> queryTravelDistanceResults
            )
        {
            if (queryCrimeResults == null)
            {
                throw new ArgumentNullException(nameof(queryCrimeResults));
            }
            if (queryFireHazardResults == null)
            {
                throw new ArgumentNullException(nameof(queryFireHazardResults));
            }
            if (queryLandValueResults == null)
            {
                throw new ArgumentNullException(nameof(queryLandValueResults));
            }
            if (queryPollutionResults == null)
            {
                throw new ArgumentNullException(nameof(queryPollutionResults));
            }
            if (queryTravelDistanceResults == null)
            {
                throw new ArgumentNullException(nameof(queryTravelDistanceResults));
            }

            FireHazardNumbers     = new NumberSummary(queryFireHazardResults.Select(x => x.ValueInUnits));
            CrimeNumbers          = new NumberSummary(queryCrimeResults.Select(x => x.ValueInUnits));
            LandValueNumbers      = new NumberSummary(queryLandValueResults.Select(x => x.ValueInUnits));
            PollutionNumbers      = new NumberSummary(queryPollutionResults.Select(x => x.ValueInUnits));
            TravelDistanceNumbers = new NumberSummary(queryTravelDistanceResults);
        }
        public RoadInfrastructureStatistics(IEnumerable <RoadZoneConsumption> roadZoneConsumptions)
        {
            var capturedRoadZoneConsumptions = roadZoneConsumptions.ToList();

            NumberOfRoadZones = capturedRoadZoneConsumptions.Count();
            TrafficNumbers    = new NumberSummary(capturedRoadZoneConsumptions.Select(x => x.GetTrafficDensityAsInt()));
        }
Example #3
0
        public GrowthZoneNetworkStatistics(
            IRoadInfrastructureStatistics roadInfraStructureStatistics,
            IRailroadInfrastructureStatistics railroadInfrastructureStatistics,
            ICollection <int> residentialZonePopulationNumbers,
            ICollection <int> commercialZonePopulationNumbers,
            ICollection <int> industrialZonePopulationNumbers,
            ICityServicesStatistics cityServicesStatistics
            )
        {
            RoadInfrastructureStatistics     = roadInfraStructureStatistics;
            RailroadInfrastructureStatistics = railroadInfrastructureStatistics;
            CityServicesStatistics           = cityServicesStatistics;

            ResidentialZonePopulationNumbers = new NumberSummary(residentialZonePopulationNumbers);
            CommercialZonePopulationNumbers  = new NumberSummary(commercialZonePopulationNumbers);
            IndustrialZonePopulationNumbers  = new NumberSummary(industrialZonePopulationNumbers);

            GlobalZonePopulationNumbers = new NumberSummary(residentialZonePopulationNumbers.Concat(commercialZonePopulationNumbers).Concat(industrialZonePopulationNumbers));
        }