lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [5288] Refactor


From: Greg Chicares
Subject: [lmi-commits] [5288] Refactor
Date: Thu, 15 Sep 2011 10:25:45 +0000

Revision: 5288
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=5288
Author:   chicares
Date:     2011-09-15 10:25:45 +0000 (Thu, 15 Sep 2011)
Log Message:
-----------
Refactor

Modified Paths:
--------------
    lmi/trunk/account_value.hpp
    lmi/trunk/ihs_avmly.cpp

Modified: lmi/trunk/account_value.hpp
===================================================================
--- lmi/trunk/account_value.hpp 2011-09-14 00:53:43 UTC (rev 5287)
+++ lmi/trunk/account_value.hpp 2011-09-15 10:25:45 UTC (rev 5288)
@@ -279,6 +279,7 @@
     int    MonthsToNextModalPmtDate() const;
     double anticipated_deduction   (mcenum_anticipated_deduction);
 
+    double minimum_specified_amount(bool issuing_now, bool term_rider) const;
     void   ChangeSpecAmtBy         (double delta);
     void   ChangeSurrChgSpecAmtBy  (double delta);
     void   AddSurrChgLayer         (int year, double delta_specamt);

Modified: lmi/trunk/ihs_avmly.cpp
===================================================================
--- lmi/trunk/ihs_avmly.cpp     2011-09-14 00:53:43 UTC (rev 5287)
+++ lmi/trunk/ihs_avmly.cpp     2011-09-15 10:25:45 UTC (rev 5288)
@@ -701,6 +701,21 @@
     return 1 + (11 - Month) % (12 / InvariantValues().EeMode[Year].value());
 }
 
+/// Determine instantaneous base-policy minimum specified amount.
+///
+/// Argument 'issuing_now' indicates whether the policy is being
+/// issued at the present moment: i.e., this is the first month of the
+/// first policy year (and therefore the policy is not in force yet).
+///
+/// Argument 'term_rider' indicates whether a term rider is to be
+/// taken into account, as that affects the base-policy minimum.
+
+double AccountValue::minimum_specified_amount(bool issuing_now, bool 
term_rider) const
+{
+(void)&issuing_now; // This argument hasn't been used yet, but should be.
+    return term_rider ? MinRenlBaseSpecAmt : MinRenlSpecAmt;
+}
+
 //============================================================================
 // All changes to SA must be handled here.
 // Proportionately reduce base and term SA if term rider present.
@@ -776,18 +791,11 @@
         ActualSpecAmt += delta;
         }
 
-    double min_spec_amt = 0.0;
-    if(TermRiderActive)
-        {
-        min_spec_amt = MinRenlBaseSpecAmt;
-        }
-    else
-        {
-        min_spec_amt = MinRenlSpecAmt;
-        }
-
     // If the minimum isn't met, then force it.
-    ActualSpecAmt = std::max(ActualSpecAmt, min_spec_amt);
+    ActualSpecAmt = std::max
+        (ActualSpecAmt
+        ,minimum_specified_amount(0 == Year && 0 == Month, TermRiderActive)
+        );
     ActualSpecAmt = round_specamt()(ActualSpecAmt);
     AddSurrChgLayer(Year, std::max(0.0, ActualSpecAmt - prior_specamt));
 
@@ -1013,7 +1021,6 @@
     double const old_specamt = DeathBfts_->specamt()[Year - 1];
 
     // Nothing to do if no increase or decrease requested.
-    // TODO ?? Minimum specified amount not completely enforced.
     // TODO ?? YearsSpecAmt != ActualSpecAmt; the latter should be used.
     if(YearsSpecAmt == old_specamt)
         {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]