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..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 @@ -512,9 +512,9 @@ 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); + return new TrivialParticleLowerBound(this); } else { cerr << "Unsupported scenario lower bound: " << name << endl; exit(0); @@ -528,11 +528,11 @@ 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); + 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;