diff --git a/README.md b/README.md index 56f0869..d22bbc4 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ You can use Metacar with a direct link in your HTML file or install it from NPM. - + ``` @@ -168,7 +168,16 @@ env.load().then(() => { During the training, the environment is not rendering on the screen anymore. Once your training is finish you have to notify the environment by calling env.render(true) to render the environment again.
-The state of the environment is the value of each lidar point. +The state of the environment is made of four fields: + +``` +{ + a: number|undefined // Acceleration of the car (if any) + lidar: number[][] // Lidar points values + linear: number[] // The flatten lidar values + the current speed of the car + steering: number|undefined // Steering angle of the car (if any) +} +``` Here is an example of simple training loop. @@ -189,7 +198,7 @@ env.load().then(() => { }); ``` -### Reset env +### Reset and shuffle env To reset the environment, you can either call @@ -209,6 +218,24 @@ env.load().then(() => { }); ``` +You can also shuffle the position of vehicles (agent and other cars) on the map. + + +```javascript +env.load().then(() => { + + env.addEvent("Shuffle only the agent", () => { + env.shuffle({cars: false}); + }); + + env.addEvent("Shuffle all", () => { + env.shuffle(); + }); + +}); +``` + + Custom the environement ------------