# Getting started with ReinforcementLearning.jl

**URL:** <https://discourse.julialang.org/t/getting-started-with-reinforcementlearning-jl/87011>\
**Category:** Machine Learning\
**Tags:** question\
**Created:** [September 9, 2022, 6:46pm UTC](https://discourse.julialang.org/t/getting-started-with-reinforcementlearning-jl/87011 "2022-09-09T18:46:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bwanab](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bwanab/32/35903_2.png) [@bwanab](https://discourse.julialang.org/u/bwanab)\
**Post date:** [September 9, 2022, 6:46pm UTC](https://discourse.julialang.org/t/getting-started-with-reinforcementlearning-jl/87011/1 "2022-09-09T18:46:22Z")

</div>

In ReinforcementLearningAnIntroduction/notebooks/Chapter01\_Tic\_Tac\_Toe.jl in the Testing section there is the comment “I leave it as an exercise to change the select\_action to a greedy version and confirm that our trained policy reaches a tie everytime.” I’m sorry to admit that I’ve failed in this seemingly simple exercise. From what I understand, once the MultiAgentPolicy is trained, I would need to create a new version of select\_action (let’s call it test\_select\_action) that uses a GreedyExplorer instead of EpsilonGreedyExplorer. That’s easy enough, but when I try to reassign the mapping to the new function, it fails because it can’t convert an object of type select\_action to a type of test\_select\_action. So, obviously I’m doing it wrong, but I don’t see how to do it.

For context, I’ve built an environment to play Reversi (AKA Othello). To test the game, after training, I play it going first. According to wikipedia (and in my experience) for a 4 or 6 sided board, the player going 2nd should always win if playing well. In my tests, after a training run of 200\_000 episodes, if the board is 4 sided my environment always wins going 2nd, but for a 6 sided board, it usually doesn’t. Since I’m currently still using the policy with the EpsilonGreedyExplorer, it could be that that is the problem or it could be that it just needs more training, but until I can figure out how to substitute the GreedyExplorer, I can’t make that determination.

---

<div class="post-metadata">

**Author:** ![albheim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albheim/32/34660_2.png) [@albheim](https://discourse.julialang.org/u/albheim)\
**Post date:** [September 10, 2022, 7:54am UTC](https://discourse.julialang.org/t/getting-started-with-reinforcementlearning-jl/87011/2 "2022-09-10T07:54:09Z")

</div>

You could maybe just change the epsilon in the explorer to zero, though maybe not a proper way of doing it.

Otherwise you could just recreate the structure for testing (I assume the same structure as was presented in Chapter1) with something like this, haven’t tested so might need some change

```julia
test_policies = MultiAgentManager(
	(
		NamedPolicy(
			p.name => VBasedPolicy(;
				learner=p.policy.learner,
				mapping = test_select_action
			)
		)
		for (x, p) in policies.agents
	)...
)

```
