From 29603cbd7bc65ec49bb3169c2e543591a85b316f Mon Sep 17 00:00:00 2001 From: Piotr Spieker Date: Tue, 26 Nov 2024 18:51:14 +0100 Subject: [PATCH] Fix task code snippets based on code review Co-authored-by: ll-nick <68419636+ll-nick@users.noreply.github.com> --- docs/tasks/5_cost_arbitration.md | 2 +- docs/tasks/6_verification.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tasks/5_cost_arbitration.md b/docs/tasks/5_cost_arbitration.md index 610c5708..4941652f 100644 --- a/docs/tasks/5_cost_arbitration.md +++ b/docs/tasks/5_cost_arbitration.md @@ -45,7 +45,7 @@ Finish the implementation of the `CostEstimator` and replace the random arbitrat Finish the implementation of the `CostEstimator` class in `cost_estimator.cpp`: ```cpp double CostEstimator::estimateCost(const Command& command, bool /*isActive*/) { - Positions absolutePath = utils::toAbsolutePath(command.path, environmentModel_); + Positions absolutePath = environmentModel_->toAbsolutePath(command.path); // Compute the number of dots along the path and in the neighborhood of the path end using helper functions const int nDotsAlongPath = utils::dotsAlongPath(absolutePath, environmentModel_); diff --git a/docs/tasks/6_verification.md b/docs/tasks/6_verification.md index 805c856b..f0b5ba6d 100644 --- a/docs/tasks/6_verification.md +++ b/docs/tasks/6_verification.md @@ -107,7 +107,7 @@ Make sure to also pass the verifier to the arbitrator constructors: explicit PacmanAgent(const entt::Game& game) : parameters_{}, environmentModel_{std::make_shared(game)}, - verifier_{environmentModel_} // We can initialize the verifier in the member initializer list { + verifier_{environmentModel_} { // We can initialize the verifier in the member initializer list avoidGhostBehavior_ = std::make_shared(environmentModel_, parameters_.avoidGhostBehavior); changeDotClusterBehavior_ = std::make_shared(environmentModel_);