Changes
1 changed files (+3/-3)
-
-
@@ -523,7 +523,7 @@ -- Newly arrived at buildinglet payout := (← get).buildings[p.dest]!.payout modifyf money (· + (if p.isDelivery then 1000 * payout else 100)) if p.isDelivery then modifyf buildings (·.modify p.dest fun b ↦ { b with production := b.production + payout }) modifyf buildings (·.modify p.dest fun b ↦ { b with production := min (b.production + payout) 100 }) let mut p' := { p with dir := none } if p.dest == p.home then -- At home, go to work or consumer buildings
-
@@ -589,9 +589,9 @@ pure ()neighbors := neighbors.qsort (fun a b ↦ a.1 < b.1 || (a.1 == b.1 && a.2 < b.2)) let mut p' := p for (d, i) in neighbors do if d > neighbors[0]!.1 + 100 || d > 4 * neighbors[0]!.1 then if d > neighbors[0]!.1 + 100 || d > 5 * neighbors[0]!.1 then -- Don't move if this makes us take a really long detour -- TODO: better heuristic since this one can cause deadlocks -- TODO: better heuristic since this one can cause really bad deadlocks break let v := u.appd i if i < 27 then
-