From e0b070d2ebd59eb28eca98c57ddb74afb344951d Mon Sep 17 00:00:00 2001 From: Jeremy Saklad Date: Fri, 10 Sep 2021 20:55:41 -0500 Subject: [PATCH 1/3] Update Investment-Minded Ambassador The Ambassador now pays four-fifths of their previous secondary revenue. --- bonemarketsolver/solve.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/bonemarketsolver/solve.py b/bonemarketsolver/solve.py index 57bca6c..2f6b909 100644 --- a/bonemarketsolver/solve.py +++ b/bonemarketsolver/solve.py @@ -700,14 +700,24 @@ def Solve(shadowy_level, bone_market_fluctuations = None, zoological_mania = Non model.Add(skeleton_in_progress >= 100).OnlyEnforceIf(actions[Buyer.AN_INVESTMENT_MINDED_AMBASSADOR]) model.Add(antiquity > 0).OnlyEnforceIf(actions[Buyer.AN_INVESTMENT_MINDED_AMBASSADOR]) - antiquity_squared = model.NewIntVar(0, cp_model.INT32_MAX, '{}: {}'.format(Buyer.AN_INVESTMENT_MINDED_AMBASSADOR.name, 'antiquity squared')) - model.AddMultiplicationEquality(antiquity_squared, [antiquity, antiquity]) + antiquity_squared_times_four_fifths = model.NewIntVar(0, cp_model.INT32_MAX, '{}: {}'.format(Buyer.AN_INVESTMENT_MINDED_AMBASSADOR.name, 'antiquity squared times four-fifths')) + antiquity_squared_times_four = model.NewIntVar(0, cp_model.INT32_MAX, '{}: {}'.format(Buyer.AN_INVESTMENT_MINDED_AMBASSADOR.name, 'antiquity squared times four')) + model.AddGeneralMultiplicationEquality(antiquity_squared_times_four, antiquity, antiquity, 4) + model.AddDivisionEquality(antiquity_squared_times_four_fifths, antiquity_squared_times_four, 5) + del antiquity_squared_times_four tailfeathers = model.NewIntVar(cp_model.INT32_MIN, cp_model.INT32_MAX, '{}: {}'.format(Buyer.AN_INVESTMENT_MINDED_AMBASSADOR.name, 'tailfeathers')) if bone_market_fluctuations == Fluctuation.ANTIQUITY: - model.AddApproximateExponentiationEquality(tailfeathers, antiquity, 2.1, MAXIMUM_ATTRIBUTE) + boosted_antiquity = model.NewIntVar(0, cp_model.INT32_MAX, '{}: {}'.format(Buyer.AN_INVESTMENT_MINDED_AMBASSADOR.name, 'boosted antiquity')) + model.AddApproximateExponentiationEquality(boosted_antiquity, antiquity, 2.1, MAXIMUM_ATTRIBUTE) + boosted_antiquity_times_four = model.NewIntVar(0, cp_model.INT32_MAX, '{}: {}'.format(Buyer.AN_INVESTMENT_MINDED_AMBASSADOR.name, 'boosted antiquity times four')) + model.AddMultiplicationEquality(boosted_antiquity_times_four, [boosted_antiquity, 4]) + boosted_antiquity_times_four_fifths = model.NewIntVar(0, cp_model.INT32_MAX, '{}: {}'.format(Buyer.AN_INVESTMENT_MINDED_AMBASSADOR.name, 'boosted antiquity times four-fifths')) + model.AddDivisionEquality(boosted_antiquity_times_four_fifths, boosted_antiquity_times_four, 5) + model.Add(tailfeathers == boosted_antiquity_times_four_fifths).OnlyEnforceIf(actions[Buyer.AN_INVESTMENT_MINDED_AMBASSADOR]) + del boosted_antiquity, boosted_antiquity_times_four, boosted_antiquity_times_four_fifths else: - model.Add(tailfeathers == antiquity_squared).OnlyEnforceIf(actions[Buyer.AN_INVESTMENT_MINDED_AMBASSADOR]) + model.Add(tailfeathers == antiquity_squared_times_four_fifths).OnlyEnforceIf(actions[Buyer.AN_INVESTMENT_MINDED_AMBASSADOR]) value_remainder = model.NewIntVar(0, 49, '{}: {}'.format(Buyer.AN_INVESTMENT_MINDED_AMBASSADOR.name, 'value remainder')) model.AddModuloEquality(value_remainder, value, 50) @@ -720,10 +730,10 @@ def Solve(shadowy_level, bone_market_fluctuations = None, zoological_mania = Non # The indirection is necessary for applying an enforcement literal derived_exhaustion = model.NewIntVar(0, cp_model.INT32_MAX, '{}: {}'.format(Buyer.AN_INVESTMENT_MINDED_AMBASSADOR.name, 'derived exhaustion')) - model.AddDivisionEquality(derived_exhaustion, antiquity_squared, 20) + model.AddDivisionEquality(derived_exhaustion, antiquity_squared_times_four_fifths, 20) model.Add(added_exhaustion == derived_exhaustion).OnlyEnforceIf(actions[Buyer.AN_INVESTMENT_MINDED_AMBASSADOR]) - del antiquity_squared, tailfeathers, value_remainder, extra_value, derived_exhaustion + del antiquity_squared_times_four_fifths, tailfeathers, value_remainder, extra_value, derived_exhaustion # A Teller of Terrors From 479bad798bc43551c147c94a94b76de6c90ae886 Mon Sep 17 00:00:00 2001 From: Jeremy Saklad Date: Sat, 11 Sep 2021 12:08:29 -0500 Subject: [PATCH 2/3] Update Tentacled Entrepreneur The Entrepreneur now pays quadruple their previous secondary revenue. --- bonemarketsolver/solve.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bonemarketsolver/solve.py b/bonemarketsolver/solve.py index 2f6b909..94005b8 100644 --- a/bonemarketsolver/solve.py +++ b/bonemarketsolver/solve.py @@ -774,9 +774,12 @@ def Solve(shadowy_level, bone_market_fluctuations = None, zoological_mania = Non final_breaths = model.NewIntVar(cp_model.INT32_MIN, cp_model.INT32_MAX, '{}: {}'.format(Buyer.A_TENTACLED_ENTREPRENEUR.name, 'final breaths')) if bone_market_fluctuations == Fluctuation.AMALGAMY: - model.AddApproximateExponentiationEquality(final_breaths, amalgamy, 2.1, MAXIMUM_ATTRIBUTE) + boosted_amalgamy = model.NewIntVar(cp_model.INT32_MIN, cp_model.INT32_MAX, '{}: {}'.format(Buyer.A_TENTACLED_ENTREPRENEUR.name, 'boosted amalgamy')) + model.AddApproximateExponentiationEquality(boosted_amalgamy, amalgamy, 2.1, MAXIMUM_ATTRIBUTE) + model.Add(final_breaths == 4*boosted_amalgamy).OnlyEnforceIf(actions[Buyer.A_TENTACLED_ENTREPRENEUR]) + del boosted_amalgamy else: - model.Add(final_breaths == amalgamy_squared).OnlyEnforceIf(actions[Buyer.A_TENTACLED_ENTREPRENEUR]) + model.Add(final_breaths == 4*amalgamy_squared).OnlyEnforceIf(actions[Buyer.A_TENTACLED_ENTREPRENEUR]) value_remainder = model.NewIntVar(0, 49, '{}: {}'.format(Buyer.A_TENTACLED_ENTREPRENEUR.name, 'value remainder')) model.AddModuloEquality(value_remainder, value, 50) @@ -788,7 +791,7 @@ def Solve(shadowy_level, bone_market_fluctuations = None, zoological_mania = Non # The indirection is necessary for applying an enforcement literal derived_exhaustion = model.NewIntVar(0, cp_model.INT32_MAX, '{}: {}'.format(Buyer.A_TENTACLED_ENTREPRENEUR.name, 'derived exhaustion')) - model.AddDivisionEquality(derived_exhaustion, amalgamy_squared, 100) + model.AddDivisionEquality(derived_exhaustion, amalgamy_squared, 25) model.Add(added_exhaustion == derived_exhaustion).OnlyEnforceIf(actions[Buyer.A_TENTACLED_ENTREPRENEUR]) del amalgamy_squared, final_breaths, value_remainder, derived_exhaustion From 32531d2b587ed8172bc06a01a10806b63a01e34a Mon Sep 17 00:00:00 2001 From: Jeremy Saklad Date: Sat, 11 Sep 2021 13:03:05 -0500 Subject: [PATCH 3/3] Update Teller of Terrors The Teller now pays quadruple their previous secondary revenue. --- bonemarketsolver/solve.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bonemarketsolver/solve.py b/bonemarketsolver/solve.py index 94005b8..cc1732d 100644 --- a/bonemarketsolver/solve.py +++ b/bonemarketsolver/solve.py @@ -745,9 +745,12 @@ def Solve(shadowy_level, bone_market_fluctuations = None, zoological_mania = Non feathers = model.NewIntVar(cp_model.INT32_MIN, cp_model.INT32_MAX, '{}: {}'.format(Buyer.A_TELLER_OF_TERRORS.name, 'feathers')) if bone_market_fluctuations == Fluctuation.MENACE: - model.AddApproximateExponentiationEquality(feathers, menace, 2.1, MAXIMUM_ATTRIBUTE) + boosted_menace = model.NewIntVar(cp_model.INT32_MIN, cp_model.INT32_MAX, '{}: {}'.format(Buyer.A_TELLER_OF_TERRORS.name, 'boosted menace')) + model.AddApproximateExponentiationEquality(boosted_menace, menace, 2.1, MAXIMUM_ATTRIBUTE) + model.Add(feathers == 4*boosted_menace).OnlyEnforceIf(actions[Buyer.A_TELLER_OF_TERRORS]) + del boosted_menace else: - model.Add(feathers == menace_squared).OnlyEnforceIf(actions[Buyer.A_TELLER_OF_TERRORS]) + model.Add(feathers == 4*menace_squared).OnlyEnforceIf(actions[Buyer.A_TELLER_OF_TERRORS]) value_remainder = model.NewIntVar(0, 9, '{}: {}'.format(Buyer.A_TELLER_OF_TERRORS.name, 'value remainder')) model.AddModuloEquality(value_remainder, value, 10) @@ -759,7 +762,7 @@ def Solve(shadowy_level, bone_market_fluctuations = None, zoological_mania = Non # The indirection is necessary for applying an enforcement literal derived_exhaustion = model.NewIntVar(0, cp_model.INT32_MAX, '{}: {}'.format(Buyer.A_TELLER_OF_TERRORS.name, 'derived exhaustion')) - model.AddDivisionEquality(derived_exhaustion, menace_squared, 100) + model.AddDivisionEquality(derived_exhaustion, menace_squared, 25) model.Add(added_exhaustion == derived_exhaustion).OnlyEnforceIf(actions[Buyer.A_TELLER_OF_TERRORS]) del menace_squared, feathers, value_remainder, derived_exhaustion