From 655cfb355087b76369ff7a3f8c21fb9ff1a9333c Mon Sep 17 00:00:00 2001 From: Dave Parker Date: Thu, 22 Oct 2015 00:32:04 +0000 Subject: [PATCH] Some tidying in multi-objective code. git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@10813 bbc10eb1-c90d-0410-af57-cb519fbb1720 --- prism/src/sparse/PS_NondetMultiObj.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/prism/src/sparse/PS_NondetMultiObj.cc b/prism/src/sparse/PS_NondetMultiObj.cc index d8dbed33..e8743d8e 100644 --- a/prism/src/sparse/PS_NondetMultiObj.cc +++ b/prism/src/sparse/PS_NondetMultiObj.cc @@ -387,10 +387,11 @@ JNIEXPORT jdoubleArray __jlongpointer JNICALL Java_sparse_PrismSparse_PS_1Nondet } d2 += non_zeros[k] * soln[cols[k]]; } - + // see if the combined reward value is the min/max so far bool pickThis = first || (min&&(d2d1)); - - //HOTFIX for cumulative reward + // if it equals the min/max do far for the combined reward value, + // but it is better for some individual reward, we choose it. + // not sure why if (!pickThis && (d2==d1)) { for (int it = 0; it < lenProb + lenRew; it++) { if (it != ignoredWeight) { @@ -399,11 +400,10 @@ JNIEXPORT jdoubleArray __jlongpointer JNICALL Java_sparse_PrismSparse_PS_1Nondet break; } } - } } - if (pickThis) { + // store optimal values for combined and individual rewards d1 = d2; for (int it = 0; it < lenRew + lenProb; it++) if (it != ignoredWeight)