[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 82126296 2/3: Revert "Enforce minimum specamt
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 82126296 2/3: Revert "Enforce minimum specamt only conditionally" |
Date: |
Thu, 15 Sep 2022 21:24:59 -0400 (EDT) |
branch: master
commit 82126296ba38d02aefbbd0ab4fffcee9b3df541c
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Revert "Enforce minimum specamt only conditionally"
This reverts commit b4ad495a4dd7b9864bf1bce503f446535ed0b948,
retaining some documentary improvements.
As originally anticipated, this turned out to be a bad idea. It made
the code more complex, and hence more fragile, for little gain.
---
account_value.hpp | 3 +--
accountvalue.cpp | 6 ++----
ihs_acctval.cpp | 2 +-
ihs_avstrtgy.cpp | 7 +++----
4 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/account_value.hpp b/account_value.hpp
index bc49237f..5a212b88 100644
--- a/account_value.hpp
+++ b/account_value.hpp
@@ -209,8 +209,7 @@ class LMI_SO AccountValue final
currency SolveGuarPremium ();
- enum e_specamt_minimum_toggle {enforce_minimum, ignore_minimum};
- void PerformSpecAmtStrategy(e_specamt_minimum_toggle);
+ void PerformSpecAmtStrategy();
void PerformSupplAmtStrategy();
currency CalculateSpecAmtFromStrategy
(int actual_year
diff --git a/accountvalue.cpp b/accountvalue.cpp
index dbe560b5..be08621c 100644
--- a/accountvalue.cpp
+++ b/accountvalue.cpp
@@ -241,7 +241,7 @@ void AccountValue::RunOneCell(mcenum_run_basis TheBasis)
// designed to allow inforce loans.
AVUnloaned = InforceAVGenAcct;
- PerformSpecAmtStrategy(enforce_minimum);
+ PerformSpecAmtStrategy();
for(Year = InforceYear; Year < BasicValues::GetLength(); ++Year)
{
@@ -431,10 +431,8 @@ inline int AccountValue::MonthsToNextModalPmtDate() const
}
/// Set specamt according to selected strategy, in every year.
-///
-/// The argument is ignored because this code knows no minimum.
-void AccountValue::PerformSpecAmtStrategy(e_specamt_minimum_toggle)
+void AccountValue::PerformSpecAmtStrategy()
{
currency SA = C0;
switch(yare_input_.SpecifiedAmountStrategy[0])
diff --git a/ihs_acctval.cpp b/ihs_acctval.cpp
index 431fcbfc..bd263def 100644
--- a/ihs_acctval.cpp
+++ b/ihs_acctval.cpp
@@ -108,7 +108,7 @@ AccountValue::AccountValue(Input const& input)
{
SetInitialValues();
LMI_ASSERT(InforceYear < methuselah);
- PerformSpecAmtStrategy(enforce_minimum);
+ PerformSpecAmtStrategy();
PerformSupplAmtStrategy();
InvariantValues().Init(this);
diff --git a/ihs_avstrtgy.cpp b/ihs_avstrtgy.cpp
index a8ffdceb..58238dce 100644
--- a/ihs_avstrtgy.cpp
+++ b/ihs_avstrtgy.cpp
@@ -107,7 +107,7 @@ currency AccountValue::CalculateSpecAmtFromStrategy
throw "Unreachable--silences a compiler diagnostic.";
}
-/// Set specamt according to a strategy, optionally enforcing minimum.
+/// Set specamt according to selected strategy, respecting minimum.
///
/// The actual minimum, set dynamically, is ascertainable only during
/// monthiversary processing because, e.g., it may depend on whether
@@ -118,7 +118,7 @@ currency AccountValue::CalculateSpecAmtFromStrategy
/// input is erroneous; but apply the minimum silently if specamt is
/// to be calculated from a strategy, or if a solve is in progress.
-void AccountValue::PerformSpecAmtStrategy(e_specamt_minimum_toggle e)
+void AccountValue::PerformSpecAmtStrategy()
{
// Store original input specamt for first inforce year, for
// comparison below. Using DeathBfts_->specamt() here instead of
@@ -129,8 +129,7 @@ void
AccountValue::PerformSpecAmtStrategy(e_specamt_minimum_toggle e)
for(int j = 0; j < BasicValues::Length; ++j)
{
bool t = yare_input_.TermRider && 0.0 != yare_input_.TermRiderAmount;
- bool const ignore_min {ignore_minimum == e};
- currency m = ignore_min ? C0 : minimum_specified_amount(0 == j, t);
+ currency m = minimum_specified_amount(0 == j, t);
currency explicit_value = DeathBfts_->specamt()[j];
mcenum_sa_strategy strategy = yare_input_.SpecifiedAmountStrategy[j];
// Don't override a specamt that's being solved for.