[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 1a54e49 1/2: Clarify non-MEC solves
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 1a54e49 1/2: Clarify non-MEC solves |
Date: |
Fri, 11 Sep 2020 15:43:30 -0400 (EDT) |
branch: master
commit 1a54e490ed35a6a2e56aa852d4d23c596477db50
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Clarify non-MEC solves
Changed the objective function to
is_mec ? -1.0 : 1.0
which expresses the intention clearly, as opposed to the old
0.5 - is_mec
which was just too cute. Improved documentation.
---
ihs_avsolve.cpp | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/ihs_avsolve.cpp b/ihs_avsolve.cpp
index 4e04d98..27f3da5 100644
--- a/ihs_avsolve.cpp
+++ b/ihs_avsolve.cpp
@@ -125,6 +125,11 @@ class SolveHelper
/// contract ever becomes a MEC. The result is naturally a boundary
/// value, so it is not interesting to compare it to any solve input.
///
+/// Non-MEC solves for loan or withdrawal are untested because they
+/// probably make no sense--see:
+/// https://lists.nongnu.org/archive/html/lmi/2009-02/msg00028.html
+/// so perhaps they should be prohibited.
+///
/// Non-MEC solves seem acceptably fast despite this two-valued step
/// function. Other options considered include:
/// - Use MEC duration. This inserts a monotone segment into the
@@ -231,7 +236,7 @@ double AccountValue::SolveTest(double a_CandidateValue)
if(mce_solve_for_non_mec == SolveTarget_)
{
- return 0.5 - InvariantValues().IsMec;
+ return InvariantValues().IsMec ? -1.0 : 1.0;
}
return value - SolveTargetCsv_;