Browse Source

Refactoring + tidying in multi-objective value iteration.

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@10884 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Dave Parker 10 years ago
parent
commit
d52576a6dd
  1. 15
      prism/src/sparse/PS_NondetMultiObj.cc
  2. 17
      prism/src/sparse/PS_NondetMultiObjGS.cc

15
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++) {

17
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&&(d2<d1)) || (!min&&(d2>d1));
//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)
{

Loading…
Cancel
Save