コード例 #1
0
        public SeedIndustryData()
        {
            Industrys = new StaticDictionary<StaticIndustry>();

            StaticIndustry industry;

            industry = AddIndustry("Roma Industry", "industry_roma");
            Industrys.Add(industry.TagName, industry);

            industry = AddIndustry("Velathri Industry", "industry_velathri");
            Industrys.Add(industry.TagName, industry);

            industry = AddIndustry("Ariminum Industry", "industry_ariminum");
            Industrys.Add(industry.TagName, industry);
        }
コード例 #2
0
        public SeedFarmData()
        {
            Farms = new StaticDictionary <StaticFarm>();

            StaticFarm farm;

            farm = AddFarm("Roma Farm", "farm_roma");
            Farms.Add(farm.TagName, farm);

            farm = AddFarm("Velathri Farm", "farm_velathri");
            Farms.Add(farm.TagName, farm);

            farm = AddFarm("Ariminum Farm", "farm_ariminum");
            Farms.Add(farm.TagName, farm);
        }
コード例 #3
0
        public SeedFarmData()
        {
            Farms = new StaticDictionary<StaticFarm>();

            StaticFarm farm;

            farm = AddFarm("Roma Farm", "farm_roma");
            Farms.Add(farm.TagName, farm);

            farm = AddFarm("Velathri Farm", "farm_velathri");
            Farms.Add(farm.TagName, farm);

            farm = AddFarm("Ariminum Farm", "farm_ariminum");
            Farms.Add(farm.TagName, farm);
        }
コード例 #4
0
        public SeedPortData()
        {
            Ports = new StaticDictionary <StaticPort>();

            StaticPort port;

            port = AddPort("Roma Port", "port_roma");
            Ports.Add(port.TagName, port);

            port = AddPort("Velathri Port", "port_velathri");
            Ports.Add(port.TagName, port);

            port = AddPort("Ariminum Port", "port_ariminum");
            Ports.Add(port.TagName, port);
        }
コード例 #5
0
        public SeedPortData()
        {
            Ports = new StaticDictionary<StaticPort>();

            StaticPort port;

            port = AddPort("Roma Port", "port_roma");
            Ports.Add(port.TagName, port);

            port = AddPort("Velathri Port", "port_velathri");
            Ports.Add(port.TagName, port);

            port = AddPort("Ariminum Port", "port_ariminum");
            Ports.Add(port.TagName, port);
        }
コード例 #6
0
        public SeedIndustryData()
        {
            Industrys = new StaticDictionary <StaticIndustry>();

            StaticIndustry industry;

            industry = AddIndustry("Roma Industry", "industry_roma");
            Industrys.Add(industry.TagName, industry);

            industry = AddIndustry("Velathri Industry", "industry_velathri");
            Industrys.Add(industry.TagName, industry);

            industry = AddIndustry("Ariminum Industry", "industry_ariminum");
            Industrys.Add(industry.TagName, industry);
        }
コード例 #7
0
        /// <summary>
        /// Builds the data.
        /// </summary>
        /// <param name="interpreter"></param>
        /// <param name="embeddedString"></param>
        /// <returns></returns>
        public override IRoutingAlgorithmData <CHEdgeData> BuildData(IOsmRoutingInterpreter interpreter,
                                                                     string embeddedString)
        {
            string key = string.Format("CHEdgeDifference.Routing.IRoutingAlgorithmData<CHEdgeData>.OSM.{0}",
                                       embeddedString);
            var data = StaticDictionary.Get <IRoutingAlgorithmData <CHEdgeData> >(
                key);

            if (data == null)
            {
                var tagsIndex = new TagsIndex();

                // do the data processing.
                var memoryData = new RouterDataSource <CHEdgeData>(new DirectedGraph <CHEdgeData>(), tagsIndex);
                var targetData = new CHEdgeGraphOsmStreamTarget(
                    memoryData, interpreter, tagsIndex, Vehicle.Car);
                var dataProcessorSource = new XmlOsmStreamSource(
                    Assembly.GetExecutingAssembly().GetManifestResourceStream(embeddedString));
                var sorter = new OsmStreamFilterSort();
                sorter.RegisterSource(dataProcessorSource);
                targetData.RegisterSource(sorter);
                targetData.Pull();

                data = memoryData;
                StaticDictionary.Add <IRoutingAlgorithmData <CHEdgeData> >(key, data);
            }
            return(data);
        }
コード例 #8
0
        /// <summary>
        /// Builds data source.
        /// </summary>
        /// <param name="interpreter"></param>
        /// <param name="embeddedString"></param>
        /// <returns></returns>
        public override IBasicRouterDataSource <LiveEdge> BuildData(IOsmRoutingInterpreter interpreter,
                                                                    string embeddedString)
        {
            string key = string.Format("Dykstra.Routing.IBasicRouterDataSource<SimpleWeighedEdge>.OSM.{0}",
                                       embeddedString);
            var data = StaticDictionary.Get <IBasicRouterDataSource <LiveEdge> >(
                key);

            if (data == null)
            {
                var tagsIndex = new TagsTableCollectionIndex();

                // do the data processing.
                var memoryData          = new DynamicGraphRouterDataSource <LiveEdge>(tagsIndex);
                var targetData          = new LiveGraphOsmStreamTarget(memoryData, interpreter, tagsIndex);
                var dataProcessorSource = new XmlOsmStreamSource(
                    Assembly.GetExecutingAssembly().GetManifestResourceStream(embeddedString));
                var sorter = new OsmStreamFilterSort();
                sorter.RegisterSource(dataProcessorSource);
                targetData.RegisterSource(sorter);
                targetData.Pull();

                data = memoryData;
                StaticDictionary.Add <IBasicRouterDataSource <LiveEdge> >(key,
                                                                          data);
            }
            return(data);
        }
コード例 #9
0
        /// <summary>
        /// Builds the data.
        /// </summary>
        /// <param name="interpreter"></param>
        /// <param name="embeddedString"></param>
        /// <returns></returns>
        public override IBasicRouterDataSource <CHEdgeData> BuildData(IOsmRoutingInterpreter interpreter,
                                                                      string embeddedString)
        {
            string key = string.Format("CHEdgeDifference.Routing.IBasicRouterDataSource<CHEdgeData>.OSM.{0}",
                                       embeddedString);
            var data = StaticDictionary.Get <IBasicRouterDataSource <CHEdgeData> >(
                key);

            if (data == null)
            {
                var tagsIndex = new TagsTableCollectionIndex();

                // do the data processing.
                var memoryData = new DynamicGraphRouterDataSource <CHEdgeData>(tagsIndex);
                var targetData = new CHEdgeGraphOsmStreamTarget(
                    memoryData, interpreter, tagsIndex, Vehicle.Car);
                var dataProcessorSource = new XmlOsmStreamSource(
                    Assembly.GetExecutingAssembly().GetManifestResourceStream(embeddedString));
                var sorter = new OsmStreamFilterSort();
                sorter.RegisterSource(dataProcessorSource);
                targetData.RegisterSource(sorter);
                targetData.Pull();

                // do the pre-processing part.
                var witnessCalculator = new DykstraWitnessCalculator();
                var preProcessor      = new CHPreProcessor(memoryData,
                                                           new EdgeDifference(memoryData, witnessCalculator), witnessCalculator);
                preProcessor.Start();

                data = memoryData;
                StaticDictionary.Add <IBasicRouterDataSource <CHEdgeData> >(key, data);
            }
            return(data);
        }
コード例 #10
0
        public SeedCityData()
        {
            Citys = new StaticDictionary<StaticCity>();

            StaticCity city;

            city = AddCity("Roma City", "city_roma");
            city = AddBuildingsToCity(city, "building_woodenpalisade");
            Citys.Add(city.TagName, city);

            city = AddCity("Velathri City", "city_velathri");
            Citys.Add(city.TagName, city);

            city = AddCity("Ariminum City", "city_ariminum");
            Citys.Add(city.TagName, city);
        }
コード例 #11
0
        public SeedCityData()
        {
            Citys = new StaticDictionary <StaticCity>();

            StaticCity city;

            city = AddCity("Roma City", "city_roma");
            city = AddBuildingsToCity(city, "building_woodenpalisade");
            Citys.Add(city.TagName, city);

            city = AddCity("Velathri City", "city_velathri");
            Citys.Add(city.TagName, city);

            city = AddCity("Ariminum City", "city_ariminum");
            Citys.Add(city.TagName, city);
        }
コード例 #12
0
        public SeedInfrastructureData()
        {
            Infrastructures = new StaticDictionary <StaticInfrastructure>();

            StaticInfrastructure industry;

            industry = AddInfrastructure("Infra Roma", "infrastructure_roma");
            industry = AddInfrastructureBuildings(industry, "building_path", "building_road");
            Infrastructures.Add(industry.TagName, industry);

            industry = AddInfrastructure("Infra Velathri", "infrastructure_velathri");
            industry = AddInfrastructureBuildings(industry, "building_path");
            Infrastructures.Add(industry.TagName, industry);

            industry = AddInfrastructure("Infra Ariminum", "infrastructure_ariminum");
            industry = AddInfrastructureBuildings(industry, "building_path", "building_road");
            Infrastructures.Add(industry.TagName, industry);
        }
コード例 #13
0
        public SeedRegionData()
        {
            Regions = new StaticDictionary<StaticRegion>();

            StaticRegion region;

            region = AddRegion("Roma Region", "region_roma", true, "country_rome");
            region = AddRegionLocations(region, "city_roma", "farm_roma", "port_roma", "industry_roma", "infrastructure_roma", "province_italia");
            Regions.Add(region.TagName, region);

            region = AddRegion("Velathri Region", "region_velathri", true, "country_rome");
            region = AddRegionLocations(region, "city_velathri", "farm_velathri", "port_velathri", "industry_velathri", "infrastructure_velathri", "province_italia");
            Regions.Add(region.TagName, region);

            region = AddRegion("Ariminum Region", "region_ariminum", true, "country_rome");
            region = AddRegionLocations(region, "city_ariminum", "farm_ariminum", "port_ariminum", "industry_ariminum", "infrastructure_ariminum", "province_italia");
            Regions.Add(region.TagName, region);
        }
コード例 #14
0
        public SeedRegionData()
        {
            Regions = new StaticDictionary <StaticRegion>();

            StaticRegion region;

            region = AddRegion("Roma Region", "region_roma", true, "country_rome");
            region = AddRegionLocations(region, "city_roma", "farm_roma", "port_roma", "industry_roma", "infrastructure_roma", "province_italia");
            Regions.Add(region.TagName, region);

            region = AddRegion("Velathri Region", "region_velathri", true, "country_rome");
            region = AddRegionLocations(region, "city_velathri", "farm_velathri", "port_velathri", "industry_velathri", "infrastructure_velathri", "province_italia");
            Regions.Add(region.TagName, region);

            region = AddRegion("Ariminum Region", "region_ariminum", true, "country_rome");
            region = AddRegionLocations(region, "city_ariminum", "farm_ariminum", "port_ariminum", "industry_ariminum", "infrastructure_ariminum", "province_italia");
            Regions.Add(region.TagName, region);
        }
コード例 #15
0
        public SeedProvinceData()
        {
            Provinces = new StaticDictionary <StaticProvince>();

            StaticProvince province;

            province = AddProvince("Italia", "province_italia");
            Provinces.Add(province.TagName, province);
        }
コード例 #16
0
        public SeedInfrastructureData()
        {
            Infrastructures = new StaticDictionary<StaticInfrastructure>();

            StaticInfrastructure industry;

            industry = AddInfrastructure("Infra Roma", "infrastructure_roma");
            industry = AddInfrastructureBuildings(industry, "building_path", "building_road");
            Infrastructures.Add(industry.TagName, industry);

            industry = AddInfrastructure("Infra Velathri", "infrastructure_velathri");
            industry = AddInfrastructureBuildings(industry, "building_path");
            Infrastructures.Add(industry.TagName, industry);

            industry = AddInfrastructure("Infra Ariminum", "infrastructure_ariminum");
            industry = AddInfrastructureBuildings(industry, "building_path", "building_road");
            Infrastructures.Add(industry.TagName, industry);
        }
コード例 #17
0
        public SeedProvinceData()
        {
            Provinces = new StaticDictionary<StaticProvince>();

            StaticProvince province;

            province = AddProvince("Italia", "province_italia");
            Provinces.Add(province.TagName, province);
        }
コード例 #18
0
        public SeedCountryData()
        {
            Countries = new StaticDictionary<StaticCountry>();

            StaticCountry country;

            country = AddCountry("Rome", "country_rome");
            country = AddCountryProvinces(country, "province_italia");
            Countries.Add(country.TagName, country);
        }
コード例 #19
0
        public SeedCountryData()
        {
            Countries = new StaticDictionary <StaticCountry>();

            StaticCountry country;

            country = AddCountry("Rome", "country_rome");
            country = AddCountryProvinces(country, "province_italia");
            Countries.Add(country.TagName, country);
        }
コード例 #20
0
        private void SeedDefensiveData()
        {
            StaticBuilding building;

            building = AddBuilding("Wooden Palisade", "building_woodenpalisade", StaticBuildingType.Defensive, RequiredEnum.City, 100, 10, 2);
            building = AddBuildingPrerequisites(building, "", "building_woodenwalls", "buildingchain_wall");
            Buildings.Add(building.TagName, building);

            building = AddBuilding("Wooden Walls", "building_woodenwalls", StaticBuildingType.Defensive, RequiredEnum.City, 200, 20, 2);
            building = AddBuildingPrerequisites(building, "building_woodenpalisade", "building_stonewalls", "buildingchain_wall");
            Buildings.Add(building.TagName, building);

            building = AddBuilding("Stone Walls", "building_stonewalls", StaticBuildingType.Defensive, RequiredEnum.City, 400, 40, 2);
            building = AddBuildingPrerequisites(building, "building_woodenwalls", "building_largestonewalls", "buildingchain_wall");
            Buildings.Add(building.TagName, building);

            building = AddBuilding("Large Stone Walls", "building_largestonewalls", StaticBuildingType.Defensive, RequiredEnum.City, 800, 80, 2);
            building = AddBuildingPrerequisites(building, "building_stonewalls", "building_hugestonewalls", "buildingchain_wall");
            Buildings.Add(building.TagName, building);

            building = AddBuilding("Huge Stone Walls", "building_hugestonewalls", StaticBuildingType.Defensive, RequiredEnum.City, 1500, 150, 2);
            building = AddBuildingPrerequisites(building, "building_largestonewalls", "", "buildingchain_wall");
            Buildings.Add(building.TagName, building);
        }