lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 6b208e6 3/3: Offer NAAR solves in the GUI


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 6b208e6 3/3: Offer NAAR solves in the GUI
Date: Tue, 7 Nov 2017 09:57:20 -0500 (EST)

branch: master
commit 6b208e63287e0aa88c672b9e9a4d14e21cae300f
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Offer NAAR solves in the GUI
    
    It remains to be decided whether CSV and NAAR solves should share the
    same input field (which should be renamed, at least in the skins), or
    each should have its own field.
---
 ihs_avsolve.cpp          | 10 ++++------
 input_harmonization.cpp  | 12 +++++++-----
 mc_enum_types.cpp        |  2 +-
 mc_enum_types.xpp        |  2 ++
 skin.xrc                 |  1 +
 skin_coli_boli.xrc       |  1 +
 skin_group_carveout.xrc  |  1 +
 skin_group_carveout3.xrc |  1 +
 solve.cpp                |  3 ++-
 types.rnc                |  1 +
 types.xsd                |  1 +
 11 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/ihs_avsolve.cpp b/ihs_avsolve.cpp
index f502e33..5549387 100644
--- a/ihs_avsolve.cpp
+++ b/ihs_avsolve.cpp
@@ -205,12 +205,10 @@ 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];
-    // This temporary expedient avoids any change to the GUI. It uses
-    // yare_input_.SolveTargetCashSurrenderValue for now as the target
-    // NAAR. Ultimately, it will instead use its own (new) input field
-    // as the target, and a NAAR solve will be chosen by a new
-    // enumerator such as 'mce_solve_for_naar'.
-    if(contains(yare_input_.Comments, "idiosyncrasyN"))
+    // INPUT !! Rename: s/SolveTargetCashSurrenderValue/SolveTargetValue/
+    // Use yare_input_.SolveTargetCashSurrenderValue as the target
+    // NAAR, for now at least.
+    if(mce_solve_for_target_naar == SolveTarget_)
         {
         value =
               VariantValues().EOYDeathBft[SolveTargetDuration_ - 1]
diff --git a/input_harmonization.cpp b/input_harmonization.cpp
index a369733..0cd9f76 100644
--- a/input_harmonization.cpp
+++ b/input_harmonization.cpp
@@ -790,10 +790,11 @@ false // Silly workaround for now.
 #endif // 0
 
     SolveTarget.enable(actually_solving);
-    SolveTarget.allow(mce_solve_for_endt      , actually_solving);
-    SolveTarget.allow(mce_solve_for_target_csv, actually_solving);
-    SolveTarget.allow(mce_solve_for_tax_basis , actually_solving);
-    SolveTarget.allow(mce_solve_for_non_mec   , actually_solving && 
mce_solve_loan != SolveType);
+    SolveTarget.allow(mce_solve_for_endt       , actually_solving);
+    SolveTarget.allow(mce_solve_for_target_csv , actually_solving);
+    SolveTarget.allow(mce_solve_for_target_naar, actually_solving);
+    SolveTarget.allow(mce_solve_for_tax_basis  , actually_solving);
+    SolveTarget.allow(mce_solve_for_non_mec    , actually_solving && 
mce_solve_loan != SolveType);
 
     // There is no fundamental reason for forbidding non-MEC solves on
     // bases other than current, but no one has ever complained about
@@ -810,7 +811,8 @@ 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_));
 
-    SolveTargetCashSurrenderValue.enable(actually_solving && 
mce_solve_for_target_csv == SolveTarget);
+    // INPUT !! Rename: s/SolveTargetCashSurrenderValue/SolveTargetValue/
+    SolveTargetCashSurrenderValue.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)
diff --git a/mc_enum_types.cpp b/mc_enum_types.cpp
index 1548a65..477f4aa 100644
--- a/mc_enum_types.cpp
+++ b/mc_enum_types.cpp
@@ -134,7 +134,7 @@ MC_DEFINE(ledger_type,8)
 MC_DEFINE(uw_basis,5)
 MC_DEFINE(table_rating,11)
 MC_DEFINE(solve_type,6)
-MC_DEFINE(solve_target,4)
+MC_DEFINE(solve_target,5)
 MC_DEFINE(pmt_strategy,8)
 MC_DEFINE(sa_strategy,8)
 MC_DEFINE(gen_acct_rate_type,2)
diff --git a/mc_enum_types.xpp b/mc_enum_types.xpp
index 40317c4..0dee4dd 100644
--- a/mc_enum_types.xpp
+++ b/mc_enum_types.xpp
@@ -231,12 +231,14 @@
 #define solve_target_VALUES \
     {mce_solve_for_endt \
     ,mce_solve_for_target_csv \
+    ,mce_solve_for_target_naar \
     ,mce_solve_for_tax_basis \
     ,mce_solve_for_non_mec \
     };
 #define solve_target_NAMES \
     {"Endowment" \
     ,"Target CSV" \
+    ,"Target NAAR" \
     ,"CSV = tax basis" \
     ,"Avoid MEC" \
     };
diff --git a/skin.xrc b/skin.xrc
index 135101b..c25a625 100644
--- a/skin.xrc
+++ b/skin.xrc
@@ -1882,6 +1882,7 @@ here, but it looks weird if we don't make this look like 
its siblings.
                 <content>
                     <item>Endowment</item>
                     <item>Target CSV</item>
+                    <item>Target NAAR</item>
                     <item>CSV = tax basis</item>
                     <item>Avoid MEC</item>
                 </content>
diff --git a/skin_coli_boli.xrc b/skin_coli_boli.xrc
index f1cebf7..d5c0391 100644
--- a/skin_coli_boli.xrc
+++ b/skin_coli_boli.xrc
@@ -2200,6 +2200,7 @@ here, but it looks weird if we don't make this look like 
its siblings.
                         <content>
                             <item>Endowment</item>
                             <item>Target CSV</item>
+                            <item>Target NAAR</item>
                             <item>CSV = tax basis</item>
                             <item>Avoid MEC</item>
                         </content>
diff --git a/skin_group_carveout.xrc b/skin_group_carveout.xrc
index 01fc660..7f9c0e7 100644
--- a/skin_group_carveout.xrc
+++ b/skin_group_carveout.xrc
@@ -1422,6 +1422,7 @@ here, but it looks weird if we don't make this look like 
its siblings.
                                 <content>
                                     <item>Endowment</item>
                                     <item>Target CSV</item>
+                                    <item>Target NAAR</item>
                                     <item>CSV = tax basis</item>
                                     <item>Avoid MEC</item>
                                 </content>
diff --git a/skin_group_carveout3.xrc b/skin_group_carveout3.xrc
index b689136..c7b733a 100644
--- a/skin_group_carveout3.xrc
+++ b/skin_group_carveout3.xrc
@@ -743,6 +743,7 @@
                                 <content>
                                     <item>Endowment</item>
                                     <item>Target CSV</item>
+                                    <item>Target NAAR</item>
                                     <item>CSV = tax basis</item>
                                     <item>Avoid MEC</item>
                                 </content>
diff --git a/solve.cpp b/solve.cpp
index 344feef..82c806f 100644
--- a/solve.cpp
+++ b/solve.cpp
@@ -139,7 +139,8 @@ double SolveTest()
             y = ThatSolveTargetCSV;
             }
             break;
-        case mce_solve_for_tax_basis: // Fall through.
+        case mce_solve_for_target_naar: // Fall through.
+        case mce_solve_for_tax_basis:   // Fall through.
         case mce_solve_for_non_mec:
             {
             alarum() << "Not implemented.";
diff --git a/types.rnc b/types.rnc
index cb84ab0..497a7bd 100644
--- a/types.rnc
+++ b/types.rnc
@@ -151,6 +151,7 @@ solve_type =
 solve_target =
       "Endowment"
     | "Target CSV"
+    | "Target NAAR"
     | "CSV = tax basis"
     | "Avoid MEC"
 
diff --git a/types.xsd b/types.xsd
index 61c019d..31034e3 100644
--- a/types.xsd
+++ b/types.xsd
@@ -253,6 +253,7 @@ but none use both, so a single set of enumerators 
suffices.</xs:documentation>
     <xs:restriction base="xs:token">
       <xs:enumeration value="Endowment"/>
       <xs:enumeration value="Target CSV"/>
+      <xs:enumeration value="Target NAAR"/>
       <xs:enumeration value="CSV = tax basis"/>
       <xs:enumeration value="Avoid MEC"/>
     </xs:restriction>



reply via email to

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