A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
sim: the absorb-first scenario completes the absorb objective (refs #738) (#1196)
Eyal Golanfbd466e6b97f
diff --git a/changelog.d/scenario-absorb-first-738.md b/changelog.d/scenario-absorb-first-738.mdnew file mode 100644index 000000000..1bf94062b--- /dev/null+++ b/changelog.d/scenario-absorb-first-738.md@@ -0,0 +1 @@+- Extend the absorb-first scenario through completion of the immigrant-absorption objective.diff --git a/docs/determinism.md b/docs/determinism.mdindex 29f5455f2..5cdb49224 100644--- a/docs/determinism.md+++ b/docs/determinism.md@@ -87,7 +87,7 @@ fails too. To add one: write the file, run `STATECRAFT_UPDATE_GOLDEN=1 dotnet temanifest line and the snapshot), then run the tests plain. A scenario that moves is re-pinned with the hash goldens by the samecommand; its snapshot diff in the PR shows what moved, and the commit message says why. All four play the real content.`cautious` and `reckless` stay in 1948, so they move only when a 1948 rule or event does; `mvp-absorb-first` (GDD Phase 1-PR 3) fills Tel Aviv's jobs on the first turn and plays to 15 June 1949; `mvp-defeat` (GDD Phase 7 PR 5) overspends and+PR 3) fills Tel Aviv's jobs on the first turn and completes the absorb objective on 15 January 1950; `mvp-defeat` (GDD Phase 7 PR 5) overspends andturns down every source of foreign currency until Money and Food run out, and ends in `defeat_economy` (R-END-002).**MVP goldens after the cutover.** The real game is the GDD game, so every golden above is an MVP golden. Each PR that@@ -320,3 +320,4 @@ The hash reads the state keys, so it never sees a record outside its window. An| Phase 7 PR 4 carry canonical fix | 1950 | `e3c76f5f` | Nonzero site and city-project carry is written as IEEE bits, consistently on .NET and Unity Mono, instead of runtime-dependent round-trip decimal text. Only canonical representation changes; the stored progress, all other snapshot lines, completion dates and gameplay are unchanged (was `25ea8fbf`). || Phase 7 PR 4 carry canonical fix | 1952 | `37866907` | Nonzero site and city-project carry is written as IEEE bits, consistently on .NET and Unity Mono, instead of runtime-dependent round-trip decimal text. Only canonical representation changes; the stored progress, all other snapshot lines, completion dates and gameplay are unchanged (was `ef8c5fea`). || Phase 7 PR 4 carry canonical fix | mvp-end | `37866907` | Nonzero site and city-project carry is written as IEEE bits, consistently on .NET and Unity Mono, instead of runtime-dependent round-trip decimal text. Only canonical representation changes; the stored progress, all other snapshot lines, completion dates and gameplay are unchanged (was `ef8c5fea`). |+| #738 remaining scenario step | scenario-mvp-absorb-first | `c045ea90` | extends the run to 15 January 1950 so it completes `absorb_immigrants` (R-OBJ-004): two halutz cohorts free city housing, fourteen housing projects take the overflow and two industry projects raise employment, using only existing commands (was `234e32ee`) |diff --git a/sim/Statecraft.Sim.Tests/ScenarioTests.cs b/sim/Statecraft.Sim.Tests/ScenarioTests.csindex c4ac0242c..358228bbf 100644--- a/sim/Statecraft.Sim.Tests/ScenarioTests.cs+++ b/sim/Statecraft.Sim.Tests/ScenarioTests.cs@@ -89,6 +89,16 @@ public class ScenarioTestsAssert.Equal(90, sc.Play(For(sc)).Cities["tel_aviv"].Employed);}+ // R-OBJ-004: the absorb-first scenario reaches the million-person gate with no more than 10% overflow and at least+ // 40% of civilians employed, so the objective is complete in the scenario's final state (#738).+ [Fact]+ public void TheMvpScenarioCompletesTheAbsorbObjective()+ {+ var sc = Scenario.Parse(File.ReadAllText(Path.Combine(Dir(), "mvp-absorb-first.yaml")));+ var s = sc.Play(For(sc));+ Assert.Equal(new DateTime(1950, 1, 15), s.Objectives["absorb_immigrants"]);+ }+/// <summary>The `content: mvp` key went with the overlay at the cutover: a scenario that still names it fails to parse.</summary>[Fact]public void TheRetiredContentKeyIsRefused() =>diff --git a/sim/Statecraft.Sim.Tests/golden/manifest.txt b/sim/Statecraft.Sim.Tests/golden/manifest.txtindex bdf3f4590..e790fc0dc 100644--- a/sim/Statecraft.Sim.Tests/golden/manifest.txt+++ b/sim/Statecraft.Sim.Tests/golden/manifest.txt@@ -7,6 +7,6 @@ hash1952 37866907babc55e9477320db32467d1314aa59c8fe86d4d4ad82d8db61731fdesmoke5 8d000459d26a08a49583adfc88c14799ce6e6f653dcecff1e30b5e737f0959aascenario-reckless d7dbcf75d3767cf2de0621de15f67c37068363060e3a0267cc185a590d01fe2dscenario-cautious 9a3d241ece9c896367c75c66e094019cd9b8e946bd14f7b083b19a3b483301ee-scenario-mvp-absorb-first 234e32ee5219b7cc8f4a9e7a03c16c9f408b54c2ffe34e0face14cd1a2be4fbb+scenario-mvp-absorb-first c045ea9023a7afa2743162d5f7517fbdf7b12156fe64201394fdb3cf6e83eb94mvp-end 37866907babc55e9477320db32467d1314aa59c8fe86d4d4ad82d8db61731fdescenario-mvp-defeat f3daaa70500cf86e741f5cc32475f9aa78d3b73b93fa87911f69e72f35a61eabdiff --git a/sim/Statecraft.Sim.Tests/golden/scenario-mvp-absorb-first.txt b/sim/Statecraft.Sim.Tests/golden/scenario-mvp-absorb-first.txtindex 7b7c6a224..0e5e1ed70 100644--- a/sim/Statecraft.Sim.Tests/golden/scenario-mvp-absorb-first.txt+++ b/sim/Statecraft.Sim.Tests/golden/scenario-mvp-absorb-first.txt@@ -1,28 +1,28 @@-1949-06-15;11400714819323200433;Historical;13;+1950-01-15;11400714819323200433;Historical;20;ind{- food_supply=0.7200000000000001 [3FE70A3D70A3D70B]- housing=0.3475166797185584 [3FD63DB6998D2A6E]- intl_standing=0.7600000000000002 [3FE851EB851EB854]- morale=0.49803308924391254 [3FDFDFC62DA83896]- security=0.500599903035164 [3FE004EA167D566E]+ food_supply=0.8886718750000001 [3FEC700000000001]+ housing=0.4168186644627783 [3FDAAD28310EB8D1]+ intl_standing=0.8100000000000003 [3FE9EB851EB851EE]+ morale=0.5555776683207759 [3FE1C74AD17A6BDF]+ security=0.5042220244102726 [3FE022963A187B2A]pol{border_settlement=0.2 [3FC999999999999A]housing_construction=0.3 [3FD3333333333333]maabarot=0 [0000000000000000]rationing=1 [3FF0000000000000]eff{- border_villages_secure=0.03559990303516388 [3FA23A26868DB8BB]- building_houses=0.08114833839274943 [3FB4C62333858794]- food_lifts_cohesion=0.047495117187500005 [3FA85147AE147AE2]- homes_lift_morale=0.05778026214101628 [3FAD955FE07FFC50]- rationing_feeds=0.17 [3FC5C28F5C28F5C3]+ border_villages_secure=0.03922202441027243 [3FA414E8C040046D]+ building_houses=0.08452919104400287 [3FB5A3B47F17614D]+ food_lifts_cohesion=0.08774605560302737 [3FB67686872B020E]+ homes_lift_morale=0.06608777300513563 [3FB0EB20D7B8F7AC]+ rationing_feeds=0.33867187500000007 [3FD5ACCCCCCCCCCE]rationing_grates=-0.15 [BFC3333333333333]- safety_lifts_morale=0.049817294571876544 [3FA981A705EC3DAE]- work_lifts_cohesion=0.032940415343519776 [3FA0DD90ED3BF121]+ safety_lifts_morale=0.050367774522404846 [3FA9C9CE10B12AF4]+ work_lifts_cohesion=0.04137606519020815 [3FA52F3E5DA880D9]shift{food_supply=0.15000000000000002 [3FC3333333333334]housing=0 [0000000000000000]- intl_standing=0.26000000000000023 [3FD0A3D70A3D70A8]+ intl_standing=0.3100000000000003 [3FD3D70A3D70A3DC]morale=-0.09000000000000008 [BFB70A3D70A3D710]security=0.16500000000000015 [3FC51EB851EB8524]bud{@@ -35,29 +35,32 @@ bud{labour_minister=0.1 [3FB999999999999A]prime_minister=0.15 [3FC3333333333333]pop{- africa=26076.53167905079 [40D97722070791C7]- america_oceania=1128.7559880551275 [4091A30621BB93C2]- asia=37290.593872499 [40E235530100E626]- europe=132807.37455827303 [4100363AFF186869]- unknown=14597.23556687349 [40CC829E270E28D5]- veterans=661390.4179891739 [41242F1CD602AD50]+ africa=48923.0534756348 [40E7E361B61288D3]+ america_oceania=1997.5820321044844 [409F3654003957EE]+ asia=79306.74669995306 [40F35CABF27BA665]+ europe=204367.90335393153 [4108F27F3A11A045]+ unknown=18021.68780893306 [40D1996C050FC259]+ veterans=667938.2378207468 [4124624479C3A414]sit[treasury=0 [0000000000000000]-debt=59.72606782031707 [404DDCEFCA53784C]-fx=94.29191537516759 [405792AEBDD362D7]+debt=316.4253282829867 [4073C6CE250797DE]+fx=94.52989672613671 [4057A1E9D3F540F0]rung=2;cf=0;mob=0.8 [3FE999999999999A]-stab=0.5736568241454453 [3FE25B658E5A9F03]+stab=0.5662904231863636 [3FE21F0D17F3F327]att=4 [4010000000000000]fired[+ absorb_immigrantsaltalenaarmistice_egyptarmistice_jordanarmistice_lebanon+ armistice_syriaausterity_1949bernadotte_assassinationelections_1949first_truce+ frumkin_commissionidf_foundingjerusalem_ceasefirejerusalem_military_government@@ -70,11 +73,14 @@ fired[sinai_withdrawalten_dayspending[+ absorb_immigrants+ frumkin_commissionchosen{altalena=enforcearmistice_egypt=signarmistice_jordan=signarmistice_lebanon=sign+ armistice_syria=signausterity_1949=imposebernadotte_assassination=outlawelections_1949=hold@@ -93,20 +99,283 @@ chosen{appt{under=;map[-mapturn=0001-01-01:0;+mapturn=1949-02-15:1;over=city{- hadera=12,5,14,5,1,c0.30549450549450546 [3FD38D38D38D38D3]- haifa=99,42,119,42,5,c0.26271460756874115 [3FD0D050EDEC1C23]- jerusalem=84,29,101,29,5,c0.26099666612029404 [3FD0B42B5C568228]- netanya=12,5,13,5,2,c0.3153846153846153 [3FD42F42F42F42F3]- petah_tikva=22,10,26,10,2,c0.2899013377926421 [3FD28DBE5738B4FD]- rehovot=13,5,15,5,1,c0.29785714285714276 [3FD3101767DCE433]- rishon_lezion=10,5,11,5,2,c0.32272727272727275 [3FD4A7904A7904A8]+ hadera=17,5,17,5,1,c0.3140659340659341 [3FD419A800E674CE]+ haifa=114,47,147,47,4,c0.2679405853387653 [3FD125F044D34520]+ jerusalem=109,34,124,34,4,c0.41148744702792434 [3FDA55CF71ECC413]+ netanya=17,5,17,5,1,c0.3025274725274725 [3FD35C9C302968FC]+ petah_tikva=32,10,32,10,2,c0.3499013377926421 [3FD664C894A958D4]+ rehovot=18,5,18,5,2,c0.3078571428571427 [3FD3B3EE721A54D6]+ rishon_lezion=15,5,14,5,2,c0.26811188811188813 [3FD128BEC3C6FFEE]rosh_pinna=1,0,1,0,0,c0.35 [3FD6666666666666]safed=2,1,2,1,1,c0.35 [3FD6666666666666]- tel_aviv=248,106,301,90,11,c0.25696059790315773 [3FD0720ADD16B2E4],jobs=manual- tiberias=6,2,6,2,1,c0.35 [3FD6666666666666]+ tel_aviv=248,106,129,90,10,c0.35 [3FD6666666666666],jobs=manual+ tiberias=6,2,8,2,1,c0.18928571428571433 [3FC83A83A83A83AA]zikhron_yaakov=2,1,2,1,1,c0.35 [3FD6666666666666]-food=2556,852,0+units[+ 7:halutz@-3,19+ 8:halutz@-3,19+ 9:halutz@-3,19+ 10:halutz@-3,19+ 11:halutz@-3,19+ 12:halutz@-3,19+ 13:halutz@-3,19+ 14:halutz@-3,19+ 15:halutz@-3,19+ 16:halutz@-3,19+ 17:halutz@-3,19+ 18:halutz@-3,19+ 19:halutz@-3,19+ 20:halutz@-3,19+ 21:halutz@-3,19+ 22:halutz@-3,19+ 23:halutz@-3,19+ 24:halutz@-3,19+ 25:halutz@-3,19+ 26:halutz@-3,19+ 27:halutz@-3,19+ 28:halutz@-3,19+ 29:halutz@-3,19+ 30:halutz@-3,19+ 31:halutz@-3,19+ 32:halutz@-3,19+ 33:halutz@-3,19+ 34:halutz@-3,19+ 35:halutz@-3,19+ 36:halutz@-3,19+ 37:halutz@-3,19+ 38:halutz@-3,19+ 39:halutz@-3,19+ 40:halutz@-3,19+ 41:halutz@-3,19+ 42:halutz@-3,19+ 43:halutz@-3,19+ 44:halutz@-3,19+ 45:halutz@-3,19+ 46:halutz@-3,19+ 47:halutz@-3,19+ 48:halutz@-3,19+ 49:halutz@-3,19+ 50:halutz@-3,19+ 51:halutz@-3,19+ 52:halutz@-3,19+ 53:halutz@-3,19+ 54:halutz@-3,19+ 55:halutz@-3,19+ 56:halutz@-3,19+ 57:halutz@-3,19+ 58:halutz@-3,19+ 59:halutz@-3,19+ 60:halutz@-3,19+ 61:halutz@-3,19+ 62:halutz@-3,19+ 63:halutz@-3,19+ 64:halutz@-3,19+ 65:halutz@-3,19+ 66:halutz@-3,19+ 67:halutz@-3,19+ 68:halutz@-3,19+ 69:halutz@-3,19+ 70:halutz@-3,19+ 71:halutz@-3,19+ 72:halutz@-3,19+ 73:halutz@-3,19+ 74:halutz@-3,19+ 75:halutz@-3,19+ 76:halutz@-3,19+ 77:halutz@-3,19+ 78:halutz@-3,19+ 79:halutz@-3,19+ 80:halutz@-3,19+ 81:halutz@-3,19+ 82:halutz@-3,19+ 83:halutz@-3,19+ 84:halutz@-3,19+ 85:halutz@-3,19+ 86:halutz@-3,19+ 87:halutz@-3,19+ 88:halutz@-3,19+ 89:halutz@-3,19+ 90:halutz@-3,19+ 91:halutz@-3,19+ 92:halutz@-3,19+ 93:halutz@-3,19+ 94:halutz@-3,19+ 95:halutz@-3,19+ 96:halutz@-3,19+ 97:halutz@-3,19+ 98:halutz@-3,19+ 99:halutz@-3,19+ 100:halutz@-3,19+ 101:halutz@-3,19+ 102:halutz@-3,19+ 103:halutz@-3,19+ 104:halutz@-3,19+ 105:halutz@-3,19+ 106:halutz@-3,19+ 107:halutz@-3,19+ 108:halutz@-3,19+ 109:halutz@-3,19+ 110:halutz@-3,19+ 111:halutz@-3,19+ 112:halutz@-3,19+ 113:halutz@-3,19+ 114:halutz@-3,19+ 115:halutz@-3,19+ 116:halutz@-3,19+ 117:halutz@-3,19+ 118:halutz@-3,19+ 119:halutz@-3,19+ 120:halutz@-3,19+ 121:halutz@-3,19+ 122:halutz@-3,19+ 123:halutz@-3,19+ 124:halutz@-3,19+ 125:halutz@-3,19+ 126:halutz@-3,19+ 127:halutz@-3,19+ 128:halutz@-3,19+ 129:halutz@-3,19+ 130:halutz@-3,19+ 131:halutz@-3,19+ 132:halutz@-3,19+ 133:halutz@-3,19+ 134:halutz@-3,19+ 135:halutz@-3,19+ 136:halutz@-3,19+ 137:halutz@-3,19+ 138:halutz@-3,19+ 139:halutz@-3,19+ 140:halutz@-3,19+ 141:halutz@-3,19+ 142:halutz@-3,19+ 143:halutz@-3,19+ 144:halutz@-3,19+ 145:halutz@-3,19+ 146:halutz@-3,19+ 147:halutz@-3,19+ 148:halutz@-3,19+ 149:halutz@-3,19+ 150:halutz@-3,19+ 151:halutz@-3,19+ 152:halutz@-3,19+ 153:halutz@-3,19+ 154:halutz@-3,19+ 155:halutz@-3,19+ 156:halutz@-3,19+ 157:halutz@-3,19+ 158:halutz@-3,19+ 159:halutz@-3,19+ 160:halutz@-3,19+ 161:halutz@-3,19+ 162:halutz@-3,19+ 163:halutz@-3,19+ 164:halutz@-3,19+ 176:halutz@-3,19+ 177:halutz@-3,19+ 178:halutz@-3,19+ 179:halutz@-3,19+ 180:halutz@-3,19+ 181:halutz@-3,19+ 182:halutz@-3,19+ 183:halutz@-3,19+ 184:halutz@-3,19+ 185:halutz@-3,19+ 186:halutz@-3,19+ 187:halutz@-3,19+ 188:halutz@-3,19+ 189:halutz@-3,19+ 190:halutz@-3,19+ 191:halutz@-3,19+ 192:halutz@-3,19+ 193:halutz@-3,19+ 194:halutz@-3,19+ 195:halutz@-3,19+ 196:halutz@-3,19+ 197:halutz@-3,19+ 198:halutz@-3,19+ 199:halutz@-3,19+ 200:halutz@-3,19+ 201:halutz@-3,19+ 202:halutz@-3,19+ 203:halutz@-3,19+ 204:halutz@-3,19+ 205:halutz@-3,19+ 206:halutz@-3,19+ 207:halutz@-3,19+ 208:halutz@-3,19+ 209:halutz@-3,19+ 210:halutz@-3,19+ 211:halutz@-3,19+ 212:halutz@-3,19+ 213:halutz@-3,19+ 214:halutz@-3,19+ 215:halutz@-3,19+ 216:halutz@-3,19+ 217:halutz@-3,19+ 218:halutz@-3,19+ 219:halutz@-3,19+ 220:halutz@-3,19+ 221:halutz@-3,19+ 222:halutz@-3,19+ 223:halutz@-3,19+ 224:halutz@-3,19+ 225:halutz@-3,19+ 226:halutz@-3,19+ 227:halutz@-3,19+ 228:halutz@-3,19+ 229:halutz@-3,19+ 230:halutz@-3,19+ 231:halutz@-3,19+ 232:halutz@-3,19+ 233:halutz@-3,19+ 234:halutz@-3,19+ 235:halutz@-3,19+ 236:halutz@-3,19+ 237:halutz@-3,19+ 238:halutz@-3,19+ 239:halutz@-3,19+ 240:halutz@-3,19+ 241:halutz@-3,19+ 242:halutz@-3,19+ 243:halutz@-3,19+ 244:halutz@-3,19+ 245:halutz@-3,19+ 246:halutz@-3,19+ 247:halutz@-3,19+ 248:halutz@-3,19+ 249:halutz@-3,19+ 250:halutz@-3,19+ 251:halutz@-3,19+ 252:halutz@-3,19+ 253:halutz@-3,19+ 254:halutz@-3,19+ 255:halutz@-3,19+ 256:halutz@-3,19+ 257:halutz@-3,19+ 258:halutz@-3,19+cproj[+ 1:housing@haifa,5,8/done,1949-02-15+ 2:housing@haifa,4,9/done,1949-02-15+ 3:housing@haifa,5,9/done,1949-03-15+ 4:industry@haifa,6,8/done,1949-03-15+ 5:housing@jerusalem,0,22/done,1949-04-15+ 6:housing@jerusalem,1,22/done,1949-04-15+ 165:housing@jerusalem,-1,23/done,1949-05-15+ 166:housing@jerusalem,1,23/done,1949-06-15+ 167:industry@jerusalem,-1,24/done,1949-06-15+ 168:housing@petah_tikva,-2,18/done,1949-07-15+ 169:housing@petah_tikva,-1,18/done,1949-07-15+ 170:housing@rehovot,-4,20/done,1949-08-15+ 171:housing@hadera,2,12/done,1949-08-15+ 172:housing@netanya,0,15/done,1949-09-15+ 173:housing@jerusalem,0,23/done,1949-09-15+ 174:housing@rishon_lezion,-4,21/done,1949-10-15+next=259+obj{+ absorb_immigrants=1950-01-15+score=100+food=3003,1001,0arms=12\ No newline at end of filediff --git a/sim/Statecraft.Sim.Tests/scenarios/mvp-absorb-first.yaml b/sim/Statecraft.Sim.Tests/scenarios/mvp-absorb-first.yamlindex f703ae65b..c80d2f442 100644--- a/sim/Statecraft.Sim.Tests/scenarios/mvp-absorb-first.yaml+++ b/sim/Statecraft.Sim.Tests/scenarios/mvp-absorb-first.yaml@@ -1,9 +1,48 @@-# A player who puts the city's people to work first (GDD Phase 1 PR 3): on the first turn it fills Tel Aviv's 90 jobs, then-# plays on with no other order; events nobody answered are delegated. It plays the real content (the GDD loop since the+# A player who puts the city's people to work first (GDD Phase 1 PR 3), then uses the existing absorption tools to complete+# R-OBJ-004: halutz training frees city housing when it finishes (R-HOUSE-003), housing projects add capacity and industry+# projects add jobs (R-PROJ-003). Events nobody answered are delegated. It plays the real content (the GDD loop since the# cutover), so it moves whenever a GDD rule or design value it reaches changes.name: mvp-absorb-first-until: 1949-06-15+until: 1950-01-15steps:- on: 1948-05-15commands:- { kind: assign_workers, city: tel_aviv, role: job, count: 90 }+ - { kind: train, city: tel_aviv, track: halutz, count: 158 }+ - on: 1948-06-15+ commands:+ - { kind: start_project, project: housing, city: haifa, q: 5, r: 8 }+ - { kind: start_project, project: housing, city: haifa, q: 4, r: 9 }+ - on: 1948-07-15+ commands:+ - { kind: start_project, project: housing, city: haifa, q: 5, r: 9 }+ - { kind: start_project, project: industry, city: haifa, q: 6, r: 8 }+ - on: 1948-08-15+ commands:+ - { kind: start_project, project: housing, city: jerusalem, q: 0, r: 22 }+ - { kind: start_project, project: housing, city: jerusalem, q: 1, r: 22 }+ - on: 1948-09-15+ commands:+ - { kind: start_project, project: housing, city: jerusalem, q: -1, r: 23 }+ - on: 1948-10-15+ commands:+ - { kind: start_project, project: housing, city: jerusalem, q: 1, r: 23 }+ - { kind: start_project, project: industry, city: jerusalem, q: -1, r: 24 }+ - on: 1948-11-15+ commands:+ - { kind: start_project, project: housing, city: petah_tikva, q: -2, r: 18 }+ - { kind: start_project, project: housing, city: petah_tikva, q: -1, r: 18 }+ - on: 1948-12-15+ commands:+ - { kind: start_project, project: housing, city: rehovot, q: -4, r: 20 }+ - { kind: start_project, project: housing, city: hadera, q: 2, r: 12 }+ - on: 1949-01-15+ commands:+ - { kind: start_project, project: housing, city: netanya, q: 0, r: 15 }+ - { kind: start_project, project: housing, city: jerusalem, q: 0, r: 23 }+ - on: 1949-02-15+ commands:+ - { kind: start_project, project: housing, city: rishon_lezion, q: -4, r: 21 }+ - on: 1949-09-15+ commands:+ - { kind: train, city: tel_aviv, track: halutz, count: 83 }