@@ -205,12 +205,12 @@ namespace paxs {
205205 }
206206 // 結果の地区名を出力
207207 void outputResultDistrictName (std::ofstream& ofs_, const std::size_t i_) const {
208- ofs_ << japan_provinces->cgetDistrictList ()[i_].name << ' \t ' ;
208+ ofs_ << japan_provinces->getDistrictList ()[i_].name << ' \t ' ;
209209 }
210210 // 集落の初期化時にシミュレーション変数を出力
211211 void initResults () {
212212 result_writer_ = std::make_unique<SimulationResultWriter>();
213- result_writer_->initialize (SimulationConstants::getInstance ().output_directory_name , japan_provinces->cgetDistrictList ());
213+ result_writer_->initialize (SimulationConstants::getInstance ().output_directory_name , japan_provinces->getDistrictList ());
214214 }
215215
216216 // / @brief Initialize the simulator.
@@ -241,7 +241,7 @@ namespace paxs {
241241 // 可住地の数を出力
242242 for (std::size_t i = 1 ; i < max_number_of_districts; ++i) {
243243 result_writer_->writeHabitableLand (
244- japan_provinces->cgetDistrictList ()[i].name ,
244+ japan_provinces->getDistrictList ()[i].name ,
245245 (*live_list)[i + 1 ].habitable_land_positions .size ()
246246 );
247247 }
@@ -266,23 +266,23 @@ namespace paxs {
266266 const auto target_index = target_key.to (SettlementGridsType{});
267267
268268 // ターゲットの地域が登録されているか?
269- const auto target_iterator = settlement_grids.find (target_index);
270- const auto current_iterator = settlement_grids.find (current_index);
271- if (current_iterator == settlement_grids. end () ) {
269+ auto * const target_ptr = settlement_grids.try_get (target_index);
270+ auto * const current_ptr = settlement_grids.try_get (current_index);
271+ if (current_ptr == nullptr ) {
272272 return ; // current_indexが存在しない場合は何もしない
273273 }
274274
275- if (target_iterator != settlement_grids. end () ) {
275+ if (target_ptr != nullptr ) {
276276 // 登録されている場合はそのターゲット地域へ移動
277- target_iterator-> second . moveSettlementToThis (current_iterator-> second . getSettlement (settlement_id));
277+ target_ptr-> moveSettlementToThis (current_ptr-> getSettlement (settlement_id));
278278 }
279279 else {
280280 // 登録されていない場合は新しく地域を作成
281281 SettlementGrid settlement_grid = SettlementGrid (target_key * SimulationConstants::getInstance ().cell_group_length , environment, gen);
282- settlement_grid.moveSettlementToThis (current_iterator-> second . getSettlement (settlement_id));
282+ settlement_grid.moveSettlementToThis (current_ptr-> getSettlement (settlement_id));
283283 settlement_grids.emplace (target_index, std::move (settlement_grid));
284284 }
285- current_iterator-> second . deleteSettlement (settlement_id);
285+ current_ptr-> deleteSettlement (settlement_id);
286286 }
287287
288288 // / @brief Execute the simulation for the one step.
@@ -345,7 +345,7 @@ namespace paxs {
345345 stats.settlement_count = sat_num;
346346 stats.population_count = pop_num;
347347 stats.get_mtdna_name = [this ](std::uint_least8_t id) { return japan_provinces->getMtDNA_Name (id); };
348- stats.get_language_name = [this ](std::uint_least8_t id) { return japan_provinces->getLanguage_Name (id); };
348+ stats.get_language_name = [this ](std::uint_least8_t id) { return japan_provinces->getLanguageName (id); };
349349
350350 // Aggregate region stats and prepare district stats
351351 for (std::size_t i = 1 ; i < max_number_of_districts; ++i) {
@@ -701,7 +701,7 @@ namespace paxs {
701701
702702 // 地区と人口のマップ
703703 paxs::UnorderedMap<std::uint_least8_t , std::uint_least32_t > district_population_map;
704- for (const auto & district : japan_provinces->cgetDistrictList ()) {
704+ for (const auto & district : japan_provinces->getDistrictList ()) {
705705 if (((is_ad200) ? district.init_pop : district.immigrant ) == 0 ) {
706706 continue ;
707707 }
@@ -759,7 +759,7 @@ namespace paxs {
759759 }
760760
761761 // 配置する集落の人口を決定
762- paxs::District district = japan_provinces->cgetDistrict (district_id);
762+ paxs::District district = japan_provinces->getDistrict (district_id);
763763 int settlement_population = std::uniform_int_distribution<>(district.settlement_pop_min , district.settlement_pop_max )(gen);
764764 settlement_population = (std::min)(settlement_population, static_cast <int >(district_population_it->second ));
765765
0 commit comments