You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+78-1
Original file line number
Diff line number
Diff line change
@@ -75,7 +75,84 @@ Complete API documentation can be found here: [Gymie-Client API](https://jscript
75
75
In the [previous section](#how-to-run-the-client-and-server) we already saw how to import gymie, connect to the server, instantiate an environment and call a few API methods. Let's go a bit more in detail with a complete example of a random agent interacting with an environment:
76
76
77
77
```ts
78
-
// TODO
78
+
importGymiefrom'../dist'
79
+
import { Continuous, Discrete } from'../dist/Env'
80
+
import {
81
+
ConnectFailed,
82
+
NoConnected,
83
+
ConnectionError,
84
+
ConnectionClosed
85
+
} from'../dist/errors'
86
+
87
+
const wsApi ='http://0.0.0.0:5000/gym'
88
+
const envId ='LunarLander-v2'
89
+
const { log } =console
90
+
91
+
;(async () => {
92
+
const gymie =newGymie()
93
+
94
+
try {
95
+
// Connect to the server
96
+
awaitgymie.connect(wsApi)
97
+
98
+
// Instantiates the environment, in this case it's got
0 commit comments