diff --git a/prism/src/sparse/PS_NondetMultiObj.cc b/prism/src/sparse/PS_NondetMultiObj.cc index 43d66566..1f789e98 100644 --- a/prism/src/sparse/PS_NondetMultiObj.cc +++ b/prism/src/sparse/PS_NondetMultiObj.cc @@ -443,19 +443,20 @@ JNIEXPORT jdoubleArray __jlongpointer JNICALL Java_sparse_PrismSparse_PS_1Nondet first = false; } + // HOTFIX: it seems that on self loops d1 can be unchanged because the other for cycle is not executed, which is not desirable + if (d1 == -INFINITY) { + d1 = 0; + for (int it = 0; it < lenRew + lenProb; it++) { + pd1[it] = 0; + } + } + double val_yes = 0.0; for (int probi = 0; probi < lenProb; probi++) { if (max_iters_local - iters < step_bounds[probi]) val_yes += weights[probi] * yes_vec[probi][i]; } - //HOTFIX: it seems that on self loops d1 can be unchanged because the other for cycle is not executed, which is not desirable - if (d1==-INFINITY) { - d1 = 0; - for (int it = 0; it < lenRew + lenProb; it++) - pd1[it] = 0; - } - //TODO: we need to handle val_yes somehow if (val_yes == 0 || d1>val_yes) { for (int it = 0; it < lenProb + lenRew; it++) { diff --git a/prism/src/sparse/PS_NondetMultiObjGS.cc b/prism/src/sparse/PS_NondetMultiObjGS.cc index 782220ac..54cc30f0 100644 --- a/prism/src/sparse/PS_NondetMultiObjGS.cc +++ b/prism/src/sparse/PS_NondetMultiObjGS.cc @@ -336,7 +336,6 @@ JNIEXPORT jdoubleArray __jlongpointer JNICALL Java_sparse_PrismSparse_PS_1Nondet } // see if the combined reward value is the min/max so far bool pickThis = first || (min&&(d2d1)); - //HOTFIX for cumulative reward if (!pickThis && (d2==d1)) { for (int it = 0; it < lenProb + lenRew; it++) { @@ -367,20 +366,20 @@ JNIEXPORT jdoubleArray __jlongpointer JNICALL Java_sparse_PrismSparse_PS_1Nondet first = false; } + // HOTFIX: it seems that on self loops d1 can be unchanged because the other for cycle is not executed, which is not desirable + if (d1 == -INFINITY) { + d1 = 0; + for (int it = 0; it < lenRew + lenProb; it++) { + pd1[it] = 0; + } + } + double val_yes = 0.0; for (int probi = 0; probi < lenProb; probi++) { if (probi != ignoredWeight && yes_vec[probi]!=NULL); val_yes += weights[probi] * yes_vec[probi][i]; } - - //HOTFIX: it seems that on self loops d1 can be unchanged because the other for cycle is not executed, which is not desirable - if (d1==-INFINITY) { - d1 = 0; - for (int it = 0; it < lenRew + lenProb; it++) - pd1[it] = 0; - } - //TODO: we need to handle val_yes somehow if (val_yes == 0 || d1>val_yes) {