Skip to content

Commit

Permalink
add: input mtDNA
Browse files Browse the repository at this point in the history
  • Loading branch information
AsPJT committed Jun 5, 2024
1 parent 0f991b3 commit 3d29642
Show file tree
Hide file tree
Showing 11 changed files with 501 additions and 101 deletions.
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 region min_pop_placed_per_cell max_pop_placed_per_cell init_pop immigrant
1 satsuma 2 4 20 2270 0
2 osumi 2 4 20 2400 0
3 hyuga 2 4 20 1820 0
4 higo 2 4 20 6426 0
5 bungo 3 4 20 1226 0
6 chikugo 3 4 20 1410 0
7 hizen 3 4 20 1148 0
8 chikuzen 3 4 20 2664 1
9 buzen 3 4 20 1122 0
10 iki 3 4 20 288 0
11 tsushima 3 4 20 234 0
12 nagato 5 4 20 976 0
13 suo 5 4 20 1098 0
14 aki 5 4 20 1540 0
15 bingo 5 4 20 1588 0
16 bitchu 5 4 20 1760 0
17 mimasaka 5 4 20 1564 0
18 bizen 5 4 20 1246 0
19 harima 7 4 20 2358 0
20 iwami 6 4 20 410 0
21 izumo 6 4 20 866 0
22 hoki 6 4 20 532 0
23 oki 6 4 20 132 0
24 inaba 6 4 20 554 0
25 tajima 6 4 20 654 0
26 tango 6 4 20 388 0
27 tanba 7 4 20 1636 0
28 iyo 4 4 20 1726 0
29 tosa 4 4 20 1030 0
30 awa 4 4 20 1102 0
31 sanuki 4 4 20 2158 0
32 awaji 7 4 20 408 0
33 kii 7 4 20 1346 0
34 yamato 8 4 20 2266 0
35 kawachi 8 4 20 1160 0
36 yamashiro 8 4 20 1130 0
37 izumi 8 4 20 348 0
38 settsu 8 4 20 1130 0
39 wakasa 11 4 20 378 0
40 echizen 11 4 20 990 0
41 kaga 11 4 20 538 0
42 etchu 11 4 20 754 0
43 noto 11 4 20 468 0
44 echigo 11 4 20 610 0
45 sado 11 4 20 396 0
46 shima 7 4 20 3374 0
47 ise 7 4 20 2260 0
48 iga 7 4 20 432 0
49 owari 9 4 20 1686 0
50 mikawa 9 4 20 1686 0
51 totomi 9 4 20 2346 0
52 suruga 9 4 20 1442 0
53 izu 9 4 20 514 0
54 kai 10 4 20 4746 0
55 sagami 12 4 20 2078 0
56 musashi 12 4 20 3690 0
57 shimosa 12 4 20 2820 0
58 kazusa 12 4 20 2358 0
59 awa1 12 4 20 990 0
60 hitachi 13 4 20 3698 0
61 omi 7 4 20 2236 0
62 mino 9 4 20 3202 0
63 hida 10 4 20 1996 0
64 shinano 10 4 20 10276 0
65 kozuke 13 4 20 2466 0
66 shimotsuke 13 4 20 1692 0
67 mutsu 15 4 20 5740 0
68 dewa 14 4 20 940 0
69 ezo_honshu 15 4 20 2000 0
70 ezo_hokkaido 16 4 20 0 0
71 ezo_chishima 16 4 20 0 0
72 ezo_karafuto 16 4 20 0 0
73 null1 0 4 20 0 0
74 null2 0 4 20 0 0
75 null3 0 4 20 0 0
76 null4 0 4 20 0 0
77 null5 0 4 20 0 0
78 null6 0 4 20 0 0
79 null7 0 4 20 0 0
80 null8 0 4 20 0 0
81 null9 0 4 20 0 0
82 null10 0 4 20 0 0
83 null11 0 4 20 0 0
84 null12 0 4 20 0 0
85 null13 0 4 20 0 0
86 null14 0 4 20 0 0
87 null15 0 4 20 0 0
88 ogasawara 1 4 20 0 0
89 izu1 1 4 20 0 0
90 ryukyu 1 4 20 0 0
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 100 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
12 changes: 12 additions & 0 deletions Data/Simulations/Sample/mtDNA.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
haplo_group_region haplo_dist
korea_jomon D4a/2/D4b/4/M7a/1/N/1
southern_islands_jomon M7a/6
kyushu_jomon M7a/21/M80/1/N9a/1/N9b/4
chugoku_jomon M7a/1
shikoku_jomon M7a/1/N9b/1
kinki_jomon N9b/1
chubu_jomon A/1/A4/1/D4b/1/G2/1/M7/1/M7a/3/M9a/3/N9b/7
kanto_jomon B4f/1/B5b/1/D4b/1/E1a/1/M7a/7/N/1/N9b/24
tohoku_jomon D4b/1/D4h/1/M7a/13/N9b/13
hokkaido_jomon D4h/6/M7a/3/N9b/19
toraijin B4a/2/B4c/8/B5a/1/B5b/2/D4/5/D4a/5/D4b/19/D4c/8/D4e/3/D4g/8/D4h/3/D4i/2/D4m/1/D5a/2/M7a/41/M9a/3/N9a/6
27 changes: 27 additions & 0 deletions Data/Simulations/Sample/mtDNA_List.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
mtdna
N9b
A
A4
B4f
E1a
G2
M80
N
M7
M9a
B5b
D4h
N9a
D4b
M7a
D4
B5a
B4c
B4a
D5a
D4m
D4i
D4g
D4e
D4c
D4a
113 changes: 113 additions & 0 deletions Data/Simulations/Sample/mtDNA_List2.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
mtdna
A
A*
A14
A15
A17
A18
A22
A4
A5a
A5b
B4*
B4a
B4b
B4c
B4d
B4e
B4f
B5*
B5a
B5b
B6a
C
C1a
C3
C4
C4a
C5
C5a
C5b
C5d
C7a
C7b
D4
D4*
D4a
D4b
D4c
D4d
D4e
D4g
D4h
D4i
D4j
D4l
D4m
D5a
D5b
D5c
E1*
E1a
F1a
F1b
F1d
F1g
F2g
F2h
F3a
F4a
G1a
G1b
G1c
G2
G2a
G2b
G3a
G3b
H11
H15
H2b
H5b
H6a
HV1
I1b
I4a
M
M*
M10
M11
M7
M7*
M71
M7a
M7b
M7c
M8*
M80
M8a
M9a
N
N9
N9a
N9b
R
R1b
R9
T1a
T2a
T2d
U1a
U2e
U4
U4a
U4c
U5a
U5b
Y
Y1a
Y1b
Z2
Z3
Z3a
Z4a
2 changes: 1 addition & 1 deletion Data/Simulations/Settings.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ male_marriageable_age_max 70 男性の最大結婚可能年齢(歳)
birthable_age_min 15 出産の最小可能年齢(歳)
birthable_age_max 50 出産の最大可能年齢(歳)
birth_interval 10 出産の間隔:10ヶ月(Step)
marriage_search_range 320 結婚時に近くの集落からエージェントを探す際の探索範囲
marriage_search_range 320 結婚時に近くの集落からエージェントを探す際の探索距離
grid_length 512 集落をグループ分けする際の1グリッド辺の長さ
max_settlement_population 80 集落の最大人数(人)
min_move_distance 10 最小移動距離
Expand Down
3 changes: 2 additions & 1 deletion Library/PAX_MAHOROBA/LocationPoint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,8 @@ namespace paxs {
// if (lli.lpe == MurMur3::calcHash("agent1"))
{
// const std::size_t pop_original = settlement.getFarmingPopulation(); // settlement.getPopulation();
const float pop_original = settlement.getFarmingPopulation() / float(settlement.getPopulation()) * 75.0f; // settlement.getPopulation();
//const float pop_original = settlement.getFarmingPopulation() / float(settlement.getPopulation()) * 75.0f; // settlement.getPopulation();
const float pop_original = settlement.getMostMtDNA() / 27.0f * 75.0f; // settlement.getPopulation();

const std::uint_least8_t pop = (pop_original >= 75) ? 75 : static_cast<std::uint_least8_t>(pop_original);
paxg::Circle(draw_pos,
Expand Down
11 changes: 11 additions & 0 deletions Library/PAX_SAPIENTICA/Simulation/Genome.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ namespace paxs {
genome.setYDNA(static_cast<std::uint_least8_t>(dist(engine)));
return genome;
}
static Genome generateRandomSetMtDNA(const std::uint_least8_t mtdna_) noexcept {
Genome genome;
genome.setChromosome(Chromosome::generateRandom());

std::random_device seed_gen;
std::mt19937 engine(seed_gen());
std::uniform_int_distribution<> dist((std::numeric_limits<std::uint_least8_t>::min)(), (std::numeric_limits<std::uint_least8_t>::max)());
genome.setMtDNA(mtdna_);
genome.setYDNA(static_cast<std::uint_least8_t>(dist(engine)));
return genome;
}

static Genome generateFromParents(const Genome& mother, const Genome& father) noexcept {
Genome genome;
Expand Down
Loading

0 comments on commit 3d29642

Please sign in to comment.