Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: aibasel/downward
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: hyperc-ai/downward
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ch-addition
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 15 commits
  • 24 files changed
  • 1 contributor

Commits on Jul 17, 2020

  1. Copy the full SHA
    3e8260c View commit details
  2. translate speed up

    andreykyz committed Jul 17, 2020
    Copy the full SHA
    cd7a057 View commit details

Commits on Jul 30, 2020

  1. cygwin

    andreykyz committed Jul 30, 2020
    Copy the full SHA
    feb36b9 View commit details
  2. Revert "cygwin"

    This reverts commit feb36b9.
    andreykyz committed Jul 30, 2020
    Copy the full SHA
    7309bae View commit details
  3. del [???]

    andreykyz committed Jul 30, 2020
    Copy the full SHA
    e7eb925 View commit details

Commits on Sep 3, 2020

  1. add loglevel

    andreykyz committed Sep 3, 2020
    Copy the full SHA
    fdedd2a View commit details
  2. del waste log

    andreykyz committed Sep 3, 2020
    Copy the full SHA
    c484eef View commit details
  3. default loglevel info

    andreykyz committed Sep 3, 2020
    Copy the full SHA
    fe6191b View commit details

Commits on Sep 10, 2020

  1. add error message printing

    andreykyz committed Sep 10, 2020
    Copy the full SHA
    1d1ff8b View commit details

Commits on Dec 9, 2020

  1. dump pushes

    andreykyz committed Dec 9, 2020
    Copy the full SHA
    1a6b217 View commit details
  2. fix dump and chart

    andreykyz committed Dec 9, 2020
    Copy the full SHA
    052bace View commit details

Commits on Dec 10, 2020

  1. Copy the full SHA
    33ef069 View commit details
  2. add chart plotter

    andreykyz committed Dec 10, 2020
    Copy the full SHA
    b2ae15b View commit details

Commits on Dec 14, 2020

  1. polyfit

    andreykyz committed Dec 14, 2020
    Copy the full SHA
    c4aba29 View commit details

Commits on Dec 15, 2020

  1. Copy the full SHA
    1d51c6c View commit details
2 changes: 2 additions & 0 deletions driver/aliases.py
Original file line number Diff line number Diff line change
@@ -147,6 +147,8 @@ def _get_lama(**kwargs):
PORTFOLIOS = {}
for portfolio in os.listdir(PORTFOLIO_DIR):
name, ext = os.path.splitext(portfolio)
if not ext == ".py":
continue
assert ext == ".py", portfolio
PORTFOLIOS[name.replace("_", "-")] = os.path.join(PORTFOLIO_DIR, portfolio)

1 change: 1 addition & 0 deletions driver/returncodes.py
Original file line number Diff line number Diff line change
@@ -29,6 +29,7 @@
DRIVER_CRITICAL_ERROR = 35
DRIVER_INPUT_ERROR = 36
DRIVER_UNSUPPORTED = 37
OUT_OF_TOTAL_QUEUE_PUSHES = 150


def print_stderr(*args, **kwargs):
20 changes: 20 additions & 0 deletions src/search/command_line.cc
Original file line number Diff line number Diff line change
@@ -11,9 +11,12 @@

#include <algorithm>
#include <vector>
#include <string>

using namespace std;

LOG_LEVEL loglevel = info;

ArgError::ArgError(const string &msg)
: msg(msg) {
}
@@ -64,6 +67,23 @@ static shared_ptr<SearchEngine> parse_cmd_line_aux(
OptionParser parser(sanitize_arg_string(args[i]), registry,
predefinitions, dry_run);
engine = parser.start_parsing<shared_ptr<SearchEngine>>();
} else if (arg == "--loglevel") {
if (is_last)
throw ArgError("missing argument after --loglevel");
++i;
// string::l = args[i];
if (!args[i].compare("debug")) {
loglevel = debug;
} else if (!args[i].compare("trace")) {
loglevel = trace;
} else if (!args[i].compare("warning")) {
loglevel = warning;
} else if (!args[i].compare("error")) {
loglevel = error;
} else if (!args[i].compare("info")) {
loglevel = info;
}
cout << "loglevel: " << loglevel << endl;
} else if (arg == "--help" && dry_run) {
cout << "Help:" << endl;
bool txt2tags = false;
7 changes: 7 additions & 0 deletions src/search/command_line.h
Original file line number Diff line number Diff line change
@@ -6,6 +6,13 @@
#include <memory>
#include <string>

enum LOG_LEVEL { error,
warning,
info,
debug,
trace };


namespace options {
class Registry;
}
12 changes: 8 additions & 4 deletions src/search/pdbs/pattern_collection_generator_genetic.cc
Original file line number Diff line number Diff line change
@@ -141,8 +141,8 @@ bool PatternCollectionGeneratorGenetic::is_pattern_too_large(
for (size_t i = 0; i < pattern.size(); ++i) {
VariableProxy var = variables[pattern[i]];
int domain_size = var.get_domain_size();
if (!utils::is_product_within_limit(mem, domain_size, pdb_max_size))
return true;
// if (!utils::is_product_within_limit(mem, domain_size, pdb_max_size))
// return true;
mem *= domain_size;
}
return false;
@@ -161,9 +161,11 @@ bool PatternCollectionGeneratorGenetic::mark_used_variables(

void PatternCollectionGeneratorGenetic::evaluate(vector<double> &fitness_values) {
TaskProxy task_proxy(*task);
int i = 0;
for (const auto &collection : pattern_collections) {
//utils::g_log << "evaluate pattern collection " << (i + 1) << " of "
// << pattern_collections.size() << endl;
utils::g_log << "evaluate pattern collection " << (i + 1) << " of "
<< pattern_collections.size() << endl;
i++;
double fitness = 0;
bool pattern_valid = true;
vector<bool> variables_used(task_proxy.get_variables().size(), false);
@@ -189,6 +191,7 @@ void PatternCollectionGeneratorGenetic::evaluate(vector<double> &fitness_values)
remove_irrelevant_variables(pattern);
pattern_collection->push_back(pattern);
}
utils::g_log << " ... do zw" << endl;
if (!pattern_valid) {
/* Set fitness to a very small value to cover cases in which all
patterns are invalid. */
@@ -205,6 +208,7 @@ void PatternCollectionGeneratorGenetic::evaluate(vector<double> &fitness_values)
best_patterns = pattern_collection;
}
}
utils::g_log << " ... zw done" << endl;
fitness_values.push_back(fitness);
}
}
1 change: 1 addition & 0 deletions src/search/pdbs/zero_one_pdbs.cc
Original file line number Diff line number Diff line change
@@ -58,6 +58,7 @@ double ZeroOnePDBs::compute_approx_mean_finite_h() const {
double approx_mean_finite_h = 0;
for (const shared_ptr<PatternDatabase> &pdb : pattern_databases) {
approx_mean_finite_h += pdb->compute_mean_finite_h();
cout << "h: " << approx_mean_finite_h << endl;
}
return approx_mean_finite_h;
}
12 changes: 12 additions & 0 deletions src/search/plan_manager.cc
Original file line number Diff line number Diff line change
@@ -69,3 +69,15 @@ void PlanManager::save_plan(
utils::g_log << "Plan cost: " << plan_cost << endl;
++num_previously_generated_plans;
}
void PlanManager::print_plan(const Plan &plan, const TaskProxy &task_proxy) {
OperatorsProxy operators = task_proxy.get_operators();
for (OperatorID op_id : plan) {
cout << operators[op_id].get_name() << " (" << operators[op_id].get_cost() << ")" << endl;
}
}

void PlanManager::print_cost(const Plan &plan, const TaskProxy &task_proxy) {
int plan_cost = calculate_plan_cost(plan, task_proxy);
cout << "Plan length: " << plan.size() << " step(s)." << endl;
cout << "Plan cost: " << plan_cost << endl;
}
3 changes: 3 additions & 0 deletions src/search/plan_manager.h
Original file line number Diff line number Diff line change
@@ -27,6 +27,9 @@ class PlanManager {
void save_plan(
const Plan &plan, const TaskProxy &task_proxy,
bool generates_multiple_plan_files = false);
void print_plan(
const Plan &plan, const TaskProxy &task_proxy);
void print_cost(const Plan &plan, const TaskProxy &task_proxy);
};

extern int calculate_plan_cost(const Plan &plan, const TaskProxy &task_proxy);
12 changes: 12 additions & 0 deletions src/search/search_engine.cc
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@
#include "utils/rng_options.h"
#include "utils/system.h"
#include "utils/timer.h"
#include "command_line.h"

#include <cassert>
#include <iostream>
@@ -24,6 +25,8 @@ using utils::ExitCode;

class PruningMethod;

extern LOG_LEVEL loglevel;

successor_generator::SuccessorGenerator &get_successor_generator(const TaskProxy &task_proxy) {
utils::g_log << "Building successor generator..." << flush;
int peak_memory_before = utils::get_peak_memory_in_kb();
@@ -107,6 +110,15 @@ bool SearchEngine::check_goal_and_set_plan(const GlobalState &state) {
set_plan(plan);
return true;
}
Plan plan;
if ((loglevel > info )){
search_space.trace_path(state, plan);
cout << "---" << endl;
if (loglevel == trace){
plan_manager.print_plan(plan, task_proxy); // grandrew
}
plan_manager.print_cost(plan, task_proxy);
}
return false;
}

1 change: 1 addition & 0 deletions src/search/search_engines/eager_search.cc
Original file line number Diff line number Diff line change
@@ -113,6 +113,7 @@ SearchStatus EagerSearch::step() {
while (true) {
if (open_list->empty()) {
utils::g_log << "Completely explored state space -- no solution!" << endl;
std::cerr << "Completely explored state space -- no solution!" << endl;
return FAILED;
}
StateID id = open_list->remove_min();
1 change: 1 addition & 0 deletions src/search/search_engines/enforced_hill_climbing_search.cc
Original file line number Diff line number Diff line change
@@ -114,6 +114,7 @@ void EnforcedHillClimbingSearch::initialize() {

if (dead_end) {
utils::g_log << "Initial state is a dead end, no solution" << endl;
std::cerr << "Initial state is a dead end, no solution" << endl;
if (evaluator->dead_ends_are_reliable())
utils::exit_with(ExitCode::SEARCH_UNSOLVABLE);
else
2 changes: 2 additions & 0 deletions src/search/search_engines/iterated_search.cc
Original file line number Diff line number Diff line change
@@ -111,9 +111,11 @@ SearchStatus IteratedSearch::step_return_value() {
} else {
if (continue_on_fail) {
utils::g_log << "No solution found - keep searching" << endl;
std::cerr << "No solution found - keep searching" << endl;
return IN_PROGRESS;
} else {
utils::g_log << "No solution found - stop searching" << endl;
std::cerr << "No solution found - stop searching" << endl;
return iterated_found_solution ? SOLVED : FAILED;
}
}
Loading