Browse Source

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
master
Dave Parker 10 years ago
parent
commit
3afca48506
  1. 11
      prism/src/sparse/PS_NondetMultiObj.cc

11
prism/src/sparse/PS_NondetMultiObj.cc

@ -653,13 +653,20 @@ JNIEXPORT jdoubleArray __jlongpointer JNICALL Java_sparse_PrismSparse_PS_1Nondet
ret = env->NewDoubleArray(lenProb + lenRew); ret = env->NewDoubleArray(lenProb + lenRew);
jdouble *retNative = env->GetDoubleArrayElements(ret, 0); 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 //copy all computed elements
for (int it = 0; it < lenRew + lenProb; it++) for (int it = 0; it < lenRew + lenProb; it++)
if (it != ignoredWeight) 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 //compute the last element
if (ignoredWeight != -1) { 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++) for (int it = 0; it < lenRew + lenProb; it++)
if (it != ignoredWeight) if (it != ignoredWeight)
last -= weights[it] * retNative[it]; last -= weights[it] * retNative[it];

Loading…
Cancel
Save