[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 2c53668 4/4: Rename several input elements fo
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 2c53668 4/4: Rename several input elements for clarity |
Date: |
Mon, 2 Jul 2018 06:29:49 -0400 (EDT) |
branch: master
commit 2c5366801580ad7c87b0c376bf8e983d52c31569
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Rename several input elements for clarity
---
cell.rnc | 22 ++++++++--------
cell.xsd | 40 ++++++++++++++---------------
ihs_acctval.cpp | 2 +-
ihs_avsolve.cpp | 2 --
input.cpp | 20 +++++++--------
input.hpp | 11 ++++----
input_harmonization.cpp | 31 +++++++++++------------
input_realization.cpp | 6 ++---
input_xml_io.cpp | 67 +++++++++++++++++++++++++++++++++++++++++++------
main_cgi.cpp | 4 +--
sample.cns | 30 +++++++++++-----------
sample.ill | 10 ++++----
skin.xrc | 13 ++++------
skin_coli_boli.xrc | 8 +++---
skin_group_carveout.xrc | 10 ++++----
solve.cpp | 10 ++++----
yare_input.cpp | 2 +-
yare_input.hpp | 8 +++---
18 files changed, 169 insertions(+), 127 deletions(-)
diff --git a/cell.rnc b/cell.rnc
index cb2cca9..31920e3 100644
--- a/cell.rnc
+++ b/cell.rnc
@@ -369,12 +369,12 @@ cell_element = element cell
element SeparateAccountRateType {sep_acct_rate_type}
,## Insured's smoking or tobacco use.
element Smoking {smoking}
- ,## * Age at which a solve begins (inclusive).
- element SolveBeginTime {duration_int}
+ ,## * Age at which a solve begins (inclusive).
+ element SolveBeginAge {duration_int}
,## * Policy year in which a solve begins (inclusive).
element SolveBeginYear {duration_int}
,## * Age at which a solve ends (exclusive).
- element SolveEndTime {duration_int}
+ element SolveEndAge {duration_int}
,## * Policy year at which a solve ends (exclusive).
element SolveEndYear {duration_int}
,## * Expense and general-account basis for a solve: lmi permits
@@ -387,10 +387,10 @@ cell_element = element cell
element SolveSeparateAccountBasis {sep_basis}
,## * Solve goal.
element SolveTarget {solve_target}
- ,## * Cash surrender value used as solve goal.
- element SolveTargetCashSurrenderValue {nonnegative_double}
,## * Age at which a solve target is to be achieved.
- element SolveTargetTime {duration_int}
+ element SolveTargetAge {duration_int}
+ ,## * Cash surrender value used as solve goal.
+ element SolveTargetValue {nonnegative_double}
,## * Policy year in which a solve target is to be achieved.
element SolveTargetYear {duration_int}
,## * Point at which a solve target is to be achieved.
@@ -429,6 +429,11 @@ cell_element = element cell
element StateOfJurisdiction {state}
,## Substandard table rating.
element SubstandardTable {table_rating}
+ ,## Supplemental specified amount (e.g., individually-elected
+ ## extra coverage on a group plan) for each policy year since
+ ## issue. Inforce extracts require only the current scalar value.
+ ## Default: '0'.
+ element SupplementalAmount {specamt_sequence}
,## * Built-in supplemental illustration type.
element SupplementalIllustrationType {suppl_illus_type}
,## * User-designed supplemental illustration: first column.
@@ -455,11 +460,6 @@ cell_element = element cell
element SupplementalReportColumn10 {report_column}
,## * User-designed supplemental illustration: twelfth column.
element SupplementalReportColumn11 {report_column}
- ,## Supplemental specified amount (e.g., individually-elected
- ## extra coverage on a group plan) for each policy year since
- ## issue. Inforce extracts require only the current scalar value.
- ## Default: '0'.
- element SupplementalSpecifiedAmount {specamt_sequence}
,## * Presumed age at death, for partial mortality. Default: '99'.
element SurviveToAge {age_int}
,## * Presumed moment of death, for partial mortality.
diff --git a/cell.xsd b/cell.xsd
index f56d09f..ba8327f 100644
--- a/cell.xsd
+++ b/cell.xsd
@@ -173,16 +173,16 @@
<xs:element ref="SeparateAccountRate"/>
<xs:element ref="SeparateAccountRateType"/>
<xs:element ref="Smoking"/>
- <xs:element ref="SolveBeginTime"/>
+ <xs:element ref="SolveBeginAge"/>
<xs:element ref="SolveBeginYear"/>
- <xs:element ref="SolveEndTime"/>
+ <xs:element ref="SolveEndAge"/>
<xs:element ref="SolveEndYear"/>
<xs:element ref="SolveExpenseGeneralAccountBasis"/>
<xs:element ref="SolveFromWhich"/>
<xs:element ref="SolveSeparateAccountBasis"/>
<xs:element ref="SolveTarget"/>
- <xs:element ref="SolveTargetCashSurrenderValue"/>
- <xs:element ref="SolveTargetTime"/>
+ <xs:element ref="SolveTargetAge"/>
+ <xs:element ref="SolveTargetValue"/>
<xs:element ref="SolveTargetYear"/>
<xs:element ref="SolveTgtAtWhich"/>
<xs:element ref="SolveToWhich"/>
@@ -200,6 +200,7 @@
<xs:element ref="State"/>
<xs:element ref="StateOfJurisdiction"/>
<xs:element ref="SubstandardTable"/>
+ <xs:element ref="SupplementalAmount"/>
<xs:element ref="SupplementalIllustrationType"/>
<xs:element ref="SupplementalReportColumn00"/>
<xs:element ref="SupplementalReportColumn01"/>
@@ -213,7 +214,6 @@
<xs:element ref="SupplementalReportColumn09"/>
<xs:element ref="SupplementalReportColumn10"/>
<xs:element ref="SupplementalReportColumn11"/>
- <xs:element ref="SupplementalSpecifiedAmount"/>
<xs:element ref="SurviveToAge"/>
<xs:element ref="SurviveToType"/>
<xs:element ref="SurviveToYear"/>
@@ -987,9 +987,9 @@ intended to represent basic group term coverage. Default:
'50000'.</xs:documenta
<xs:documentation>Insured's smoking or tobacco use.</xs:documentation>
</xs:annotation>
</xs:element>
- <xs:element name="SolveBeginTime" type="duration_int">
+ <xs:element name="SolveBeginAge" type="duration_int">
<xs:annotation>
- <xs:documentation>* Age at which a solve begins
(inclusive).</xs:documentation>
+ <xs:documentation>* Age at which a solve begins
(inclusive).</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="SolveBeginYear" type="duration_int">
@@ -997,7 +997,7 @@ intended to represent basic group term coverage. Default:
'50000'.</xs:documenta
<xs:documentation>* Policy year in which a solve begins
(inclusive).</xs:documentation>
</xs:annotation>
</xs:element>
- <xs:element name="SolveEndTime" type="duration_int">
+ <xs:element name="SolveEndAge" type="duration_int">
<xs:annotation>
<xs:documentation>* Age at which a solve ends
(exclusive).</xs:documentation>
</xs:annotation>
@@ -1029,14 +1029,14 @@ the basis of the hypothetical rate, half that rate, or
zero.</xs:documentation>
<xs:documentation>* Solve goal.</xs:documentation>
</xs:annotation>
</xs:element>
- <xs:element name="SolveTargetCashSurrenderValue" type="nonnegative_double">
+ <xs:element name="SolveTargetAge" type="duration_int">
<xs:annotation>
- <xs:documentation>* Cash surrender value used as solve
goal.</xs:documentation>
+ <xs:documentation>* Age at which a solve target is to be
achieved.</xs:documentation>
</xs:annotation>
</xs:element>
- <xs:element name="SolveTargetTime" type="duration_int">
+ <xs:element name="SolveTargetValue" type="nonnegative_double">
<xs:annotation>
- <xs:documentation>* Age at which a solve target is to be
achieved.</xs:documentation>
+ <xs:documentation>* Cash surrender value used as solve
goal.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="SolveTargetYear" type="duration_int">
@@ -1128,6 +1128,14 @@ everything else except premium tax.</xs:documentation>
<xs:documentation>Substandard table rating.</xs:documentation>
</xs:annotation>
</xs:element>
+ <xs:element name="SupplementalAmount" type="specamt_sequence">
+ <xs:annotation>
+ <xs:documentation>Supplemental specified amount (e.g.,
individually-elected
+extra coverage on a group plan) for each policy year since
+issue. Inforce extracts require only the current scalar value.
+Default: '0'.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
<xs:element name="SupplementalIllustrationType" type="suppl_illus_type">
<xs:annotation>
<xs:documentation>* Built-in supplemental illustration
type.</xs:documentation>
@@ -1193,14 +1201,6 @@ everything else except premium tax.</xs:documentation>
<xs:documentation>* User-designed supplemental illustration: twelfth
column.</xs:documentation>
</xs:annotation>
</xs:element>
- <xs:element name="SupplementalSpecifiedAmount" type="specamt_sequence">
- <xs:annotation>
- <xs:documentation>Supplemental specified amount (e.g.,
individually-elected
-extra coverage on a group plan) for each policy year since
-issue. Inforce extracts require only the current scalar value.
-Default: '0'.</xs:documentation>
- </xs:annotation>
- </xs:element>
<xs:element name="SurviveToAge" type="age_int">
<xs:annotation>
<xs:documentation>* Presumed age at death, for partial mortality.
Default: '99'.</xs:documentation>
diff --git a/ihs_acctval.cpp b/ihs_acctval.cpp
index dde6bdc..e779f89 100644
--- a/ihs_acctval.cpp
+++ b/ihs_acctval.cpp
@@ -305,7 +305,7 @@ double AccountValue::RunAllApplicableBases()
,yare_input_.SolveBeginYear
,yare_input_.SolveEndYear
,yare_input_.SolveTarget
- ,yare_input_.SolveTargetCashSurrenderValue
+ ,yare_input_.SolveTargetValue
,yare_input_.SolveTargetYear
,yare_input_.SolveExpenseGeneralAccountBasis
,yare_input_.SolveSeparateAccountBasis
diff --git a/ihs_avsolve.cpp b/ihs_avsolve.cpp
index 2e7d5b1..aeb8eb4 100644
--- a/ihs_avsolve.cpp
+++ b/ihs_avsolve.cpp
@@ -205,8 +205,6 @@ double AccountValue::SolveTest(double a_CandidateValue)
// counters and iterators--it's one past the end--but indexing
// must decrement it.
double value = VariantValues().CSVNet[SolveTargetDuration_ - 1];
- // INPUT !! Rename: s/SolveTargetCashSurrenderValue/SolveTargetValue/
- // because it's used for both target CSV and target NAAR.
if(mce_solve_for_target_naar == SolveTarget_)
{
value =
diff --git a/input.cpp b/input.cpp
index d474dac..90faf70 100644
--- a/input.cpp
+++ b/input.cpp
@@ -55,14 +55,14 @@ Input::Input()
// ,Internal1035ExchangeAmount ("")
// ,Internal1035ExchangeTaxBasis ("")
// ,Internal1035ExchangeFromMec ("")
-// ,SolveTargetTime ("95")
-// ,SolveBeginTime ("")
-// ,SolveEndTime ("95")
+// ,SolveTargetAge ("95")
+// ,SolveBeginAge ("")
+// ,SolveEndAge ("95")
// ,SolveType ("")
// ,SolveBeginYear ("")
// ,SolveEndYear ("50")
// ,SolveTarget ("")
-// ,SolveTargetCashSurrenderValue ("")
+// ,SolveTargetValue ("")
// ,SolveTargetYear ("50")
// ,SolveExpenseGeneralAccountBasis ("")
// ,SolveSeparateAccountBasis ("")
@@ -190,7 +190,7 @@ Input::Input()
// ,TaxBracket ("")
,ProjectedSalary ("100000")
,SpecifiedAmount ("1000000")
- ,SupplementalSpecifiedAmount ("0")
+ ,SupplementalAmount ("0")
,DeathBenefitOption ("a")
,Payment ("20000")
,PaymentMode ("annual")
@@ -302,14 +302,14 @@ void Input::AscribeMembers()
ascribe("Internal1035ExchangeAmount" ,
&Input::Internal1035ExchangeAmount );
ascribe("Internal1035ExchangeTaxBasis" ,
&Input::Internal1035ExchangeTaxBasis );
ascribe("Internal1035ExchangeFromMec" ,
&Input::Internal1035ExchangeFromMec );
- ascribe("SolveTargetTime" , &Input::SolveTargetTime
);
- ascribe("SolveBeginTime" , &Input::SolveBeginTime
);
- ascribe("SolveEndTime" , &Input::SolveEndTime
);
+ ascribe("SolveTargetAge" , &Input::SolveTargetAge
);
+ ascribe("SolveBeginAge" , &Input::SolveBeginAge
);
+ ascribe("SolveEndAge" , &Input::SolveEndAge
);
ascribe("SolveType" , &Input::SolveType
);
ascribe("SolveBeginYear" , &Input::SolveBeginYear
);
ascribe("SolveEndYear" , &Input::SolveEndYear
);
ascribe("SolveTarget" , &Input::SolveTarget
);
- ascribe("SolveTargetCashSurrenderValue" ,
&Input::SolveTargetCashSurrenderValue );
+ ascribe("SolveTargetValue" , &Input::SolveTargetValue
);
ascribe("SolveTargetYear" , &Input::SolveTargetYear
);
ascribe("SolveExpenseGeneralAccountBasis" ,
&Input::SolveExpenseGeneralAccountBasis );
ascribe("SolveSeparateAccountBasis" ,
&Input::SolveSeparateAccountBasis );
@@ -437,7 +437,7 @@ void Input::AscribeMembers()
ascribe("TaxBracket" , &Input::TaxBracket
);
ascribe("ProjectedSalary" , &Input::ProjectedSalary
);
ascribe("SpecifiedAmount" , &Input::SpecifiedAmount
);
- ascribe("SupplementalSpecifiedAmount" ,
&Input::SupplementalSpecifiedAmount );
+ ascribe("SupplementalAmount" , &Input::SupplementalAmount
);
ascribe("DeathBenefitOption" , &Input::DeathBenefitOption
);
ascribe("Payment" , &Input::Payment
);
ascribe("PaymentMode" , &Input::PaymentMode
);
diff --git a/input.hpp b/input.hpp
index da174ec..3eece12 100644
--- a/input.hpp
+++ b/input.hpp
@@ -252,14 +252,14 @@ class LMI_SO Input final
tnr_nonnegative_double Internal1035ExchangeAmount ;
tnr_unrestricted_double Internal1035ExchangeTaxBasis ;
mce_yes_or_no Internal1035ExchangeFromMec ;
- tnr_duration SolveTargetTime ;
- tnr_duration SolveBeginTime ;
- tnr_duration SolveEndTime ;
+ tnr_duration SolveTargetAge ;
+ tnr_duration SolveBeginAge ;
+ tnr_duration SolveEndAge ;
mce_solve_type SolveType ;
tnr_duration SolveBeginYear ;
tnr_duration SolveEndYear ;
mce_solve_target SolveTarget ;
- tnr_nonnegative_double SolveTargetCashSurrenderValue ;
+ tnr_nonnegative_double SolveTargetValue ;
tnr_duration SolveTargetYear ;
mce_gen_basis SolveExpenseGeneralAccountBasis ;
mce_sep_basis SolveSeparateAccountBasis ;
@@ -387,8 +387,7 @@ class LMI_SO Input final
numeric_sequence TaxBracket ;
numeric_sequence ProjectedSalary ;
specamt_sequence SpecifiedAmount ;
- // INPUT !! For brevity, "SupplementalAmount" would seem better.
- specamt_sequence SupplementalSpecifiedAmount ;
+ specamt_sequence SupplementalAmount ;
dbo_sequence DeathBenefitOption ;
payment_sequence Payment ;
mode_sequence PaymentMode ;
diff --git a/input_harmonization.cpp b/input_harmonization.cpp
index 93c370c..a47814c 100644
--- a/input_harmonization.cpp
+++ b/input_harmonization.cpp
@@ -559,7 +559,7 @@ true // Silly workaround for now.
SpecifiedAmount.enable(!inhibit_sequence);
// Unaffected by solves: no solve offered for supplemental specamt.
- SupplementalSpecifiedAmount.enable(allow_term && !term_is_a_rider);
+ SupplementalAmount.enable(allow_term && !term_is_a_rider);
bool prem_solve = mce_solve_ee_prem == SolveType;
@@ -778,16 +778,14 @@ false // Silly workaround for now.
SolveTargetYear.minimum_and_maximum(1 + SolveBeginYear.value(),
years_to_maturity());
#endif // 0
- // INPUT !! Temporarily, existing -'Time' names are used where
- // -'Age' names would be clearer.
- SolveBeginTime .enable(actually_solving && mce_from_age == SolveFromWhich);
- SolveEndTime .enable(actually_solving && mce_to_age == SolveToWhich);
- SolveTargetTime.enable(actually_solving && mce_to_age == SolveTgtAtWhich
&& mce_solve_for_non_mec != SolveTarget);
+ SolveBeginAge .enable(actually_solving && mce_from_age == SolveFromWhich);
+ SolveEndAge .enable(actually_solving && mce_to_age == SolveToWhich);
+ SolveTargetAge.enable(actually_solving && mce_to_age == SolveTgtAtWhich
&& mce_solve_for_non_mec != SolveTarget);
#if 0 // http://lists.nongnu.org/archive/html/lmi/2008-08/msg00036.html
- SolveBeginTime .minimum_and_maximum(issue_age() ,
maturity_age());
- SolveEndTime .minimum_and_maximum(SolveBeginTime.value(),
maturity_age());
- SolveTargetTime.minimum_and_maximum(SolveBeginTime.value(),
maturity_age());
+ SolveBeginAge .minimum_and_maximum(issue_age() , maturity_age());
+ SolveEndAge .minimum_and_maximum(SolveBeginAge.value(), maturity_age());
+ SolveTargetAge.minimum_and_maximum(SolveBeginAge.value(), maturity_age());
#endif // 0
SolveTarget.enable(actually_solving);
@@ -812,8 +810,7 @@ false // Silly workaround for now.
SolveSeparateAccountBasis.allow(mce_sep_zero, actually_solving &&
allow_sep_acct);
SolveSeparateAccountBasis.allow(mce_sep_half, actually_solving &&
allow_sep_acct && is_three_rate_nasd(GleanedLedgerType_));
- // INPUT !! Rename: s/SolveTargetCashSurrenderValue/SolveTargetValue/
- SolveTargetCashSurrenderValue.enable(actually_solving &&
(mce_solve_for_target_csv == SolveTarget || mce_solve_for_target_naar ==
SolveTarget));
+ SolveTargetValue.enable(actually_solving && (mce_solve_for_target_csv ==
SolveTarget || mce_solve_for_target_naar == SolveTarget));
bool enable_reduce_to_avoid_mec =
!(actually_solving && mce_solve_for_non_mec == SolveTarget)
@@ -973,7 +970,7 @@ void Input::set_solve_durations()
break;
case mce_to_age:
{
- SolveTargetYear = SolveTargetTime.value() - issue_age();
+ SolveTargetYear = SolveTargetAge.value() - issue_age();
}
break;
case mce_to_retirement:
@@ -997,7 +994,7 @@ void Input::set_solve_durations()
break;
case mce_from_age:
{
- SolveBeginYear = SolveBeginTime.value() - issue_age();
+ SolveBeginYear = SolveBeginAge.value() - issue_age();
}
break;
case mce_from_issue:
@@ -1021,7 +1018,7 @@ void Input::set_solve_durations()
break;
case mce_to_age:
{
- SolveEndYear = SolveEndTime.value() - issue_age();
+ SolveEndYear = SolveEndAge.value() - issue_age();
}
break;
case mce_to_retirement:
@@ -1042,9 +1039,9 @@ void Input::set_solve_durations()
SolveBeginYear = std::max(0, std::min(years_to_maturity(), SolveBeginYear
.value()));
SolveEndYear = std::max(0, std::min(years_to_maturity(), SolveEndYear
.value()));
- SolveTargetTime = issue_age() + SolveTargetYear.value();
- SolveBeginTime = issue_age() + SolveBeginYear .value();
- SolveEndTime = issue_age() + SolveEndYear .value();
+ SolveTargetAge = issue_age() + SolveTargetYear.value();
+ SolveBeginAge = issue_age() + SolveBeginYear .value();
+ SolveEndAge = issue_age() + SolveEndYear .value();
}
/// Set inforce durations (full years and months) from calendar dates.
diff --git a/input_realization.cpp b/input_realization.cpp
index 267a484..2afb9c8 100644
--- a/input_realization.cpp
+++ b/input_realization.cpp
@@ -533,9 +533,9 @@ std::string Input::RealizeSupplementalAmount()
(*this
,SupplementalAmountRealized_
,SupplementalAmountStrategyRealized_
- ,SupplementalSpecifiedAmount
- ,SupplementalSpecifiedAmount.allowed_keywords()
- ,SupplementalSpecifiedAmount.default_keyword()
+ ,SupplementalAmount
+ ,SupplementalAmount.allowed_keywords()
+ ,SupplementalAmount.default_keyword()
);
}
diff --git a/input_xml_io.cpp b/input_xml_io.cpp
index f37fbf2..3ff472d 100644
--- a/input_xml_io.cpp
+++ b/input_xml_io.cpp
@@ -150,6 +150,11 @@ bool Input::is_detritus(std::string const& s) const
,"PremiumHistory" // Renamed to
'Inforce7702AAmountsPaidHistory'.
,"SocialSecurityNumber" // Withdrawn: would violate
privacy.
,"SolveBasis" // Renamed to
'SolveExpenseGeneralAccountBasis'.
+ ,"SolveBeginTime" // Renamed to 'SolveBeginAge'.
+ ,"SolveEndTime" // Renamed to 'SolveEndAge'.
+ ,"SolveTargetCashSurrenderValue" // Renamed to 'SolveTargetValue'.
+ ,"SolveTargetTime" // Renamed to 'SolveTargetAge'.
+ ,"SupplementalSpecifiedAmount" // Renamed to 'SupplementalAmount'.
,"SpecamtHistory" // Merged into 'SpecifiedAmount'.
,"SpecifiedAmountFromIssue" // Withdrawn.
,"SpecifiedAmountFromRetirement" // Withdrawn.
@@ -348,6 +353,29 @@ void Input::redintegrate_ex_post
return;
}
+ if(file_version < 9)
+ {
+ // Version 9 renamed these elements. Because they are used
+ // soon hereafter, they must be renamed early--between
+ // redintegrate_ex_ante() and redintegrate_ex_post(),
+ // as it were.
+ LMI_ASSERT(contains(residuary_names, "SolveTargetAge"));
+ LMI_ASSERT(contains(residuary_names, "SolveBeginAge"));
+ LMI_ASSERT(contains(residuary_names, "SolveEndAge"));
+ if(contains(detritus_map, "SolveTargetTime"))
+ {
+ SolveTargetAge = map_lookup(detritus_map, "SolveTargetTime");
+ }
+ if(contains(detritus_map, "SolveBeginTime"))
+ {
+ SolveBeginAge = map_lookup(detritus_map, "SolveBeginTime");
+ }
+ if(contains(detritus_map, "SolveEndTime"))
+ {
+ SolveEndAge = map_lookup(detritus_map, "SolveEndTime");
+ }
+ }
+
if(0 == file_version)
{
// An older version with no distinct 'file_version' didn't
@@ -397,8 +425,8 @@ void Input::redintegrate_ex_post
// apparently in this version only.
//
// However, default values for
- // SolveTargetTime
- // SolveEndTime
+ // SolveTargetTime [since renamed to SolveTargetAge]
+ // SolveEndTime [since renamed to SolveEndAge]
// didn't work correctly with contemporary versions of the
// program. Users had to change them in order to make solves
// work correctly. For saved cases with unchanged defaults,
@@ -406,13 +434,13 @@ void Input::redintegrate_ex_post
// duration produces a result consonant with the palpable
// intention of the quondam defaults.
//
- SolveTargetYear = std::min(years_to_maturity(),
SolveTargetTime.value());
- SolveBeginYear = SolveBeginTime
.value() ;
- SolveEndYear = std::min(years_to_maturity(), SolveEndTime
.value());
+ SolveTargetYear = std::min(years_to_maturity(),
SolveTargetAge.value());
+ SolveBeginYear = SolveBeginAge .value()
;
+ SolveEndYear = std::min(years_to_maturity(), SolveEndAge
.value());
- SolveTargetTime = issue_age() + SolveTargetYear.value();
- SolveBeginTime = issue_age() + SolveBeginYear .value();
- SolveEndTime = issue_age() + SolveEndYear .value();
+ SolveTargetAge = issue_age() + SolveTargetYear.value();
+ SolveBeginAge = issue_age() + SolveBeginYear .value();
+ SolveEndAge = issue_age() + SolveEndYear .value();
}
if(file_version < 5)
@@ -650,6 +678,29 @@ void Input::redintegrate_ex_post
,db.Query(DB_SpecAmtLoadLimit)
);
}
+
+ if(file_version < 9)
+ {
+ // Version 9 renamed these elements.
+ // This one has existed since before the lmi epoch, but some
+ // old vendor extracts defectively failed to provide it.
+ LMI_ASSERT(contains(residuary_names, "SolveTargetValue"));
+ if(!contains(detritus_map, "SolveTargetCashSurrenderValue"))
+ {
+ LMI_ASSERT(file_version < 7);
+ }
+ else
+ {
+ SolveTargetValue = map_lookup(detritus_map,
"SolveTargetCashSurrenderValue");
+ }
+ // This one has existed only since version 8.
+ LMI_ASSERT(contains(residuary_names, "SupplementalAmount"));
+ SupplementalAmount =
+ (file_version < 8)
+ ? ""
+ : map_lookup(detritus_map, "SupplementalSpecifiedAmount")
+ ;
+ }
}
void Input::redintegrate_ad_terminum()
diff --git a/main_cgi.cpp b/main_cgi.cpp
index 60420a5..b25604f 100644
--- a/main_cgi.cpp
+++ b/main_cgi.cpp
@@ -123,7 +123,7 @@ int try_main(int argc, char* argv[])
"&SolveBeginYear=0"
"&SolveEndYear=10"
"&SolveTarget=Target CSV"
- "&SolveTargetCashSurrenderValue=1000000"
+ "&SolveTargetValue=1000000"
"&SolveTargetYear=20"
"&SolveExpenseGeneralAccountBasis=Current"
"&SpecifiedAmount=1000000"
@@ -500,7 +500,7 @@ void ShowOutput(cgicc::Cgicc const& data)
input["SolveBeginYear"] = GetValue(data, "SolveBeginYear"
);
input["SolveEndYear"] = GetValue(data, "SolveEndYear"
);
input["SolveTarget"] = GetValue(data, "SolveTarget"
);
- input["SolveTargetCashSurrenderValue"] = GetValue(data,
"SolveTargetCashSurrenderValue" );
+ input["SolveTargetValue"] = GetValue(data,
"SolveTargetValue" );
input["SolveTargetYear"] = GetValue(data,
"SolveTargetYear" );
input["SolveExpenseGeneralAccountBasis"] = GetValue(data,
"SolveExpenseGeneralAccountBasis");
input["SpecifiedAmount"] = GetValue(data,
"SpecifiedAmount" );
diff --git a/sample.cns b/sample.cns
index 0964522..4fd2320 100644
--- a/sample.cns
+++ b/sample.cns
@@ -136,16 +136,16 @@
<SeparateAccountRate>0.08</SeparateAccountRate>
<SeparateAccountRateType>Gross rate</SeparateAccountRateType>
<Smoking>Nonsmoker</Smoking>
- <SolveBeginTime>45</SolveBeginTime>
+ <SolveBeginAge>45</SolveBeginAge>
<SolveBeginYear>0</SolveBeginYear>
- <SolveEndTime>65</SolveEndTime>
+ <SolveEndAge>65</SolveEndAge>
<SolveEndYear>20</SolveEndYear>
<SolveExpenseGeneralAccountBasis>Current</SolveExpenseGeneralAccountBasis>
<SolveFromWhich>Issue</SolveFromWhich>
<SolveSeparateAccountBasis>Hypothetical</SolveSeparateAccountBasis>
<SolveTarget>Endowment</SolveTarget>
- <SolveTargetCashSurrenderValue>0</SolveTargetCashSurrenderValue>
- <SolveTargetTime>100</SolveTargetTime>
+ <SolveTargetAge>100</SolveTargetAge>
+ <SolveTargetValue>0</SolveTargetValue>
<SolveTargetYear>55</SolveTargetYear>
<SolveTgtAtWhich>Maturity</SolveTgtAtWhich>
<SolveToWhich>Retirement</SolveToWhich>
@@ -163,6 +163,7 @@
<State>CT</State>
<StateOfJurisdiction>CT</StateOfJurisdiction>
<SubstandardTable>None</SubstandardTable>
+ <SupplementalAmount>0</SupplementalAmount>
<SupplementalIllustrationType>None</SupplementalIllustrationType>
<SupplementalReportColumn00>[none]</SupplementalReportColumn00>
<SupplementalReportColumn01>[none]</SupplementalReportColumn01>
@@ -176,7 +177,6 @@
<SupplementalReportColumn09>[none]</SupplementalReportColumn09>
<SupplementalReportColumn10>[none]</SupplementalReportColumn10>
<SupplementalReportColumn11>[none]</SupplementalReportColumn11>
- <SupplementalSpecifiedAmount>0</SupplementalSpecifiedAmount>
<SurviveToAge>99</SurviveToAge>
<SurviveToType>Survive to age limit</SurviveToType>
<SurviveToYear>100</SurviveToYear>
@@ -335,16 +335,16 @@
<SeparateAccountRate>0.08</SeparateAccountRate>
<SeparateAccountRateType>Gross rate</SeparateAccountRateType>
<Smoking>Nonsmoker</Smoking>
- <SolveBeginTime>45</SolveBeginTime>
+ <SolveBeginAge>45</SolveBeginAge>
<SolveBeginYear>0</SolveBeginYear>
- <SolveEndTime>65</SolveEndTime>
+ <SolveEndAge>65</SolveEndAge>
<SolveEndYear>20</SolveEndYear>
<SolveExpenseGeneralAccountBasis>Current</SolveExpenseGeneralAccountBasis>
<SolveFromWhich>Issue</SolveFromWhich>
<SolveSeparateAccountBasis>Hypothetical</SolveSeparateAccountBasis>
<SolveTarget>Endowment</SolveTarget>
- <SolveTargetCashSurrenderValue>0</SolveTargetCashSurrenderValue>
- <SolveTargetTime>100</SolveTargetTime>
+ <SolveTargetAge>100</SolveTargetAge>
+ <SolveTargetValue>0</SolveTargetValue>
<SolveTargetYear>55</SolveTargetYear>
<SolveTgtAtWhich>Maturity</SolveTgtAtWhich>
<SolveToWhich>Retirement</SolveToWhich>
@@ -362,6 +362,7 @@
<State>CT</State>
<StateOfJurisdiction>CT</StateOfJurisdiction>
<SubstandardTable>None</SubstandardTable>
+ <SupplementalAmount>0</SupplementalAmount>
<SupplementalIllustrationType>None</SupplementalIllustrationType>
<SupplementalReportColumn00>[none]</SupplementalReportColumn00>
<SupplementalReportColumn01>[none]</SupplementalReportColumn01>
@@ -375,7 +376,6 @@
<SupplementalReportColumn09>[none]</SupplementalReportColumn09>
<SupplementalReportColumn10>[none]</SupplementalReportColumn10>
<SupplementalReportColumn11>[none]</SupplementalReportColumn11>
- <SupplementalSpecifiedAmount>0</SupplementalSpecifiedAmount>
<SurviveToAge>99</SurviveToAge>
<SurviveToType>Survive to age limit</SurviveToType>
<SurviveToYear>100</SurviveToYear>
@@ -534,16 +534,16 @@
<SeparateAccountRate>0.08</SeparateAccountRate>
<SeparateAccountRateType>Gross rate</SeparateAccountRateType>
<Smoking>Nonsmoker</Smoking>
- <SolveBeginTime>45</SolveBeginTime>
+ <SolveBeginAge>45</SolveBeginAge>
<SolveBeginYear>0</SolveBeginYear>
- <SolveEndTime>65</SolveEndTime>
+ <SolveEndAge>65</SolveEndAge>
<SolveEndYear>20</SolveEndYear>
<SolveExpenseGeneralAccountBasis>Current</SolveExpenseGeneralAccountBasis>
<SolveFromWhich>Issue</SolveFromWhich>
<SolveSeparateAccountBasis>Hypothetical</SolveSeparateAccountBasis>
<SolveTarget>Endowment</SolveTarget>
- <SolveTargetCashSurrenderValue>0</SolveTargetCashSurrenderValue>
- <SolveTargetTime>100</SolveTargetTime>
+ <SolveTargetAge>100</SolveTargetAge>
+ <SolveTargetValue>0</SolveTargetValue>
<SolveTargetYear>55</SolveTargetYear>
<SolveTgtAtWhich>Maturity</SolveTgtAtWhich>
<SolveToWhich>Retirement</SolveToWhich>
@@ -561,6 +561,7 @@
<State>CT</State>
<StateOfJurisdiction>CT</StateOfJurisdiction>
<SubstandardTable>None</SubstandardTable>
+ <SupplementalAmount>0</SupplementalAmount>
<SupplementalIllustrationType>None</SupplementalIllustrationType>
<SupplementalReportColumn00>[none]</SupplementalReportColumn00>
<SupplementalReportColumn01>[none]</SupplementalReportColumn01>
@@ -574,7 +575,6 @@
<SupplementalReportColumn09>[none]</SupplementalReportColumn09>
<SupplementalReportColumn10>[none]</SupplementalReportColumn10>
<SupplementalReportColumn11>[none]</SupplementalReportColumn11>
- <SupplementalSpecifiedAmount>0</SupplementalSpecifiedAmount>
<SurviveToAge>99</SurviveToAge>
<SurviveToType>Survive to age limit</SurviveToType>
<SurviveToYear>100</SurviveToYear>
diff --git a/sample.ill b/sample.ill
index 7f222b3..e62e495 100644
--- a/sample.ill
+++ b/sample.ill
@@ -135,16 +135,16 @@
<SeparateAccountRate>0.08</SeparateAccountRate>
<SeparateAccountRateType>Gross rate</SeparateAccountRateType>
<Smoking>Nonsmoker</Smoking>
- <SolveBeginTime>45</SolveBeginTime>
+ <SolveBeginAge>45</SolveBeginAge>
<SolveBeginYear>0</SolveBeginYear>
- <SolveEndTime>65</SolveEndTime>
+ <SolveEndAge>65</SolveEndAge>
<SolveEndYear>20</SolveEndYear>
<SolveExpenseGeneralAccountBasis>Current</SolveExpenseGeneralAccountBasis>
<SolveFromWhich>Issue</SolveFromWhich>
<SolveSeparateAccountBasis>Hypothetical</SolveSeparateAccountBasis>
<SolveTarget>Endowment</SolveTarget>
- <SolveTargetCashSurrenderValue>0</SolveTargetCashSurrenderValue>
- <SolveTargetTime>100</SolveTargetTime>
+ <SolveTargetAge>100</SolveTargetAge>
+ <SolveTargetValue>0</SolveTargetValue>
<SolveTargetYear>55</SolveTargetYear>
<SolveTgtAtWhich>Maturity</SolveTgtAtWhich>
<SolveToWhich>Retirement</SolveToWhich>
@@ -162,6 +162,7 @@
<State>CT</State>
<StateOfJurisdiction>CT</StateOfJurisdiction>
<SubstandardTable>None</SubstandardTable>
+ <SupplementalAmount>0</SupplementalAmount>
<SupplementalIllustrationType>None</SupplementalIllustrationType>
<SupplementalReportColumn00>[none]</SupplementalReportColumn00>
<SupplementalReportColumn01>[none]</SupplementalReportColumn01>
@@ -175,7 +176,6 @@
<SupplementalReportColumn09>[none]</SupplementalReportColumn09>
<SupplementalReportColumn10>[none]</SupplementalReportColumn10>
<SupplementalReportColumn11>[none]</SupplementalReportColumn11>
- <SupplementalSpecifiedAmount>0</SupplementalSpecifiedAmount>
<SurviveToAge>99</SurviveToAge>
<SurviveToType>Survive to age limit</SurviveToType>
<SurviveToYear>100</SurviveToYear>
diff --git a/skin.xrc b/skin.xrc
index 0e82b9b..25627af 100644
--- a/skin.xrc
+++ b/skin.xrc
@@ -1913,7 +1913,7 @@ here, but it looks weird if we don't make this look like
its siblings.
</object>
<object class="sizeritem">
<flag>wxGROW</flag>
- <object class="wxTextCtrl"
name="SolveTargetCashSurrenderValue">
+ <object class="wxTextCtrl"
name="SolveTargetValue">
<help>Target amount</help>
<size>10,-1</size>
</object>
@@ -1975,8 +1975,7 @@ here, but it looks weird if we don't make this look like
its siblings.
</object>
<object class="sizeritem">
<flag>wxGROW</flag>
-<!-- Really want something like "SolveFromAge"; this is a temporary kludge. -->
- <object class="wxSpinCtrl"
name="SolveBeginTime">
+ <object class="wxSpinCtrl"
name="SolveBeginAge">
<help>Solve beginning
age</help>
<size>20,-1</size>
<style>wxSP_ARROW_KEYS</style>
@@ -2037,8 +2036,7 @@ here, but it looks weird if we don't make this look like
its siblings.
</object>
<object class="sizeritem">
<flag>wxGROW</flag>
-<!-- Really want something like "SolveToAge"; this is a temporary kludge. -->
- <object class="wxSpinCtrl"
name="SolveEndTime">
+ <object class="wxSpinCtrl"
name="SolveEndAge">
<help>Solve ending
age</help>
<size>20,-1</size>
<style>wxSP_ARROW_KEYS</style>
@@ -2099,8 +2097,7 @@ here, but it looks weird if we don't make this look like
its siblings.
</object>
<object class="sizeritem">
<flag>wxGROW</flag>
-<!-- Really want something like "SolveAtAge"; this is a temporary kludge. -->
- <object class="wxSpinCtrl"
name="SolveTargetTime">
+ <object class="wxSpinCtrl"
name="SolveTargetAge">
<help>Attained age to
achieve target surrender value</help>
<size>20,-1</size>
<style>wxSP_ARROW_KEYS</style>
@@ -2270,7 +2267,7 @@ here, but it looks weird if we don't make this look like
its siblings.
</object>
<object class="sizeritem">
<flag>wxGROW</flag>
- <object class="InputSequenceEntry"
name="SupplementalSpecifiedAmount">
+ <object class="InputSequenceEntry"
name="SupplementalAmount">
<title>Supplemental amount</title>
<help>Supplemental amount, or corridor, glp, gsp,
maximum, salary, sevenpay, target</help>
<size>180,-1</size>
diff --git a/skin_coli_boli.xrc b/skin_coli_boli.xrc
index fa8ff15..eab724a 100644
--- a/skin_coli_boli.xrc
+++ b/skin_coli_boli.xrc
@@ -2067,7 +2067,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<object class="sizeritem">
<flag>wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL</flag>
<border>2</border>
- <object class="wxSpinCtrl"
name="SolveBeginTime">
+ <object class="wxSpinCtrl"
name="SolveBeginAge">
<help>Solve beginning
age</help>
<size>50,-1</size>
<style>wxSP_ARROW_KEYS</style>
@@ -2148,7 +2148,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<object class="sizeritem">
<flag>wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL</flag>
<border>2</border>
- <object class="wxSpinCtrl"
name="SolveEndTime">
+ <object class="wxSpinCtrl"
name="SolveEndAge">
<help>Solve ending age</help>
<size>50,-1</size>
<style>wxSP_ARROW_KEYS</style>
@@ -2217,7 +2217,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<object class="sizeritem">
<flag>wxGROW|wxBOTTOM</flag>
<border>2</border>
- <object class="wxTextCtrl"
name="SolveTargetCashSurrenderValue">
+ <object class="wxTextCtrl"
name="SolveTargetValue">
<help>Target amount</help>
</object>
</object>
@@ -2285,7 +2285,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<object class="sizeritem">
<flag>wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL</flag>
<border>2</border>
- <object class="wxSpinCtrl"
name="SolveTargetTime">
+ <object class="wxSpinCtrl"
name="SolveTargetAge">
<help>Attained age to
achieve target surrender value</help>
<size>50,-1</size>
<style>wxSP_ARROW_KEYS</style>
diff --git a/skin_group_carveout.xrc b/skin_group_carveout.xrc
index 6428baa..1f918fc 100644
--- a/skin_group_carveout.xrc
+++ b/skin_group_carveout.xrc
@@ -1300,7 +1300,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<object class="sizeritem">
<flag>wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL</flag>
<border>4</border>
- <object class="wxSpinCtrl"
name="SolveBeginTime">
+ <object class="wxSpinCtrl"
name="SolveBeginAge">
<help>Solve beginning
age</help>
<size>50,-1</size>
<style>wxSP_ARROW_KEYS</style>
@@ -1380,7 +1380,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<object class="sizeritem">
<flag>wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL</flag>
<border>4</border>
- <object class="wxSpinCtrl"
name="SolveEndTime">
+ <object class="wxSpinCtrl"
name="SolveEndAge">
<help>Solve ending age</help>
<size>50,-1</size>
<style>wxSP_ARROW_KEYS</style>
@@ -1454,7 +1454,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<object class="sizeritem">
<flag>wxGROW|wxTOP</flag>
<border>4</border>
- <object class="wxTextCtrl"
name="SolveTargetCashSurrenderValue">
+ <object class="wxTextCtrl"
name="SolveTargetValue">
<help>Target amount</help>
</object>
</object>
@@ -1521,7 +1521,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<object
class="sizeritem">
<flag>wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL</flag>
<border>4</border>
- <object
class="wxSpinCtrl" name="SolveTargetTime">
+ <object
class="wxSpinCtrl" name="SolveTargetAge">
<help>Attained
age to achieve target surrender value</help>
<size>50,-1</size>
<style>wxSP_ARROW_KEYS</style>
@@ -1954,7 +1954,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<object class="sizeritem">
<flag>wxGROW|wxBOTTOM</flag>
<border>2</border>
- <object class="InputSequenceEntry"
name="SupplementalSpecifiedAmount">
+ <object class="InputSequenceEntry"
name="SupplementalAmount">
<title>Supplemental amount</title>
<help>Supplemental amount, or corridor, glp, gsp,
maximum, salary, sevenpay, target</help>
</object>
diff --git a/solve.cpp b/solve.cpp
index f463ebf..f3533cc 100644
--- a/solve.cpp
+++ b/solve.cpp
@@ -49,7 +49,7 @@ namespace
{
AccountValue* That;
// IHS !! Use a struct for these?
- double ThatSolveTargetCSV;
+ double ThatSolveTargetValue;
mcenum_solve_target ThatSolveTarget;
int ThatSolveTgtYear;
int ThatSolveBegYear;
@@ -131,7 +131,7 @@ double SolveTest()
break;
case mce_solve_for_target_csv:
{
- y = ThatSolveTargetCSV;
+ y = ThatSolveTargetValue;
}
break;
case mce_solve_for_target_naar: // Fall through.
@@ -230,9 +230,9 @@ void AccountValue::SolveSetLoanThenWD
double AccountValue::Solve()
{
That = this;
- ThatSolveTargetCSV = yare_input_.SolveTargetCashSurrenderValue;
- ThatSolveTarget = yare_input_.SolveTarget;
- ThatSolveBasis = yare_input_.SolveExpenseGeneralAccountBasis;
+ ThatSolveTargetValue = yare_input_.SolveTargetValue;
+ ThatSolveTarget = yare_input_.SolveTarget;
+ ThatSolveBasis = yare_input_.SolveExpenseGeneralAccountBasis;
only_set_values = !Solving;
// We mustn't solve for a target at a duration beyond the end.
diff --git a/yare_input.cpp b/yare_input.cpp
index 608d078..10c394f 100644
--- a/yare_input.cpp
+++ b/yare_input.cpp
@@ -60,7 +60,7 @@ yare_input::yare_input(Input const& z)
SolveBeginYear = z.SolveBeginYear
.value();
SolveEndYear = z.SolveEndYear
.value();
SolveTarget = z.SolveTarget
.value();
- SolveTargetCashSurrenderValue = z.SolveTargetCashSurrenderValue
.value();
+ SolveTargetValue = z.SolveTargetValue
.value();
SolveTargetYear = z.SolveTargetYear
.value();
SolveExpenseGeneralAccountBasis = z.SolveExpenseGeneralAccountBasis
.value();
SolveSeparateAccountBasis = z.SolveSeparateAccountBasis
.value();
diff --git a/yare_input.hpp b/yare_input.hpp
index 8836e25..2a8dea7 100644
--- a/yare_input.hpp
+++ b/yare_input.hpp
@@ -78,14 +78,14 @@ class yare_input final
double Internal1035ExchangeAmount ;
double Internal1035ExchangeTaxBasis ;
bool Internal1035ExchangeFromMec ;
-// int SolveTargetTime ;
-// int SolveBeginTime ;
-// int SolveEndTime ;
+// int SolveTargetAge ;
+// int SolveBeginAge ;
+// int SolveEndAge ;
mcenum_solve_type SolveType ;
int SolveBeginYear ;
int SolveEndYear ;
mcenum_solve_target SolveTarget ;
- double SolveTargetCashSurrenderValue ;
+ double SolveTargetValue ;
int SolveTargetYear ;
mcenum_gen_basis SolveExpenseGeneralAccountBasis ;
mcenum_sep_basis SolveSeparateAccountBasis ;