lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 82abedb 4/5: Elaborate solve traces


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 82abedb 4/5: Elaborate solve traces
Date: Sun, 18 Jul 2021 08:13:54 -0400 (EDT)

branch: master
commit 82abedbcfd00ccabdb1ac3b9fde0325fce96acde
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Elaborate solve traces
    
    It is occasionally useful to enable the "idiosyncrasyT" behavior in
    every case, e.g.:
    
    -    if(contains(yare_input_.Comments, "idiosyncrasyT"))
    +    if(true || contains(yare_input_.Comments, "idiosyncrasyT"))
    
    when running a set of input files (as for a system test), thus saving
    a trace of every solve in a single file. In that case, it is important
    to name the input file and describe the solve.
    
    Removed the exclusion of guaranteed-premium solves because they are
    as interesting as any other solve.
---
 ihs_avsolve.cpp       | 13 ++++++++++++-
 mc_enum_types_aux.cpp |  2 ++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/ihs_avsolve.cpp b/ihs_avsolve.cpp
index 0020448..f6d8b9c 100644
--- a/ihs_avsolve.cpp
+++ b/ihs_avsolve.cpp
@@ -457,10 +457,21 @@ currency AccountValue::Solve
 
     std::ostream os_trace(status().rdbuf());
     std::ofstream ofs_trace;
-    if(contains(yare_input_.Comments, "idiosyncrasyT") && 
!SolvingForGuarPremium)
+    if(contains(yare_input_.Comments, "idiosyncrasyT"))
         {
         ofs_trace.open("trace.txt", ios_out_app_binary());
         os_trace.rdbuf(ofs_trace.rdbuf());
+        os_trace << InputFilename << std::endl;
+        os_trace << "Solving for";
+        if(SolvingForGuarPremium)
+            {
+            os_trace << " guaranteed premium:";
+            }
+        os_trace
+            << " " << mc_str(a_SolveType)
+            << ", target " << mc_str(SolveTarget_)
+            << std::endl
+            ;
         }
 
     SolveHelper solve_helper(*this, solve_set_fn);
diff --git a/mc_enum_types_aux.cpp b/mc_enum_types_aux.cpp
index b24dc1d..a3f4c4b 100644
--- a/mc_enum_types_aux.cpp
+++ b/mc_enum_types_aux.cpp
@@ -139,6 +139,8 @@ template std::string mc_str(mcenum_mode                );
 template std::string mc_str(mcenum_report_column       );
 template std::string mc_str(mcenum_run_basis           );
 template std::string mc_str(mcenum_smoking             );
+template std::string mc_str(mcenum_solve_target        );
+template std::string mc_str(mcenum_solve_type          );
 template std::string mc_str(mcenum_state               );
 template std::string mc_str(mcenum_table_rating        );
 template std::string mc_str(mcenum_uw_basis            );



reply via email to

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