@@ -207,7 +207,7 @@ protected:
207
207
Config _config;
208
208
209
209
// ! _all_paths[i] contains all paths in the simulation that reach a node that satisfies goal atom 'i'.
210
- std::vector<std::vector<NodePT>> _all_paths;
210
+ // std::vector<std::vector<NodePT>> _all_paths;
211
211
212
212
std::vector<NodePT> _optimal_paths;
213
213
@@ -244,7 +244,7 @@ public:
244
244
IWRun (const StateModel& model, const FeatureSetT& featureset, const IWRun::Config& config) :
245
245
Base (model, OpenListT(), ClosedListT()),
246
246
_config (config),
247
- _all_paths (model.num_subgoals()),
247
+ // _all_paths(model.num_subgoals()),
248
248
_optimal_paths (model.num_subgoals()),
249
249
_unreached (),
250
250
_in_seed (model.num_subgoals(), false ),
@@ -302,39 +302,46 @@ public:
302
302
}
303
303
304
304
305
+ std::vector<bool > compute_R (const StateT& seed) {
306
+ if (_config._use_goal_directed_info ) {
307
+ return compute_goal_directed_R (seed);
308
+ } else {
309
+ return compute_R_IW1 (seed);
310
+ }
311
+ }
312
+
305
313
std::vector<bool > compute_R_IW1 (const StateT& seed) {
314
+ LPT_INFO (" cout" , " IW Simulation - Computing blind R" );
315
+ _config._max_width = 1 ;
316
+ _config._bound = -1 ; // No bound
317
+ std::vector<NodePT> seed_nodes;
318
+ _compute_R (seed, seed_nodes);
319
+
320
+ LPT_INFO (" cout" , " IW Simulation - Number of seed nodes: " << seed_nodes.size ());
321
+ std::vector<bool > rel_blind = _evaluator.reached_atoms ();
322
+ LPT_INFO (" cout" , " IW Simulation - Blind |R| = " << std::count (rel_blind.begin (), rel_blind.end (), true ));
323
+ return rel_blind;
324
+ }
325
+
326
+ std::vector<bool > compute_goal_directed_R (const StateT& seed) {
327
+ LPT_INFO (" cout" , " IW Simulation - Computing goal-directed R" );
306
328
const AtomIndex& index = Problem::getInstance ().get_tuple_index ();
307
- // _config._max_width = 1 ;
329
+ _config._max_width = 2 ;
308
330
_config._bound = -1 ; // No bound
309
331
std::vector<NodePT> seed_nodes;
310
- compute_R (seed, seed_nodes);
332
+ _compute_R (seed, seed_nodes);
311
333
312
334
313
335
LPT_INFO (" cout" , " IW Simulation - Number of seed nodes: " << seed_nodes.size ());
314
336
315
- // COMPUTE BOTH OPTIONS, FOR THE SAKE OF INFORMATIVENESS
316
337
std::vector<bool > rel_goal_directed (index .size (), false );
317
338
mark_atoms_in_path_to_subgoal (seed_nodes, rel_goal_directed);
318
-
319
- std::vector<bool > rel_blind = _evaluator.reached_atoms ();
320
-
321
-
322
339
LPT_INFO (" cout" , " IW Simulation - Goal-directed |R| = " << std::count (rel_goal_directed.begin (), rel_goal_directed.end (), true ));
323
- LPT_INFO (" cout" , " IW Simulation - Blind |R| = " << std::count (rel_blind.begin (), rel_blind.end (), true ));
324
-
325
- if (_config._use_goal_directed_info ) {
326
- LPT_INFO (" cout" , " IW Simulation - Using goal-directed R" );
327
- return rel_goal_directed;
328
- } else {
329
- LPT_INFO (" cout" , " IW Simulation - Using blind R" );
330
- return rel_blind;
331
- }
332
- }
333
-
334
-
340
+ return rel_goal_directed;
341
+ }
335
342
336
343
337
- std::vector<AtomIdx> compute_R (const StateT& seed, std::vector<NodePT>& seed_nodes) {
344
+ std::vector<AtomIdx> _compute_R (const StateT& seed, std::vector<NodePT>& seed_nodes) {
338
345
339
346
_config._complete = false ;
340
347
@@ -477,7 +484,7 @@ protected:
477
484
478
485
if (this ->_model .goal (state, subgoal_idx)) {
479
486
node->satisfies_subgoal = true ;
480
- _all_paths[subgoal_idx].push_back (node);
487
+ // _all_paths[subgoal_idx].push_back(node);
481
488
if (!_optimal_paths[subgoal_idx]) _optimal_paths[subgoal_idx] = node;
482
489
it = _unreached.erase (it);
483
490
} else {
0 commit comments