Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

生命表の入力機能を追加 #102

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
182 changes: 91 additions & 91 deletions Data/Simulations/Sample/District.tsv
Original file line number Diff line number Diff line change
@@ -1,91 +1,91 @@
id name ja-JP region min_pop_placed_per_cell max_pop_placed_per_cell init_pop immigrant mtdna_region pop_ad725
1 satsuma 薩摩 2 4 20 2270 0 kyushu_jomon 38400
2 osumi 大隅 2 4 20 2400 0 kyushu_jomon 40600
3 hyuga 日向 2 4 20 1820 0 kyushu_jomon 30800
4 higo 肥後 2 4 20 6426 0 kyushu_jomon 108700
5 bungo 豊後 3 4 20 1226 0 kyushu_jomon 51600
6 chikugo 筑後 3 4 20 1410 0 kyushu_jomon 59300
7 hizen 肥前 3 4 20 1148 0 kyushu_jomon 48300
8 chikuzen 筑前 3 4 20 2664 5 kyushu_jomon 112000
9 buzen 豊前 3 4 20 1122 0 kyushu_jomon 47200
10 iki 壱岐 3 4 20 288 0 kyushu_jomon 12100
11 tsushima 対馬 3 4 20 234 0 kyushu_jomon 9900
12 nagato 長門 5 4 20 976 0 chugoku_jomon 43900
13 suo 周防 5 4 20 1098 0 chugoku_jomon 49400
14 aki 安芸 5 4 20 1540 0 chugoku_jomon 69200
15 bingo 備後 5 4 20 1588 0 chugoku_jomon 71400
16 bitchu 備中 5 4 20 1760 0 chugoku_jomon 79100
17 mimasaka 美作 5 4 20 1564 0 chugoku_jomon 70300
18 bizen 備前 5 4 20 1246 0 chugoku_jomon 56000
19 harima 播磨 7 4 20 2358 0 kinki_jomon 107600
20 iwami 石見 6 4 20 410 0 chugoku_jomon 40600
21 izumo 出雲 6 4 20 866 0 chugoku_jomon 85700
22 hoki 伯耆 6 4 20 532 0 chugoku_jomon 52700
23 oki 隠岐 6 4 20 132 0 chugoku_jomon 13200
24 inaba 因幡 6 4 20 554 0 chugoku_jomon 54900
25 tajima 但馬 6 4 20 654 0 chugoku_jomon 64800
26 tango 丹後 6 4 20 388 0 chugoku_jomon 38400
27 tanba 丹波 7 4 20 1636 0 kinki_jomon 74700
28 iyo 伊予 4 4 20 1726 0 shikoku_jomon 79100
29 tosa 土佐 4 4 20 1030 0 shikoku_jomon 47200
30 awa 阿波 4 4 20 1102 0 shikoku_jomon 50500
31 sanuki 讃岐 4 4 20 2158 0 shikoku_jomon 98800
32 awaji 淡路 7 4 20 408 0 kinki_jomon 18700
33 kii 紀伊 7 4 20 1346 0 kinki_jomon 61500
34 yamato 大和 8 4 20 2266 0 kinki_jomon 171700
35 kawachi 河内 8 4 20 1160 0 kinki_jomon 87900
36 yamashiro 山城 8 4 20 1130 0 kinki_jomon 85700
37 izumi 和泉 8 4 20 348 0 kinki_jomon 26400
38 settsu 摂津 8 4 20 1130 0 kinki_jomon 85700
39 wakasa 若狭 11 4 20 378 0 chubu_jomon 23100
40 echizen 越前 11 4 20 990 0 chubu_jomon 60400
41 kaga 加賀 11 4 20 538 0 chubu_jomon 32900
42 etchu 越中 11 4 20 754 0 chubu_jomon 46100
43 noto 能登 11 4 20 468 0 chubu_jomon 28600
44 echigo 越後 11 4 20 610 0 chubu_jomon 37300
45 sado 佐渡 11 4 20 396 0 chubu_jomon 24200
46 shima 志摩 7 4 20 3374 0 kinki_jomon 154000
47 ise 伊勢 7 4 20 2260 0 kinki_jomon 103200
48 iga 伊賀 7 4 20 432 0 kinki_jomon 19800
49 owari 尾張 9 4 20 1686 0 chubu_jomon 75800
50 mikawa 参河 9 4 20 1686 0 chubu_jomon 75800
51 totomi 遠江 9 4 20 2346 0 chubu_jomon 105400
52 suruga 駿河 9 4 20 1442 0 chubu_jomon 64800
53 izu 伊豆 9 4 20 514 0 chubu_jomon 23100
54 kai 甲斐 10 4 20 4746 0 chubu_jomon 34000
55 sagami 相模 12 4 20 2078 0 kanto_jomon 73600
56 musashi 武蔵 12 4 20 3690 0 kanto_jomon 130700
57 shimosa 下総 12 4 20 2820 0 kanto_jomon 99900
58 kazusa 上総 12 4 20 2358 0 kanto_jomon 83500
59 awa1 安房 12 4 20 990 0 kanto_jomon 35100
60 hitachi 常陸 13 4 20 3698 0 kanto_jomon 168000
61 omi 近江 7 4 20 2236 0 kinki_jomon 102100
62 mino 美濃 9 4 20 3202 0 chubu_jomon 143900
63 hida 飛騨 10 4 20 1996 0 chubu_jomon 14300
64 shinano 信濃 10 4 20 10276 0 chubu_jomon 73600
65 kozuke 上野 13 4 20 2466 0 kanto_jomon 112000
66 shimotsuke 下野 13 4 20 1692 0 kanto_jomon 76900
67 mutsu 陸奥 15 4 20 5740 0 tohoku_jomon 206500
68 dewa 出羽 14 4 20 940 0 tohoku_jomon 78000
69 ezo_honshu 蝦夷(本州) 15 4 20 2000 0 tohoku_jomon 0
70 ezo_hokkaido 蝦夷(北海道) 16 4 20 0 0 hokkaido_jomon 0
71 ezo_chishima 蝦夷(千島列島) 16 4 20 0 0 hokkaido_jomon 0
72 ezo_karafuto 蝦夷(樺太) 16 4 20 0 0 hokkaido_jomon 0
73 toraijin_land 渡来人 0 0 0 0 0 toraijin 0
74 null_a 0 4 20 0 0 0
75 null_b 0 4 20 0 0 0
76 null_c 0 4 20 0 0 0
77 null_d 0 4 20 0 0 0
78 null_e 0 4 20 0 0 0
79 null_f 0 4 20 0 0 0
80 null_g 0 4 20 0 0 0
81 null_h 0 4 20 0 0 0
82 null_i 0 4 20 0 0 0
83 null_j 0 4 20 0 0 0
84 null_k 0 4 20 0 0 0
85 null_l 0 4 20 0 0 0
86 null_m 0 4 20 0 0 0
87 null_n 0 4 20 0 0 0
88 ogasawara 小笠原諸島 1 4 20 0 0 southern_islands_jomon 0
89 izu1 伊豆諸島 1 4 20 0 0 southern_islands_jomon 0
90 ryukyu 琉球諸島 1 4 20 0 0 southern_islands_jomon 0
id name ja-JP region min_pop_placed_per_cell max_pop_placed_per_cell init_pop immigrant increased_immigration mtdna_region pop_ad725
1 satsuma 薩摩 2 4 20 2270 0 0 kyushu_jomon 38400
2 osumi 大隅 2 4 20 2400 0 0 kyushu_jomon 40600
3 hyuga 日向 2 4 20 1820 0 0 kyushu_jomon 30800
4 higo 肥後 2 4 20 6426 0 0 kyushu_jomon 108700
5 bungo 豊後 3 4 20 1226 0 0.001 kyushu_jomon 51600
6 chikugo 筑後 3 4 20 1410 0 0.001 kyushu_jomon 59300
7 hizen 肥前 3 4 20 1148 0 0.001 kyushu_jomon 48300
8 chikuzen 筑前 3 4 20 2664 5 0.001 kyushu_jomon 112000
9 buzen 豊前 3 4 20 1122 0 0.001 kyushu_jomon 47200
10 iki 壱岐 3 4 20 288 0 0.001 kyushu_jomon 12100
11 tsushima 対馬 3 4 20 234 0 0.001 kyushu_jomon 9900
12 nagato 長門 5 4 20 976 0 0 chugoku_jomon 43900
13 suo 周防 5 4 20 1098 0 0 chugoku_jomon 49400
14 aki 安芸 5 4 20 1540 0 0 chugoku_jomon 69200
15 bingo 備後 5 4 20 1588 0 0 chugoku_jomon 71400
16 bitchu 備中 5 4 20 1760 0 0 chugoku_jomon 79100
17 mimasaka 美作 5 4 20 1564 0 0 chugoku_jomon 70300
18 bizen 備前 5 4 20 1246 0 0 chugoku_jomon 56000
19 harima 播磨 7 4 20 2358 0 0 kinki_jomon 107600
20 iwami 石見 6 4 20 410 0 0 chugoku_jomon 40600
21 izumo 出雲 6 4 20 866 0 0 chugoku_jomon 85700
22 hoki 伯耆 6 4 20 532 0 0 chugoku_jomon 52700
23 oki 隠岐 6 4 20 132 0 0 chugoku_jomon 13200
24 inaba 因幡 6 4 20 554 0 0 chugoku_jomon 54900
25 tajima 但馬 6 4 20 654 0 0 chugoku_jomon 64800
26 tango 丹後 6 4 20 388 0 0 chugoku_jomon 38400
27 tanba 丹波 7 4 20 1636 0 0 kinki_jomon 74700
28 iyo 伊予 4 4 20 1726 0 0 shikoku_jomon 79100
29 tosa 土佐 4 4 20 1030 0 0 shikoku_jomon 47200
30 awa 阿波 4 4 20 1102 0 0 shikoku_jomon 50500
31 sanuki 讃岐 4 4 20 2158 0 0 shikoku_jomon 98800
32 awaji 淡路 7 4 20 408 0 0 kinki_jomon 18700
33 kii 紀伊 7 4 20 1346 0 0 kinki_jomon 61500
34 yamato 大和 8 4 20 2266 0 0 kinki_jomon 171700
35 kawachi 河内 8 4 20 1160 0 0 kinki_jomon 87900
36 yamashiro 山城 8 4 20 1130 0 0 kinki_jomon 85700
37 izumi 和泉 8 4 20 348 0 0 kinki_jomon 26400
38 settsu 摂津 8 4 20 1130 0 0 kinki_jomon 85700
39 wakasa 若狭 11 4 20 378 0 0 chubu_jomon 23100
40 echizen 越前 11 4 20 990 0 0 chubu_jomon 60400
41 kaga 加賀 11 4 20 538 0 0 chubu_jomon 32900
42 etchu 越中 11 4 20 754 0 0 chubu_jomon 46100
43 noto 能登 11 4 20 468 0 0 chubu_jomon 28600
44 echigo 越後 11 4 20 610 0 0 chubu_jomon 37300
45 sado 佐渡 11 4 20 396 0 0 chubu_jomon 24200
46 shima 志摩 7 4 20 3374 0 0 kinki_jomon 154000
47 ise 伊勢 7 4 20 2260 0 0 kinki_jomon 103200
48 iga 伊賀 7 4 20 432 0 0 kinki_jomon 19800
49 owari 尾張 9 4 20 1686 0 0 chubu_jomon 75800
50 mikawa 参河 9 4 20 1686 0 0 chubu_jomon 75800
51 totomi 遠江 9 4 20 2346 0 0 chubu_jomon 105400
52 suruga 駿河 9 4 20 1442 0 0 chubu_jomon 64800
53 izu 伊豆 9 4 20 514 0 0 chubu_jomon 23100
54 kai 甲斐 10 4 20 4746 0 0 chubu_jomon 34000
55 sagami 相模 12 4 20 2078 0 0 kanto_jomon 73600
56 musashi 武蔵 12 4 20 3690 0 0 kanto_jomon 130700
57 shimosa 下総 12 4 20 2820 0 0 kanto_jomon 99900
58 kazusa 上総 12 4 20 2358 0 0 kanto_jomon 83500
59 awa1 安房 12 4 20 990 0 0 kanto_jomon 35100
60 hitachi 常陸 13 4 20 3698 0 0 kanto_jomon 168000
61 omi 近江 7 4 20 2236 0 0 kinki_jomon 102100
62 mino 美濃 9 4 20 3202 0 0 chubu_jomon 143900
63 hida 飛騨 10 4 20 1996 0 0 chubu_jomon 14300
64 shinano 信濃 10 4 20 10276 0 0 chubu_jomon 73600
65 kozuke 上野 13 4 20 2466 0 0 kanto_jomon 112000
66 shimotsuke 下野 13 4 20 1692 0 0 kanto_jomon 76900
67 mutsu 陸奥 15 4 20 5740 0 0 tohoku_jomon 206500
68 dewa 出羽 14 4 20 940 0 0 tohoku_jomon 78000
69 ezo_honshu 蝦夷(本州) 15 4 20 2000 0 0 tohoku_jomon 0
70 ezo_hokkaido 蝦夷(北海道) 16 4 20 0 0 0 hokkaido_jomon 0
71 ezo_chishima 蝦夷(千島列島) 16 4 20 0 0 0 hokkaido_jomon 0
72 ezo_karafuto 蝦夷(樺太) 16 4 20 0 0 0 hokkaido_jomon 0
73 toraijin_land 渡来人 0 0 0 0 0 0 toraijin 0
74 null_a 0 4 20 0 0 0 0
75 null_b 0 4 20 0 0 0 0
76 null_c 0 4 20 0 0 0 0
77 null_d 0 4 20 0 0 0 0
78 null_e 0 4 20 0 0 0 0
79 null_f 0 4 20 0 0 0 0
80 null_g 0 4 20 0 0 0 0
81 null_h 0 4 20 0 0 0 0
82 null_i 0 4 20 0 0 0 0
83 null_j 0 4 20 0 0 0 0
84 null_k 0 4 20 0 0 0 0
85 null_l 0 4 20 0 0 0 0
86 null_m 0 4 20 0 0 0 0
87 null_n 0 4 20 0 0 0 0
88 ogasawara 小笠原諸島 1 4 20 0 0 0 southern_islands_jomon 0
89 izu1 伊豆諸島 1 4 20 0 0 0 southern_islands_jomon 0
90 ryukyu 琉球諸島 1 4 20 0 0 0 southern_islands_jomon 0
102 changes: 102 additions & 0 deletions Data/Simulations/Sample/LifeSpan.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
age jomon_male_ndx jomon_female_ndx yayoi_male_ndx yayoi_female_ndx
0 30 30 30 30
1 2.437705134 2.422221692 2.391664237 2.402062336
2 1.78945613 1.783878323 1.783796459 1.784209906
3 1.334924021 1.334230387 1.348162321 1.343924269
4 1.018727091 1.020392441 1.037648899 1.032267532
5 0.802479272 0.80361532 0.817713344 0.81334164
6 0.655778375 0.655791861 0.663089697 0.660941915
7 0.556825112 0.555287235 0.554270665 0.554839259
8 0.486852049 0.483506373 0.475012313 0.477999064
9 0.431286386 0.427241682 0.413921596 0.418442538
10 0.379890123 0.375480512 0.36199534 0.366542513
11 0.326440371 0.323371647 0.314746101 0.317706727
12 0.273664438 0.272972387 0.272283859 0.272645501
13 0.227152567 0.228494286 0.236388819 0.233889181
14 0.193239192 0.196509734 0.211201647 0.206382746
15 0.176802932 0.18083179 0.199790013 0.193499826
16 0.181770948 0.186105135 0.206235376 0.199596173
17 0.218122631 0.221631598 0.237455448 0.232445229
18 0.30687301 0.305921021 0.303795888 0.30494173
19 0.494121381 0.479514382 0.423414456 0.441616446
20 0.851916615 0.794502894 0.608177675 0.664244346
21 1.424597695 1.281297953 0.847014532 0.969428944
22 2.123243782 1.853118085 1.083143842 1.288936974
23 2.640908518 2.259568974 1.22334685 1.491187448
24 2.734948092 2.339028266 1.234072146 1.516167154
25 2.478298002 2.12678264 1.144802036 1.396951423
26 2.103173353 1.827071636 1.030797587 1.238265276
27 1.807526449 1.593703948 0.949286702 1.119640269
28 1.645967406 1.463937761 0.913807667 1.06056258
29 1.613966771 1.443971372 0.926131516 1.064434539
30 1.691364255 1.507964485 0.966798629 1.110491657
31 1.842519231 1.627588623 1.010207701 1.172278342
32 2.029201896 1.767595875 1.034218125 1.223660583
33 2.200065547 1.884478782 1.022731479 1.241001967
34 2.306966127 1.94995506 0.987397994 1.227020118
35 2.319052333 1.948511324 0.949396937 1.196497467
36 2.231009411 1.887497335 0.933648277 1.172451165
37 2.063633009 1.784747726 0.963244019 1.176417896
38 1.849662209 1.659019816 1.04782017 1.214855668
39 1.623028808 1.526338079 1.194627061 1.288402816
40 1.409226715 1.397704032 1.39062875 1.382478267
41 1.22406508 1.28002472 1.59882713 1.472219417
42 1.072568002 1.175990741 1.768753534 1.533158667
43 0.953597564 1.086158829 1.846739038 1.544598672
44 0.863205559 1.009154763 1.823708068 1.507486837
45 0.796424567 0.943210818 1.725908514 1.436095705
46 0.749309739 0.887546418 1.59950999 1.352446875
47 0.718824301 0.842064123 1.487330769 1.277532464
48 0.70337853 0.809176925 1.410961593 1.224237062
49 0.702602234 0.792330015 1.381409887 1.200891855
50 0.716481905 0.795683896 1.400848971 1.211375297
51 0.745044982 0.824016534 1.468668084 1.258048175
52 0.785880921 0.876845521 1.577337844 1.336813219
53 0.832274594 0.948785429 1.710513546 1.436872811
54 0.871980345 1.020808086 1.833807319 1.532328581
55 0.88658257 1.061135757 1.896968739 1.584047052
56 0.859087487 1.039919578 1.854514709 1.556154509
57 0.78152153 0.943786462 1.687737838 1.431629198
58 0.662597209 0.794674622 1.427898664 1.232892595
59 0.524652985 0.630252194 1.132974556 1.003536444
60 0.391348654 0.481811993 0.857017245 0.785181167
61 0.278968582 0.364634353 0.630198421 0.602655117
62 0.192746591 0.279339354 0.460086918 0.462847725
63 0.130716415 0.220847284 0.340958277 0.362712193
64 0.087911997 0.183030724 0.262283331 0.295399004
65 0.059083993 0.161032325 0.214369145 0.254453411
66 0.03986605 0.151187331 0.188891595 0.234103668
67 0.027049047 0.151098625 0.180480534 0.230453855
68 0.018460498 0.158379372 0.184924333 0.239679595
69 0.041234224 0.169434873 0.197510171 0.256281492
70 0.000146375 0.179075981 0.211901598 0.27228928
71 0.00000007768994035 0.180407873 0.218595877 0.276492496
72 0 0.169943384 0.21114322 0.262516494
73 0 0.149624169 0.189768335 0.232502444
74 0 0.12507817 0.160752581 0.194993998
75 0 0.102442262 0.13245485 0.159883167
76 0 0.084464904 0.109194615 0.131786838
77 0 0.071653458 0.092215395 0.111703462
78 0 0.063141588 0.080656337 0.09834685
79 0 0.057478158 0.072738066 0.089451728
80 0 0.053460216 0.066959162 0.083130151
81 0 0.049932576 0.061891463 0.077563894
82 0 0.046228586 0.05673737 0.071709793
83 0 0.042162199 0.051288511 0.065285754
84 0 0.037846429 0.045683276 0.058480348
85 0 0.03364408 0.040334494 0.051869619
86 0 0.029812584 0.035519858 0.045857162
87 0 0.026495249 0.031379928 0.040662453
88 0 0.023703378 0.02790621 0.036297154
89 0 0.021337669 0.024969709 0.032601186
90 0 0.019294027 0.022441381 0.029409245
91 0 0.01746355 0.020191846 0.026550903
92 0 0.01577806 0.018140045 0.023920666
93 0 0.014211485 0.016252987 0.021479294
94 0 0.012756934 0.014519076 0.019217095
95 0 0.011425773 0.012946487 0.01715196
96 0 0.010223948 0.01153748 0.015292617
97 0 0.009150679 0.010287199 0.013636824
98 0 0.008198401 0.00918395 0.012171745
99 0 0.007352375 0.008208899 0.010873638
100 0 0.06246772 0.069174862 0.088069649
4 changes: 2 additions & 2 deletions Data/Simulations/Settings.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ birthable_age_min 15 出産の最小可能年齢(歳)
birthable_age_max 50 出産の最大可能年齢(歳)
#Childbirth -------------------- #出産 --------------------------------------------------
birth_interval 10 妊娠から出産までのStep間隔(step)
hunter_gatherer_stillbirth_rate 0.18 狩猟採集死産率
farming_stillbirth_rate 0.16 水田稲作死産率
hunter_gatherer_stillbirth_rate 0 狩猟採集死産率
farming_stillbirth_rate 0 水田稲作死産率
child_agriculture_priority 0.7 片親が農耕文化を持ち、もう一方の片親が農耕文化を持たない時の農耕文化継承の優先度
#Movement -------------------- #移動 --------------------------------------------------
max_hunter_gatherer_settlement_population 25 狩猟採集集落の最大人数(人)
Expand Down
2 changes: 1 addition & 1 deletion Library/PAX_MAHOROBA/Main.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[License] Distributed under the CC0 1.0. https://creativecommons.org/publicdomain/zero/1.0/

##########################################################################################*/

//#define PAXS_DEVELOPMENT
#ifndef PAX_MAHOROBA_MAIN_HPP
#define PAX_MAHOROBA_MAIN_HPP

Expand Down
4 changes: 2 additions & 2 deletions Library/PAX_SAPIENTICA/Simulation/Environment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ namespace paxs {
/// @brief Get the land position list.
/// @brief 陸の位置リストの取得
void getLandPositions(std::vector<DataGridsType>& keys) const {
std::get<Data<std::uint_least8_t>>(*data_map.at(MurMur3::calcHash("district"))).getKeys(keys);
std::get<Data<std::uint_least8_t>>(*data_map.at(SimulationConstants::getInstance()->land_key)).getKeys(keys);
}

/// @brief Is it possible to live?
Expand Down Expand Up @@ -161,7 +161,7 @@ namespace paxs {
/// @brief 陸地かどうかの判定
virtual bool isLand(const Vector2& position) const noexcept {
try {
auto value = getData<std::uint_least8_t>(MurMur3::calcHash("district"), position);
auto value = getData<std::uint_least8_t>(SimulationConstants::getInstance()->land_key, position);
return static_cast<int>(value) >= static_cast<int>(1);
}
catch (const std::exception&) {
Expand Down
Loading