From 0c2a1a0515189084c62a1ecfe8d7572c21b83780 Mon Sep 17 00:00:00 2001 From: Jeremy Saklad Date: Mon, 22 Aug 2022 18:21:52 -0500 Subject: [PATCH] fix: Correct segmented ribcage cost When using a Segmented Ribcage as a tail, the cost in Nevercold Brass is calculated before the additional segment is taken into account. --- bonemarketsolver/solve.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bonemarketsolver/solve.py b/bonemarketsolver/solve.py index 9fdecd9..b84a8bd 100644 --- a/bonemarketsolver/solve.py +++ b/bonemarketsolver/solve.py @@ -337,8 +337,8 @@ def Solve(shadowy_level, bone_market_fluctuations = None, zoological_mania = Non add_segments = actions[Appendage.SEGMENTED_RIBCAGE] # Additional segments may be added once the torso and skulls are chosen, so the sum of their properties are the starting point. - base_segments = model.NewIntVar('base segments', lb = 0) - model.Add(base_segments == cp_model.LinearExpr.WeightedSum([value for (key, value) in actions.items() if isinstance(key, (Torso, Skull))], [action.value.segments for action in chain(Torso, Skull)])) + base_segments = model.NewIntVar('base segments', lb = -1) + model.Add(base_segments == cp_model.LinearExpr.WeightedSum([value for (key, value) in actions.items() if isinstance(key, (Torso, Skull))], [action.value.segments for action in chain(Torso, Skull)]) - 1) first_term, *_ = model.NewIntermediateIntVar( partialmethod(BoneMarketModel.AddMultiplicationEquality,