Skip to content

Commit

Permalink
Add changeDotClusterBehavior to pacmanAgent
Browse files Browse the repository at this point in the history
  • Loading branch information
orzechow committed Oct 4, 2024
1 parent f199a48 commit b91d969
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions demo/include/demo/pacman_agent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <arbitration_graphs/priority_arbitrator.hpp>

#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"
Expand Down Expand Up @@ -34,6 +35,7 @@ class PacmanAgent {
environmentModel_ = std::make_shared<EnvironmentModel>(game);

avoidGhostBehavior_ = std::make_shared<AvoidGhostBehavior>(environmentModel_, parameters_.avoidGhostBehavior);
changeDotClusterBehavior_ = std::make_shared<ChangeDotClusterBehavior>(environmentModel_);
chaseGhostBehavior_ = std::make_shared<ChaseGhostBehavior>(environmentModel_, parameters_.chaseGhostBehavior);
eatClosestDotBehavior_ = std::make_shared<EatClosestDotBehavior>(environmentModel_);
randomWalkBehavior_ = std::make_shared<RandomWalkBehavior>(parameters_.randomWalkBehavior);
Expand All @@ -42,6 +44,7 @@ class PacmanAgent {
rootArbitrator_ = std::make_shared<PriorityArbitrator>();
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);
Expand Down Expand Up @@ -69,6 +72,7 @@ class PacmanAgent {
Parameters parameters_;

AvoidGhostBehavior::Ptr avoidGhostBehavior_;
ChangeDotClusterBehavior::Ptr changeDotClusterBehavior_;
ChaseGhostBehavior::Ptr chaseGhostBehavior_;
EatClosestDotBehavior::Ptr eatClosestDotBehavior_;
RandomWalkBehavior::Ptr randomWalkBehavior_;
Expand Down

0 comments on commit b91d969

Please sign in to comment.