The AEA gym skill demonstrates how a custom Reinforcement Learning agent, that uses OpenAI's gym library, may be embedded into an AEA skill and connection.
Create the agent
In the root directory, create the gym agent and enter the project.
aea create my_gym_agent cd my_gym_agent
Add the gym skill
aea add skill fetchai/gym:0.1.0
Copy the gym environment to the agent directory
mkdir gyms cp -a ../examples/gym_ex/gyms/. gyms/
Add a gym connection
aea add connection fetchai/gym:0.1.0
Update the connection config
aea config set connections.gym.config.env 'gyms.env.BanditNArmedRandom'
Install the skill dependencies
To install the
gym package, a dependency of the gym skill, from Pypi run
Run the agent with the gym connection
aea run --connections gym
You will see the gym training logs.
Delete the agent
When you're done, you can go up a level and delete the agent.
cd .. aea delete my_gym_agent
This diagram shows the communication between the agent and the gym environment