1#ifndef PROBFD_ALGORITHMS_IDUAL_H
2#define PROBFD_ALGORITHMS_IDUAL_H
4#include "probfd/mdp_algorithm.h"
6#include "probfd/storage/per_state_storage.h"
8#include "probfd/progress_report.h"
10#include "downward/lp/lp_solver.h"
28 unsigned long long iterations = 0;
29 unsigned long long expansions = 0;
30 unsigned long long open = 0;
31 unsigned long long lp_variables = 0;
32 unsigned long long lp_constraints = 0;
34 void print(std::ostream& out)
const;
38 enum { NEW, OPEN, CLOSED, TERMINAL };
39 unsigned var_idx = std::numeric_limits<unsigned>::max();
40 unsigned constraints_idx = std::numeric_limits<unsigned>::max();
44struct FrontierStateInfo {
45 std::vector<unsigned> incoming;
50 value_t operator[](
unsigned i)
const {
return values_[i]; }
56 const std::vector<value_t>& values;
58 bool operator()(
unsigned x,
unsigned y)
const
60 return values[x] < values[y];
64 std::vector<value_t> values_;
65 std::set<unsigned, Comparator> indices_ =
66 std::set<unsigned, Comparator>(Comparator{values_});
75template <
typename State,
typename Action>
77 using Base =
typename IDual::MDPAlgorithm;
79 using MDPType =
typename Base::MDPType;
80 using EvaluatorType =
typename Base::EvaluatorType;
81 using PolicyType =
typename Base::PolicyType;
83 lp::LPSolver lp_solver_;
84 storage::PerStateStorage<PerStateInfo> state_infos_;
85 ValueGroup terminals_;
90 explicit IDual(lp::LPSolverType solver_type);
94 EvaluatorType& heuristic,
97 double max_time)
override;
99 std::unique_ptr<PolicyType> compute_policy(
101 EvaluatorType& heuristic,
104 double max_time)
override;
109 EvaluatorType& heuristic,
113 std::vector<double>& primal_solution,
114 std::vector<double>& dual_solution);
119#define GUARD_INCLUDE_PROBFD_ALGORITHMS_IDUAL_H
120#include "probfd/algorithms/idual_impl.h"
121#undef GUARD_INCLUDE_PROBFD_ALGORITHMS_IDUAL_H
Interface for MDP algorithm implementations.
Definition mdp_algorithm.h:29
A registry for print functions related to search progress.
Definition progress_report.h:33
Implementation of the I-Dual algorithm trevizan:etal:ijcai-17 .
Definition idual.h:76
Namespace dedicated to the i-dual MDP algorithm.
Definition idual.h:22
double value_t
Typedef for the state value type.
Definition aliases.h:7
typename std::conditional_t< is_cheap_to_copy_v< T >, T, const T & > param_type
Alias template defining the best way to pass a parameter of a given type.
Definition type_traits.h:25
Represents a closed interval over the extended reals as a pair of lower and upper bound.
Definition interval.h:12
I-Dual algorithm statistics.
Definition idual.h:27