Skip to content

Commit

Permalink
Improve tasks based on review suggestions
Browse files Browse the repository at this point in the history
Co-authored-by: ll-nick <[email protected]>
  • Loading branch information
orzechow and ll-nick authored Nov 26, 2024
1 parent e8b1f68 commit 0bf58d0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/tasks/1_implement_behavior_component.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ That's great and all but if we ate a power pellet, we want to take advantage and
To do this, we need to implement the `ChaseGhost` behavior component.
It essentially does the exact opposite of the `AvoidGhost` behavior component
but is only applicable when Pac-Man ate a power pellet.
We can ensure that's always the case using the behavior's invocation condition.
We can ensure that this is always the case by using the behavior's invocation condition.

But wait - the current implementation of the invocation condition is not complete.
It should only be applicable if there is one of these tasty ghosts close by.
Expand All @@ -34,7 +34,7 @@ Finish the implementation of the `checkInvocationCondition()` and `getCommand()`
## Instructions

- Build and run the game, take a look at the arbitration graph and observe how Pac-Man behaves.
- Run the unit tests and note that the `ChaseGhost` `scheckInvocationConditionFalse` test is failing
- Run the unit tests and note that the `ChaseGhost`'s `checkInvocationConditionFalse` test is failing
- Open the implementation of the `ChaseGhost` behavior component in `src/chase_ghost_behavior.cpp`.
- The `checkInvocationCondition()` function is already implemented but does not check for the presence of a ghost.
- Implement the missing piece. Take a look at the implementation of `AvoidGhostBehavior::checkInvocationCondition()` if you need inspiration.
Expand Down
2 changes: 1 addition & 1 deletion docs/tasks/4_nested_arbitrators.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Integrate a long-term behavior and add another layer to the arbitration graph.

## Context

We have now implemented a few behavior components and integrated them into the arbitration graph.
We have now implemented a behavior component and integrated it into the arbitration graph.
So far, all behavior components are children of the root arbitrator.

Let's make things a bit more interesting by adding a long-term behavior component that's also about eating dots.
Expand Down
6 changes: 6 additions & 0 deletions docs/tasks/5_cost_arbitration.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ Also, include `cost_estimator.hpp`:
#include "cost_estimator.hpp"
```

To keep things tidy and consistent, add an alias definition analogous to the existing ones:

```cpp
using CostArbitrator = arbitration_graphs::CostArbitrator<Command, Command>;
```

Change the type of the `eatDotsArbitrator_` member in the `PacmanAgent` class to `CostArbitrator` and add an instance of the `CostEstimator`:
```cpp
private:
Expand Down
3 changes: 2 additions & 1 deletion docs/tasks/6_verification.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ Add the `MoveRandomly` behavior component as a last resort fallback layer.

## Instructions

- In `verifier.cpp`, finish the implementation of the `Verifier::analyze()` method.
- In `verifier.hpp`, finish the implementation of the `Verifier::analyze()` method.
- Compile and run the unit tests for the `Verifier` to verify that your implementation is correct.
- Add an instance of the `Verifier` to the `PacmanAgent` class and initialize it in the constructor.
- Pass the `Verifier` instance to the constructors of the arbitrators.
(Hint: You'll need to adjust the template parameters of the arbitrators.)
Expand Down

0 comments on commit 0bf58d0

Please sign in to comment.