const client = new Client('CartPole-v0');
await client.init();
await client.MonitorStart();
await client.Reset();
for (let i = 0; i < 1000; i++) {
actionSpaceSample = await client.ActionSpaceSample();
const resStep = await client.Step(actionSpaceSample.action);
}
await client.MonitorStop();
Currently a Node.js Cartpole agent that is utilizing Q-Learning has been implemented at src/SDKs/nodejs/examples/OpenAI-CartPole
. To run this, do the following:
- Install the OpenAI Gym (see
Simulators - OpenAI
) - Install Node.js
- Run
python server.py
undersrc/SimulatorIntegrations/OpenAI-Gym
- Run
node index.js
undersrc/SDKs/nodejs/examples/OpenAI-CartPole