From 3afca485061c0c86af1027f209142212bd2cf442 Mon Sep 17 00:00:00 2001 From: Dave Parker Date: Mon, 16 Nov 2015 09:11:44 +0000 Subject: [PATCH] More info printed out by multi-objective value iteration + more efficient vector access. git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@10880 bbc10eb1-c90d-0410-af57-cb519fbb1720 --- prism/src/sparse/PS_NondetMultiObj.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/prism/src/sparse/PS_NondetMultiObj.cc b/prism/src/sparse/PS_NondetMultiObj.cc index 2a7299d2..a20871f7 100644 --- a/prism/src/sparse/PS_NondetMultiObj.cc +++ b/prism/src/sparse/PS_NondetMultiObj.cc @@ -653,13 +653,20 @@ JNIEXPORT jdoubleArray __jlongpointer JNICALL Java_sparse_PrismSparse_PS_1Nondet ret = env->NewDoubleArray(lenProb + lenRew); jdouble *retNative = env->GetDoubleArrayElements(ret, 0); + // Display result + PS_PrintToMainLog(env, "Optimal value for weights ["); + for (int it = 0; it < lenRew + lenProb; it++) { + PS_PrintToMainLog(env, "%s%f", (it>0?",":""), weights[it]); + } + PS_PrintToMainLog(env, "] from initial state: %f\n", soln[start_index]); + //copy all computed elements for (int it = 0; it < lenRew + lenProb; it++) if (it != ignoredWeight) - retNative[it] = max_double_vector_over_bdd(ddman, psoln[it], start, rvars, num_rvars, odd); + retNative[it] = psoln[it][start_index]; //compute the last element if (ignoredWeight != -1) { - double last = max_double_vector_over_bdd(ddman, soln, start, rvars, num_rvars, odd); + double last = soln[start_index]; for (int it = 0; it < lenRew + lenProb; it++) if (it != ignoredWeight) last -= weights[it] * retNative[it];