# How to review your own enviroment in reinforce.jl

**URL:** https://discourse.julialang.org/t/how-to-review-your-own-enviroment-in-reinforce-jl/80807
**Category:** Modelling & Simulations
**Created:** [May 10, 2022, 12:22pm UTC](https://discourse.julialang.org/t/how-to-review-your-own-enviroment-in-reinforce-jl/80807 "2022-05-10T12:22:17Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Hupdup](https://avatars.discourse-cdn.com/v4/letter/h/7ba0ec/32.png) [@Hupdup](https://discourse.julialang.org/u/Hupdup)
#### Post date: [May 10, 2022, 12:22pm UTC](https://discourse.julialang.org/t/how-to-review-your-own-enviroment-in-reinforce-jl/80807/1 "2022-05-10T12:22:17Z")

</div>

Hello all,

I have written a custom enviroment in reinforce.jl and now I want to check if it is correct (i.e. if the actions and the step function work as thought).  
For this I wanted to call the functions one by one in the Julia REPL and execute them one after the other.  
But then it always looks like in the uploaded example (here with the default CartPole environment, which is included in the package).

Does someone know how tho see what the actual values would be or how I can check my environment properly?

Thanks in advance!

Best,  
Joschka

 ![Code in Repl](https://global.discourse-cdn.com/julialang/original/3X/9/f/9f58247d5466f08d3a1ffb18f65a1bd3b4becebd.jpeg)

---

<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: [May 11, 2022, 5:19am UTC](https://discourse.julialang.org/t/how-to-review-your-own-enviroment-in-reinforce-jl/80807/2 "2022-05-11T05:19:18Z")

</div>

If i remember correctly step expects an environment, a state and an action. So instantiate your environment to begin with, and get the state from it as well as creating a valid action. Then you should be able to call step with that.

---

<div class="post-metadata">

### Author: ![Hupdup](https://avatars.discourse-cdn.com/v4/letter/h/7ba0ec/32.png) [@Hupdup](https://discourse.julialang.org/u/Hupdup)
#### Post date: [May 11, 2022, 12:42pm UTC](https://discourse.julialang.org/t/how-to-review-your-own-enviroment-in-reinforce-jl/80807/3 "2022-05-11T12:42:10Z")

</div>

Hi Albin,  
thanks for your answer and your tip! unfortunately i still couldn’t get this to work (which is probably more because i’m new to julia and don’t have the greatest programming experience).  
would you be interested in helping me with my project in the form of online tutoring for 1-2 hours (for example via zoom)?  
I would be very grateful!

My goal is to control the heat pump in a smart home with a simple DQN algorithm.  
I have already designed my environment, including step function and actions as well as I can, so the whole thing just needs to be made to work.

Thanks in advance!

Have a great day,  
Joschka

If some one else is willing to give me online tutoring, you are also very welcome!

---

<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: [May 11, 2022, 2:12pm UTC](https://discourse.julialang.org/t/how-to-review-your-own-enviroment-in-reinforce-jl/80807/4 "2022-05-11T14:12:10Z")

</div>

If you have your environment set up correctly my interpretation is that you should do something

```julia
env = MyEnv()
policy = RandomPolicy() # Or whichever policy you want
s = state(env)
r = reward(env)
a = action(policy, r, s, actions(env, s))
new_r, new_s = step!(env, s, a)

```

> [@Hupdup](#):
>
> would you be interested in helping me with my project in the form of online tutoring for 1-2 hours (for example via zoom)?

I don’t really feel I have time for taking on that at the moment, but I’m sure you will figure it out. If you have questions you can always ask here and I will peek in every now and then.

---

<div class="post-metadata">

### Author: ![Hupdup](https://avatars.discourse-cdn.com/v4/letter/h/7ba0ec/32.png) [@Hupdup](https://discourse.julialang.org/u/Hupdup)
#### Post date: [May 11, 2022, 3:32pm UTC](https://discourse.julialang.org/t/how-to-review-your-own-enviroment-in-reinforce-jl/80807/5 "2022-05-11T15:32:28Z")

</div>

Thank you very much!!! I never did the env = MyEnv() line.  
And thanks for the offer, if there are any upcoming questions, I will ask them here!

Have a great day!
