From b91d969bf5a86a4c435f96cc6d6b27dd02009774 Mon Sep 17 00:00:00 2001 From: Piotr Spieker Date: Fri, 4 Oct 2024 11:35:15 +0200 Subject: [PATCH] Add changeDotClusterBehavior to pacmanAgent --- demo/include/demo/pacman_agent.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/demo/include/demo/pacman_agent.hpp b/demo/include/demo/pacman_agent.hpp index 3265be95..ebd3774c 100644 --- a/demo/include/demo/pacman_agent.hpp +++ b/demo/include/demo/pacman_agent.hpp @@ -3,6 +3,7 @@ #include #include "avoid_ghost_behavior.hpp" +#include "change_dot_cluster_behavior.hpp" #include "chase_ghost_behavior.hpp" #include "eat_closest_dot_behavior.hpp" #include "environment_model.hpp" @@ -34,6 +35,7 @@ class PacmanAgent { environmentModel_ = std::make_shared(game); avoidGhostBehavior_ = std::make_shared(environmentModel_, parameters_.avoidGhostBehavior); + changeDotClusterBehavior_ = std::make_shared(environmentModel_); chaseGhostBehavior_ = std::make_shared(environmentModel_, parameters_.chaseGhostBehavior); eatClosestDotBehavior_ = std::make_shared(environmentModel_); randomWalkBehavior_ = std::make_shared(parameters_.randomWalkBehavior); @@ -42,6 +44,7 @@ class PacmanAgent { rootArbitrator_ = std::make_shared(); rootArbitrator_->addOption(chaseGhostBehavior_, PriorityArbitrator::Option::Flags::INTERRUPTABLE); rootArbitrator_->addOption(avoidGhostBehavior_, PriorityArbitrator::Option::Flags::INTERRUPTABLE); + rootArbitrator_->addOption(changeDotClusterBehavior_, PriorityArbitrator::Option::Flags::INTERRUPTABLE); rootArbitrator_->addOption(eatClosestDotBehavior_, PriorityArbitrator::Option::Flags::INTERRUPTABLE); rootArbitrator_->addOption(randomWalkBehavior_, PriorityArbitrator::Option::Flags::INTERRUPTABLE); rootArbitrator_->addOption(stayInPlaceBehavior_, PriorityArbitrator::Option::Flags::INTERRUPTABLE); @@ -69,6 +72,7 @@ class PacmanAgent { Parameters parameters_; AvoidGhostBehavior::Ptr avoidGhostBehavior_; + ChangeDotClusterBehavior::Ptr changeDotClusterBehavior_; ChaseGhostBehavior::Ptr chaseGhostBehavior_; EatClosestDotBehavior::Ptr eatClosestDotBehavior_; RandomWalkBehavior::Ptr randomWalkBehavior_;