From c6c04c1025e94e26d7b2f6f85d972a86d6d1e2e5 Mon Sep 17 00:00:00 2001 From: Jeremy Saklad Date: Thu, 17 Jun 2021 11:26:24 -0500 Subject: [PATCH] Count starting limbs in cost of adding joints Some torsos, notably the Headless Skeleton, come with pre-filled limbs that must be factored into the calculation. --- Bone Market Solver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bone Market Solver.py b/Bone Market Solver.py index d8ef422..a3a8a4c 100644 --- a/Bone Market Solver.py +++ b/Bone Market Solver.py @@ -1338,7 +1338,7 @@ def Solve(bone_market_fluctuations, zoological_mania, occasional_buyer = None, d add_joints = actions[Appendage.ADD_JOINTS] base_joints = model.NewIntVar(0, cp_model.INT32_MAX, 'base joints') - model.Add(base_joints == cp_model.LinearExpr.ScalProd([value for (key, value) in actions.items() if isinstance(key, Torso)], [torso.value.limbs_needed for torso in Torso])) + model.Add(base_joints == cp_model.LinearExpr.ScalProd([value for (key, value) in actions.items() if isinstance(key, Torso)], [torso.value.limbs_needed + torso.value.arms + torso.value.legs + torso.value.wings + torso.value.fins + torso.value.tentacles for torso in Torso])) add_joints_amber_cost_multiple = model.NewIntVar(0, cp_model.INT32_MAX, 'add joints amber cost multiple')