Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
thibo73800 authored Jun 27, 2018
1 parent 678ed4f commit ef0aa16
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ You can use Metacar with a direct link in your HTML file or install it from NPM.
<script src="https://cdnjs.cloudflare.com/ajax/libs/pixi.js/4.7.1/pixi.min.js"></script>
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/[email protected].5/dist/metacar.min.js"></script>
<script src="https://cdn.jsdelivr.net/combine/npm/[email protected].1,npm/metacar@0.1.0"></script>
</body>
</html>
```
Expand Down Expand Up @@ -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. <br>

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.

Expand All @@ -189,7 +198,7 @@ env.load().then(() => {
});
```

### Reset env
### Reset and shuffle env

To reset the environment, you can either call

Expand All @@ -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();
});

});
```


<a id='configure-env'></a>
Custom the environement
------------
Expand Down

0 comments on commit ef0aa16

Please sign in to comment.