From bf24ee18a072624cbf2c01070a26e8ec6be11c95 Mon Sep 17 00:00:00 2001 From: Constantinos Date: Wed, 17 Aug 2022 14:45:27 +0800 Subject: [PATCH 1/2] Fix function signature in documentation The function of createLowerBound is [const](https://github.com/AdaCompNUS/despot/blob/56c4fd5afb8c93d036d35620fe38cb6b9e8fb117/src/interface/pomdp.cpp#L131]) but the example is missing the const qualifier --- doc/cpp_model_doc/Tutorial on Using DESPOT with cpp model.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/cpp_model_doc/Tutorial on Using DESPOT with cpp model.md b/doc/cpp_model_doc/Tutorial on Using DESPOT with cpp model.md index 65ae59fe..4708419a 100644 --- a/doc/cpp_model_doc/Tutorial on Using DESPOT with cpp model.md +++ b/doc/cpp_model_doc/Tutorial on Using DESPOT with cpp model.md @@ -512,7 +512,7 @@ After implementing the lower bound class the user needs to add it to the solver. class DSPOMDP { public: virtual ScenarioLowerBound* CreateScenarioLowerBound(string name = "DEFAULT", - string particle_bound_name = "DEFAULT") { + string particle_bound_name = "DEFAULT") const { if (name == "TRIVIAL" || name == "DEFAULT") { scenario_lower_bound_ = new TrivialParticleLowerBound(this); } else { @@ -528,7 +528,7 @@ The following code adds this lower bound to `SimpleRockSample` and sets it as th ``` c++ ScenarioLowerBound* SimpleRockSample::CreateScenarioLowerBound(string name = "DEFAULT", - string particle_bound_name = "DEFAULT") { + string particle_bound_name = "DEFAULT") const { if (name == "TRIVIAL") { scenario_lower_bound_ = new TrivialParticleLowerBound(this); } else if (name == "EAST" || name == "DEFAULT") { From d918a027853974abaddd1ec2c9e4ee25dc67d948 Mon Sep 17 00:00:00 2001 From: Constantinos Date: Wed, 17 Aug 2022 15:38:46 +0800 Subject: [PATCH 2/2] Update Tutorial on Using DESPOT with cpp model.md --- .../Tutorial on Using DESPOT with cpp model.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/cpp_model_doc/Tutorial on Using DESPOT with cpp model.md b/doc/cpp_model_doc/Tutorial on Using DESPOT with cpp model.md index 4708419a..29d0f10a 100644 --- a/doc/cpp_model_doc/Tutorial on Using DESPOT with cpp model.md +++ b/doc/cpp_model_doc/Tutorial on Using DESPOT with cpp model.md @@ -514,7 +514,7 @@ public: virtual ScenarioLowerBound* CreateScenarioLowerBound(string name = "DEFAULT", string particle_bound_name = "DEFAULT") const { if (name == "TRIVIAL" || name == "DEFAULT") { - scenario_lower_bound_ = new TrivialParticleLowerBound(this); + return new TrivialParticleLowerBound(this); } else { cerr << "Unsupported scenario lower bound: " << name << endl; exit(0); @@ -530,9 +530,9 @@ The following code adds this lower bound to `SimpleRockSample` and sets it as th ScenarioLowerBound* SimpleRockSample::CreateScenarioLowerBound(string name = "DEFAULT", string particle_bound_name = "DEFAULT") const { if (name == "TRIVIAL") { - scenario_lower_bound_ = new TrivialParticleLowerBound(this); + return new TrivialParticleLowerBound(this); } else if (name == "EAST" || name == "DEFAULT") { - scenario_lower_bound_ = new SimpleRockSampleEastPolicy(this, + return new SimpleRockSampleEastPolicy(this, new TrivialParticleLowerBound(this)); } else { cerr << "Unsupported lower bound algorithm: " << name << endl;