Skip to content

Commit

Permalink
Make COST_FACTOR an int to fix compilation on macOS.
Browse files Browse the repository at this point in the history
  • Loading branch information
jendrikseipp committed Oct 2, 2023
1 parent 3e206ba commit 690c1d2
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
using namespace std;

namespace cost_saturation {
static const double COST_FACTOR = 1000;
static const int COST_FACTOR = 1000;

static vector<int> divide_costs_among_remaining_abstractions(
const vector<unique_ptr<Abstraction>> &abstractions,
Expand Down Expand Up @@ -131,7 +131,7 @@ int ScaledCostPartitioningHeuristic::compute_heuristic(const State &ancestor_sta
return DEAD_END;
}
double epsilon = 0.01;
return static_cast<int>(ceil((result / COST_FACTOR) - epsilon));
return static_cast<int>(ceil((result / static_cast<double>(COST_FACTOR)) - epsilon));
}


Expand All @@ -142,7 +142,7 @@ shared_ptr<AbstractTask> get_scaled_costs_task(const shared_ptr<AbstractTask> &t
cerr << "Overflowing cost : " << cost << endl;
utils::exit_with(utils::ExitCode::SEARCH_CRITICAL_ERROR);
}
cost = static_cast<int>(cost * COST_FACTOR);
cost *= COST_FACTOR;
}
return make_shared<extra_tasks::ModifiedOperatorCostsTask>(task, move(costs));
}
Expand Down

0 comments on commit 690c1d2

Please sign in to comment.