I am trying to apply [this POMDP solver with a given example][1] to my decision making problem and I followed the documentation in the repository to build different relevant classes and functions
ParticleUpperBound* StarMazeProblem::CreateParticleUpperBound(string name) const {
if (name == "TRIVIAL" || name == "DEFAULT") {
return new TrivialParticleUpperBound(this);
} else if (name == "MDP") {
return new MDPUpperBound(this, *this);
} else {
cerr << "Unsupported particle lower bound: " << name << endl;
exit(1);
}
}
ScenarioUpperBound* StarMazeProblem::CreateScenarioUpperBound(string name,
string particle_bound_name) const {
ScenarioUpperBound* bound = NULL;
if (name == "TRIVIAL" || name == "DEFAULT") {
bound = new TrivialParticleUpperBound(this);
} else if (name == "LOOKAHEAD") {
return new LookaheadUpperBound(this, *this,
CreateParticleUpperBound(particle_bound_name));
} else if (name == "MDP") {
return new MDPUpperBound(this, *this);
} else {
cerr << "Unsupported base upper bound: " << name << endl;
exit(0);
}
return bound;
}
here I got the following error for the above code:
src/starmaze.cpp:369:49: error: no matching function for call to 'despot::MDPUpperBound::MDPUpperBound(const despot::StarMazeProblem*, const despot::StarMazeProblem&)'
return new MDPUpperBound(this, *this);
^
In file included from src/starmaze.cpp:6:0:
../../../include/despot/core/builtin_upper_bounds.h:70:2: note: candidate: despot::MDPUpperBound::MDPUpperBound(const despot::MDP*, const despot::StateIndexer&)
MDPUpperBound(const MDP* model, const StateIndexer& indexer);
^~~~~~~~~~~~~
../../../include/despot/core/builtin_upper_bounds.h:70:2: note: no known conversion for argument 2 from 'const despot::StarMazeProblem' to 'const despot::StateIndexer&'
../../../include/despot/core/builtin_upper_bounds.h:63:7: note: candidate: despot::MDPUpperBound::MDPUpperBound(const despot::MDPUpperBound&)
class MDPUpperBound: public ParticleUpperBound, public BeliefUpperBound {
^~~~~~~~~~~~~
../../../include/despot/core/builtin_upper_bounds.h:63:7: note: candidate expects 1 argument, 2 provided
../../../include/despot/core/builtin_upper_bounds.h:63:7: note: candidate: despot::MDPUpperBound::MDPUpperBound(despot::MDPUpperBound&&)
../../../include/despot/core/builtin_upper_bounds.h:63:7: note: candidate expects 1 argument, 2 provided
src/starmaze.cpp: In member function 'virtual despot::ScenarioUpperBound* despot::StarMazeProblem::CreateScenarioUpperBound(std::__cxx11::string, std::__cxx11::string) const':
src/starmaze.cpp:382:63: error: no matching function for call to 'despot::LookaheadUpperBound::LookaheadUpperBound(const despot::StarMazeProblem*, const despot::StarMazeProblem&, despot::ParticleUpperBound*)'
CreateParticleUpperBound(particle_bound_name));
^
In file included from src/starmaze.cpp:6:0:
../../../include/despot/core/builtin_upper_bounds.h:37:2: note: candidate: despot::LookaheadUpperBound::LookaheadUpperBound(const despot::DSPOMDP*, const despot::StateIndexer&, despot::ParticleUpperBound*)
LookaheadUpperBound(const DSPOMDP* model, const StateIndexer& indexer,
^~~~~~~~~~~~~~~~~~~
../../../include/despot/core/builtin_upper_bounds.h:37:2: note: no known conversion for argument 2 from 'const despot::StarMazeProblem' to 'const despot::StateIndexer&'
../../../include/despot/core/builtin_upper_bounds.h:29:7: note: candidate: despot::LookaheadUpperBound::LookaheadUpperBound(const despot::LookaheadUpperBound&)
class LookaheadUpperBound: public ScenarioUpperBound {
^~~~~~~~~~~~~~~~~~~
../../../include/despot/core/builtin_upper_bounds.h:29:7: note: candidate expects 1 argument, 3 provided
../../../include/despot/core/builtin_upper_bounds.h:29:7: note: candidate: despot::LookaheadUpperBound::LookaheadUpperBound(despot::LookaheadUpperBound&&)
../../../include/despot/core/builtin_upper_bounds.h:29:7: note: candidate expects 1 argument, 3 provided
src/starmaze.cpp:385:49: error: no matching function for call to 'despot::MDPUpperBound::MDPUpperBound(const despot::StarMazeProblem*, const despot::StarMazeProblem&)'
return new MDPUpperBound(this, *this);
^
In file included from src/starmaze.cpp:6:0:
../../../include/despot/core/builtin_upper_bounds.h:70:2: note: candidate: despot::MDPUpperBound::MDPUpperBound(const despot::MDP*, const despot::StateIndexer&)
MDPUpperBound(const MDP* model, const StateIndexer& indexer);
^~~~~~~~~~~~~
../../../include/despot/core/builtin_upper_bounds.h:70:2: note: no known conversion for argument 2 from 'const despot::StarMazeProblem' to 'const despot::StateIndexer&'
../../../include/despot/core/builtin_upper_bounds.h:63:7: note: candidate: despot::MDPUpperBound::MDPUpperBound(const despot::MDPUpperBound&)
class MDPUpperBound: public ParticleUpperBound, public BeliefUpperBound {
^~~~~~~~~~~~~
../../../include/despot/core/builtin_upper_bounds.h:63:7: note: candidate expects 1 argument, 2 provided
../../../include/despot/core/builtin_upper_bounds.h:63:7: note: candidate: despot::MDPUpperBound::MDPUpperBound(despot::MDPUpperBound&&)
../../../include/despot/core/builtin_upper_bounds.h:63:7: note: candidate expects 1 argument, 2 provided
src/starmaze.cpp: At global scope:
**Update**
Part of my class is defined as
class StarMazeProblem : public DSPOMDP,
public MDP {
private:
std::vector<std::vector<std::vector<State> > > transition_probabilities_; //state, action, [state, weight]
public:
ParticleUpperBound* CreateParticleUpperBound(std::string name = "DEFAULT") const;//?
ScenarioUpperBound* CreateScenarioUpperBound(std::string name = "DEFAULT",
std::string particle_bound_name = "DEFAULT") const;
ScenarioLowerBound* CreateScenarioLowerBound(std::string name = "DEFAULT",
std::string particle_bound_name = "DEFAULT") const;
I tried to follow the examples and [instructions][2]. I can't figure out why I got these error messages.
[1]:
https://github.com/AdaCompNUS/despot/blob/API_redesign/examples/cpp_models/navigation/src/navigation.cpp
[2]:
https://github.com/AdaCompNUS/despot/blob/API_redesign/doc/cpp_model_doc/Tutorial%20on%20Using%20DESPOT%20with%20cpp%20model.md