Skip to content

Commit 094bdfa

Browse files
committed
continued bug squashing
1 parent ffd6f0b commit 094bdfa

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

src/fond_search.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,8 @@ bool case3_predefined_path(PR2SearchStatus * SS) {
315315
// of the inconsistent full-states that share the same
316316
// abstract path. Thus, this check becomes an invariant.
317317

318+
solstep->state;
319+
318320
assert(SS->current_state->entails(*(solstep->state)));
319321
assert(SS->previous_step);
320322

src/pr2.cc

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,3 +316,42 @@ void PR2OperatorProxy::update_nondet_info() {
316316
nondet_outcome = PR2.general.nondet_outcome_mapping[_index];
317317
}
318318

319+
bool PR2Wrapper::pr2_goal_check(TaskProxy task, State state) {
320+
if (PR2.solution.incumbent){
321+
SolutionStep * best_step = PR2.solution.incumbent->get_step(state);
322+
323+
if ((best_step && PR2.weaksearch.stop_on_policy) || (best_step && best_step->is_goal)) {
324+
#ifndef NDEBUG
325+
if (!best_step->is_goal) {
326+
PR2State *cur = new PR2State(state);
327+
assert(!is_forbidden(*cur, best_step->op));
328+
delete cur;
329+
}
330+
#endif
331+
PR2.general.matched_step = best_step;
332+
return true;
333+
} else {
334+
return false;
335+
}
336+
}
337+
338+
for (auto varval : PR2.general.goal_op->get_preconditions()) {
339+
340+
if (state[varval.get_variable().get_id()].get_value() != varval.get_value()) {
341+
return false;
342+
}
343+
}
344+
345+
PR2State *gs = new PR2State();
346+
for (auto varval : PR2.general.goal_op->get_preconditions())
347+
(*gs)[varval.get_variable().get_id()] = varval.get_value();
348+
349+
SolutionStep *grs = new SolutionStep(gs, PR2.solution.incumbent->network, 0,
350+
// Null?
351+
PR2OperatorProxy(*PR2.general.goal_op),
352+
-1, true, true, true);
353+
354+
PR2.general.matched_step = grs;
355+
356+
return true;
357+
}

src/pr2.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ struct PR2Wrapper {
6363

6464
void generate_nondet_operator_mappings();
6565

66+
bool pr2_goal_check(TaskProxy task, State state);
6667

6768
/*********************************************
6869
*

0 commit comments

Comments
 (0)