Creating custom env for own project in gym can be tidious, well, at least was for me. Here are brief descriptions of steps I used and finally created working custom gym environment.
- Structure of project environment is one of the major issue:
![image] file:///home/bibek/Pictures/1.png
- Assuming we are creating customEnv as custom gym environment, and so in the setup.py:
![image] file:///home/bibek/Pictures/Screenshot%20from%202021-04-09%2014-57-11.png
- The 1st init.py, should be like:
![image] file:///home/bibek/Pictures/Screenshot%20from%202021-04-09%2014-59-40.png
- Then in the envs folder, the init.py should be like:
![image]file:///home/bibek/Pictures/Screenshot%20from%202021-04-09%2015-01-26.png
- Finally the customEnv.py file should have following structure:
![image] file:///home/bibek/Pictures/Screenshot%20from%202021-04-09%2015-04-29.png
- these 'render' and 'close' are optional.
- To complete the setup need to go back to the origin folder and run: pip3 install -e . and following should happen:
![image] file:///home/bibek/Pictures/Screenshot%20from%202021-04-09%2015-30-20.png
Yeah! we made it, aparently! Now you update the customEnv.py as per your project to work on.