-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixing bugs. case 5 runs. hits infinite loop #19
base: main
Are you sure you want to change the base?
Changes from 1 commit
f907b99
fc5b6f5
ffd6f0b
094bdfa
56aabce
590631b
e68d795
651cf52
9aff1f4
6d109b6
1c00802
9b07ac0
5789b28
31c6d24
d734917
ab172f9
dc8febc
960f707
8a57d39
b97bb3d
ee53234
060dd9a
e5055a1
2696126
3bf5fe7
9422522
934dfa3
03da6ee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. allocate reintroduced There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was it removed by me? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was. It used to be allocating an array but the data structure is a vector now. I assume that is partly why |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,8 +15,10 @@ class StateInterface; | |
class PR2State : public StateInterface { | ||
std::vector<int> vars; // values for vars | ||
std::vector< std::pair<int,int> > * _varvals = NULL; // varval pairs for partial states | ||
// void _allocate(); | ||
// void _deallocate(); | ||
void _allocate(int size) { | ||
vars.reserve(size); | ||
} | ||
void _deallocate() {} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't the memory be released? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I may be wrong, but I believe the C++ vector should automatically deallocate everything when it goes out of scope. Looking it up reserve doesn't seem to require a free method |
||
// void _copy_buffer_from_state(const PR2State &state); | ||
|
||
public: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Task changed to root task. Comparison between nodes asserts the tasks must be the same. Unsure which change would need to be made There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sitting on it, removing the assert seems to be the right choice There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you link to where the assert occurs? This in the FD core? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. task_proxy.h line 174. The assert ensures factproxies only compare when they have the same task. The taskproxy produces operators with facts from one task and the lazy search algorithm produces facts with another, making them incomperable. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -273,6 +273,9 @@ void PR2Wrapper::generate_nondet_operator_mappings() { | |
|
||
for (auto op : PR2.proxy->get_operators()) { | ||
//If not in the mapping yet | ||
PR2.general.conditional_mask.push_back(new vector<int>()); | ||
PR2.deadend.nondetop2fsaps.push_back(new vector< FSAP* >()); | ||
|
||
if (nondet_name_to_index.find(op.get_nondet_name()) == nondet_name_to_index.end()) { | ||
nondet_name_to_index[op.get_nondet_name()] = current_nondet_index; | ||
PR2.general.nondet_mapping.push_back(vector<int>()); | ||
|
@@ -306,50 +309,6 @@ void PR2Wrapper::generate_nondet_operator_mappings() { | |
} | ||
|
||
PR2.proxy->set_nondet_index_map(*nondet_index_map); | ||
|
||
//TODO | ||
//Reinstantiate conditional mask and possibly nondetop2fspas | ||
//They were previously global and not instantiated anywhere | ||
|
||
|
||
// /* Build the data structures required for mapping between the | ||
// * deterministic actions and their non-deterministic equivalents. */ | ||
// int cur_nondet = 0; | ||
// for (auto op : PR2.proxy->get_operators()) { | ||
|
||
// int nondet_index = -1; | ||
|
||
// PR2.general.conditional_mask.push_back(new vector<int>()); | ||
// PR2.deadend.nondetop2fsaps.push_back(new vector< FSAP* >()); | ||
|
||
// if (PRP.general.nondet_index_mapping.find(op.get_nondet_name()) == PRP.general.nondet_index_mapping.end()) { | ||
|
||
// nondet_index = cur_nondet; | ||
// PRP.general.nondet_index_mapping[op.get_nondet_name()] = cur_nondet; | ||
|
||
// PRP.general.nondet_mapping.push_back(new vector<GlobalOperator *>()); | ||
// PRP.general.conditional_mask.push_back(new vector<int>()); | ||
|
||
// PRP.deadend.nondetop2fsaps.push_back(new vector< FSAP* >()); | ||
|
||
// cur_nondet++; | ||
|
||
// } else { | ||
// nondet_index = PRP.general.nondet_index_mapping[op.get_nondet_name()]; | ||
// } | ||
|
||
// op.nondet_index = nondet_index; | ||
// PRP.general.nondet_mapping[nondet_index]->push_back(&op); | ||
// op.nondet_outcome = PRP.general.nondet_mapping[nondet_index]->size() - 1; | ||
|
||
// for (auto eff : op.get_all_effects()) { | ||
// for (auto cond : eff.conditions) { | ||
// vector<int> *var_list = PRP.general.conditional_mask[nondet_index]; | ||
// if (find(var_list->begin(), var_list->end(), cond.var) == var_list->end()) | ||
// PRP.general.conditional_mask[nondet_index]->push_back(cond.var); | ||
// } | ||
// } | ||
// } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't it worth keeping this unworking code around for when we re-create the mask? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I still have that code in a local repository need be. I removed it to clean up the code. Conditional mask is put in the same places but I don't know if it has been tested yet. |
||
} | ||
|
||
void PR2OperatorProxy::update_nondet_info() { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Operators were being overwritten. Temporary fix is to assign them to a new pointer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all_fire_context still needs to be defined