How to review your own enviroment in reinforce.jl

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

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.

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!

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

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)

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.

1 Like

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!