lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [5606] Set limits on COI-reentry date, replacing 20121024T


From: Greg Chicares
Subject: [lmi-commits] [5606] Set limits on COI-reentry date, replacing 20121024T1841Z prototype
Date: Tue, 27 Nov 2012 23:50:14 +0000

Revision: 5606
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=5606
Author:   chicares
Date:     2012-11-27 23:50:12 +0000 (Tue, 27 Nov 2012)
Log Message:
-----------
Set limits on COI-reentry date, replacing 20121024T1841Z prototype

Modified Paths:
--------------
    lmi/trunk/dbdict.cpp
    lmi/trunk/dbdict.hpp
    lmi/trunk/dbnames.hpp
    lmi/trunk/dbnames.xpp
    lmi/trunk/input_harmonization.cpp

Modified: lmi/trunk/dbdict.cpp
===================================================================
--- lmi/trunk/dbdict.cpp        2012-11-18 12:52:18 UTC (rev 5605)
+++ lmi/trunk/dbdict.cpp        2012-11-27 23:50:12 UTC (rev 5606)
@@ -31,6 +31,7 @@
 
 #include "alert.hpp"
 #include "assert_lmi.hpp"
+#include "calendar_date.hpp"            // gregorian_epoch(), last_yyyy_date()
 #include "data_directory.hpp"
 #include "dbnames.hpp"
 #include "global_settings.hpp"
@@ -172,6 +173,8 @@
     ascribe("SubstdTableMultTable", &DBDictionary::SubstdTableMultTable);
     ascribe("CoiUpper12Method"    , &DBDictionary::CoiUpper12Method    );
     ascribe("CoiInforceReentry"   , &DBDictionary::CoiInforceReentry   );
+    ascribe("CoiResetMinDate"     , &DBDictionary::CoiResetMinDate     );
+    ascribe("CoiResetMaxDate"     , &DBDictionary::CoiResetMaxDate     );
     ascribe("AllowMortBlendSex"   , &DBDictionary::AllowMortBlendSex   );
     ascribe("AllowMortBlendSmoke" , &DBDictionary::AllowMortBlendSmoke );
     ascribe("GuarInt"             , &DBDictionary::GuarInt             );
@@ -521,6 +524,10 @@
     Add(database_entity(DB_SurrChgSpecAmtSlope , 1.0));
     Add(database_entity(DB_SurrChgAcctValSlope , 1.0));
 
+    // These are the same as class date_trammel's nominal limits.
+    Add(database_entity(DB_CoiResetMinDate     , 
gregorian_epoch().julian_day_number()));
+    Add(database_entity(DB_CoiResetMaxDate     , last_yyyy_date 
().julian_day_number()));
+
     // Usually the maximum is a reciprocal, e.g., 1/11 or 1/12; for
     // greatest precision, store the reciprocal of that reciprocal,
     // e.g., 11 or 12.
@@ -901,6 +908,11 @@
         Add(database_entity(db_key_from_name(*i), 0.0));
         }
 
+    // These are the same as class date_trammel's nominal limits.
+    // They mustn't be zero.
+    Add(database_entity(DB_CoiResetMinDate     , 
gregorian_epoch().julian_day_number()));
+    Add(database_entity(DB_CoiResetMaxDate     , last_yyyy_date 
().julian_day_number()));
+
     Add(database_entity(DB_GuarInt, 0.03));
 
     Add(database_entity(DB_FixedLoanRate, 0.06));

Modified: lmi/trunk/dbdict.hpp
===================================================================
--- lmi/trunk/dbdict.hpp        2012-11-18 12:52:18 UTC (rev 5605)
+++ lmi/trunk/dbdict.hpp        2012-11-27 23:50:12 UTC (rev 5606)
@@ -149,6 +149,8 @@
     database_entity SubstdTableMultTable;
     database_entity CoiUpper12Method    ;
     database_entity CoiInforceReentry   ;
+    database_entity CoiResetMinDate     ;
+    database_entity CoiResetMaxDate     ;
     database_entity AllowMortBlendSex   ;
     database_entity AllowMortBlendSmoke ;
     database_entity GuarInt             ;

Modified: lmi/trunk/dbnames.hpp
===================================================================
--- lmi/trunk/dbnames.hpp       2012-11-18 12:52:18 UTC (rev 5605)
+++ lmi/trunk/dbnames.hpp       2012-11-27 23:50:12 UTC (rev 5606)
@@ -176,6 +176,8 @@
 
         ,DB_CoiUpper12Method
         ,DB_CoiInforceReentry
+        ,DB_CoiResetMinDate
+        ,DB_CoiResetMaxDate
 
         ,DB_AllowMortBlendSex
         ,DB_AllowMortBlendSmoke

Modified: lmi/trunk/dbnames.xpp
===================================================================
--- lmi/trunk/dbnames.xpp       2012-11-18 12:52:18 UTC (rev 5605)
+++ lmi/trunk/dbnames.xpp       2012-11-27 23:50:12 UTC (rev 5606)
@@ -82,6 +82,8 @@
 
{DB_SubstdTableMultTable,DB_Topic_MortalityCharges,"SubstdTableMultTable","Substandard
 table-rating multiplier applied to both guaranteed and current cost of 
insurance and term rider charges (index in mortality table database)",}, \
 {DB_CoiUpper12Method,DB_Topic_MortalityCharges,"CoiUpper12Method","Method to 
derive monthly from annual COI rates: 0=exponential, 1=linear [not yet 
implemented]",}, \
 {DB_CoiInforceReentry,DB_Topic_MortalityCharges,"CoiInforceReentry","Reenter 
COI table: 0=never, 1=at beginning of inforce year, 2=on anniversary >= input 
reset date",}, \
+{DB_CoiResetMinDate,DB_Topic_MortalityCharges,"CoiResetMinDate","Earliest 
permissible COI reset date",}, \
+{DB_CoiResetMaxDate,DB_Topic_MortalityCharges,"CoiResetMaxDate","Latest 
permissible COI reset date",}, \
 {DB_AllowMortBlendSex,DB_Topic_MortalityCharges,"AllowMortBlendSex","Mortality 
rating can be blended by gender: 0=no, 1=yes",}, \
 
{DB_AllowMortBlendSmoke,DB_Topic_MortalityCharges,"AllowMortBlendSmoke","Mortality
 rating can be blended by smoking/tobacco use: 0=no, 1=yes",}, \
 {DB_Topic_Interest,DB_FIRST,"Interest","Interest rates, limits, spreads, and 
bonuses",}, \

Modified: lmi/trunk/input_harmonization.cpp
===================================================================
--- lmi/trunk/input_harmonization.cpp   2012-11-18 12:52:18 UTC (rev 5605)
+++ lmi/trunk/input_harmonization.cpp   2012-11-27 23:50:12 UTC (rev 5606)
@@ -425,22 +425,18 @@
         );
     FlatExtra.enable(database_->Query(DB_AllowFlatExtras));
 
-    // DATABASE !! This temporary kludge will soon be replaced.
-    double const coimult = database_->Query(DB_CurrCoiMultiplier);
-    if(0.9029 < coimult && coimult < 0.9031 && 
!global_settings::instance().regression_testing())
+    calendar_date const most_recent_anniversary = add_years
+        (EffectiveDate.value()
+        ,InforceYear  .value()
+        ,true
+        );
+    calendar_date 
reset_min(jdn_t(static_cast<int>(database_->Query(DB_CoiResetMinDate))));
+    calendar_date 
reset_max(jdn_t(static_cast<int>(database_->Query(DB_CoiResetMaxDate))));
+    reset_max = std::min(reset_max, most_recent_anniversary);
+    if(!global_settings::instance().regression_testing())
         {
-        calendar_date const z(2009, 1, 1);
-        LastCoiReentryDate.minimum_and_maximum(z, z);
+        LastCoiReentryDate.minimum_and_maximum(reset_min, reset_max);
         }
-    else
-        {
-        calendar_date const most_recent_anniversary = add_years
-            (EffectiveDate.value()
-            ,InforceYear  .value()
-            ,true
-            );
-        LastCoiReentryDate.maximum(most_recent_anniversary);
-        }
     LastCoiReentryDate.enable(e_reenter_upon_rate_reset == 
database_->Query(DB_CoiInforceReentry));
 
     BlendGender.enable(database_->Query(DB_AllowMortBlendSex));




reply via email to

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