diff --git a/prism/src/sparse/PS_NondetMultiReachReward.cc b/prism/src/sparse/PS_NondetMultiReachReward.cc index b695de1d5..393737416 100644 --- a/prism/src/sparse/PS_NondetMultiReachReward.cc +++ b/prism/src/sparse/PS_NondetMultiReachReward.cc @@ -669,7 +669,7 @@ JNIEXPORT jdouble __jlongpointer JNICALL Java_sparse_PrismSparse_PS_1NondetMulti } // Modify result based on type - if (relops[0] != 0 && relopsReward[0] != 3 && relopsReward[0] != 8) { + if ((num_targets == 0 || relops[0] != 0) && (num_rewards == 0 || (relopsReward[0] != 3 && relopsReward[0] != 8))) { // for qualitative queries, return 1/0 for existence of solution or not PS_PrintToMainLog(env, "LP problem solution %sfound so result is %s\n", lp_solved ? "" : "not ", lp_solved ? "true" : "false"); lp_result = lp_solved ? 1.0 : 0.0; diff --git a/prism/src/sparse/PS_NondetMultiReachReward1.cc b/prism/src/sparse/PS_NondetMultiReachReward1.cc index 93eabe926..3364f7e4d 100644 --- a/prism/src/sparse/PS_NondetMultiReachReward1.cc +++ b/prism/src/sparse/PS_NondetMultiReachReward1.cc @@ -744,7 +744,7 @@ JNIEXPORT jdouble __jlongpointer JNICALL Java_sparse_PrismSparse_PS_1NondetMulti } // Modify result based on type - if (relops[0] != 0 && relopsReward[0] != 3 && relopsReward[0] != 8) { + if ((num_targets == 0 || relops[0] != 0) && (num_rewards == 0 || (relopsReward[0] != 3 && relopsReward[0] != 8))) { // for qualitative queries, return 1/0 for existence of solution or not PS_PrintToMainLog(env, "LP problem solution %sfound so result is %s\n", lp_solved ? "" : "not ", lp_solved ? "true" : "false"); lp_result = lp_solved ? 1.0 : 0.0;