Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some typos #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ You can also take a look at the <b>[online demo](https://www.metacar-project.com
1. [Getting Started](#getting-started)
2. [Your first environment](#first-env)
3. [Interact with the environment](#interact-env)
4. [Custom the environment](#configure-env)
4. [Customize the environment](#configure-env)
5. [Edit your own level](#create-level)

<a id='getting-started'></a>
Expand Down Expand Up @@ -82,7 +82,7 @@ Even if you can [create your own level](#create-level), Metacar comes up with a
```javascript
// Select a level
const level = metacar.level.level1;
// Create the environement
// Create the environment
const env = new metacar.env("env", level);
// Load it
env.load();
Expand Down Expand Up @@ -237,7 +237,7 @@ env.load().then(() => {


<a id='configure-env'></a>
Custom the environement
Customize the environment
------------

<b>!WARNING:</b> The method presented in this section must be called <b>BEFORE</b> loading the environment.
Expand Down Expand Up @@ -285,7 +285,7 @@ You can choose to move or stop the other vehicles with env.carsMoving()

```javascript
env.carsMoving(false);
// Load the environement after changing the propeties.
// Load the environment after changing the propeties.
env.load();
```

Expand Down
2 changes: 1 addition & 1 deletion demo/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Metacar: Demo

This is the demo website of the metacar project. You can use it as an example to learn how to used the environement.
This is the demo website of the metacar project. You can use it as an example to learn how to use the environment.

## Install

Expand Down
2 changes: 1 addition & 1 deletion demo/webapp/public/js/ddpg/ddpg_agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class DDPGAgent {
}

/**
* Step into the training environement
* Step into the training environment
* @param tfPreviousStep (tf.tensor2d) Current state
* @param mPreviousStep number[]
* @return {done, state} One boolean and the new state
Expand Down
2 changes: 1 addition & 1 deletion demo/webapp/public/js/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Get the url of the desired level
let levelUrl = metacar.level.fullCity;
// Create the environement (canvasID, levelUrl)
// Create the environment (canvasID, levelUrl)
var env = new metacar.env("canvas", levelUrl);
env.load();
2 changes: 1 addition & 1 deletion demo/webapp/public/js/policy_monte_carlo/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Get the url of the desired level
let levelUrl = metacar.level.level1;
// Create the environement (canvasID, levelUrl)
// Create the environment (canvasID, levelUrl)
var env = new metacar.env("canvas", levelUrl);

// Create the Policy agent
Expand Down
2 changes: 1 addition & 1 deletion demo/webapp/public/js/policy_monte_carlo/policy_agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ class PolicyAgent {
}
softmax.dispose();
st.dispose();
// Step in the environement with this action
// Step in the environment with this action
reward = this.env.step(action);
if (reward == -1){
reward = -10;
Expand Down
2 changes: 1 addition & 1 deletion demo/webapp/public/js/q_table/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Get the url of the desired level
let levelUrl = metacar.level.level0;
// Create the environement (canvasID, levelUrl)
// Create the environment (canvasID, levelUrl)
var env = new metacar.env("canvas", levelUrl);

env.setAgentMotion(metacar.motion.BasicMotion, {rotationStep: 0.25});
Expand Down
2 changes: 1 addition & 1 deletion demo/webapp/qtable.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ <h3>Current state (Lidar points)</h3><br><br>

The left window gives you an overview of what the autonomous vehicle (in red) sees.<br><br>

The algorithm is implemented <a a href="https://github.com/thibo73800/metacar/blob/master/demo/webapp/public/js/q_table_agent.js">here</a> using <a href="https://github.com/thibo73800/metacar">the metacar environement.</a>
The algorithm is implemented <a a href="https://github.com/thibo73800/metacar/blob/master/demo/webapp/public/js/q_table_agent.js">here</a> using <a href="https://github.com/thibo73800/metacar">the metacar environment.</a>

You can see below the content of the Q-table once the model is loaded.
</p>
Expand Down
4 changes: 2 additions & 2 deletions src/asset_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class AssetManger {
*
* options Options to change the lidar options of the agent.
* Changing the lidar change the state representation of the car in the
* environement.
* environment.
*/
public setAgentLidar(options: LidarInfoI){
this.agentLidarInfo = options;
Expand All @@ -77,7 +77,7 @@ export class AssetManger {
/**
* Change the motion engine of the agent. BasicMotionEngine by default.
* This method should be called before to called 'load'.
* @motion The motion engine to used for the agent when the environement is loaded.
* @motion The motion engine to used for the agent when the environment is loaded.
* @options Options to change the behavior of the motion engine.
*/
public setAgentMotion(motion: any, options: Object){
Expand Down
8 changes: 4 additions & 4 deletions src/basic_motion_engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface BasicMotionOptions{
export class BasicMotionEngine extends MotionEngine {
/*
Basic Motion Engine
In this configuration the possible action of the environement are
In this configuration the possible action of the environment are
either left, right, up, down or wait.
*/
private rotationStep: number;
Expand Down Expand Up @@ -118,7 +118,7 @@ export class BasicMotionEngine extends MotionEngine {

actionStep(delta: number, action: number){
/*
Step into the environement with one action
Step into the environment with one action
@delta (Float) time since the last update
@action: (Integer) The action to take (can be null if no action)
*/
Expand All @@ -145,7 +145,7 @@ export class BasicMotionEngine extends MotionEngine {

step(delta: number){
/*
Step into the environement
Step into the environment
@delta (Float) time since the last update
*/
// Update the x and y position according to the velocity
Expand Down Expand Up @@ -183,7 +183,7 @@ export class BasicMotionEngine extends MotionEngine {
//this.car.mybound.x = this.car.x + x_m;
//this.car.mybound.y = this.car.y + y_m;

// Detection the new collision with the environement
// Detection the new collision with the environment
let {agentCollisions, onRoad} = this.detectInteractions(true, true);

if (agentCollisions.length > 0){ // Stop the vehicle if a collision is detected
Expand Down
4 changes: 2 additions & 2 deletions src/bot_motion_engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export class BotMotionEngine extends MotionEngine {

step(delta: number){
/*
Step into the environement
Step into the environment
@delta (Float) time since the last update
*/
// Possible collision detected
Expand Down Expand Up @@ -269,7 +269,7 @@ export class BotMotionEngine extends MotionEngine {
this.lidar.y = this.car.y;
this.lidar.rotation = this.car.rotation;

// Detection the new collision with the environement
// Detection the new collision with the environment
let {agentCollisions, onRoad} = this.detectInteractions(false);

return {agentCollisions, onRoad};
Expand Down
2 changes: 1 addition & 1 deletion src/car.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export class Car {

step(delta: number, action:number|number[]=null){
/*
Take one step into the environement
Take one step into the environment
@delta (Float) time since the last update
@action: (Integer) The action to take (can be null if no action)
*/
Expand Down
6 changes: 3 additions & 3 deletions src/control_motion_engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export class ControlMotionEngine extends MotionEngine {

actionStep(delta: number, actions: number[]){
/*
Step into the environement with one action
Step into the environment with one action
@delta (Float) time since the last update
@action: (Array of Float) The throttle and the steering angle
*/
Expand All @@ -131,7 +131,7 @@ export class ControlMotionEngine extends MotionEngine {

step(delta: number){
/*
Step into the environement
Step into the environment
@delta (Float) time since the last update
*/
this.car.last_a = this.car.a;
Expand Down Expand Up @@ -178,7 +178,7 @@ export class ControlMotionEngine extends MotionEngine {
this.lidar.y = this.car.y;
this.lidar.rotation = this.car.rotation;

// Detection the new collision with the environement
// Detection the new collision with the environment
let {agentCollisions, onRoad} = this.detectInteractions(true, true);

if (agentCollisions.length > 0){ // Stop the vehicle if a collision is detected
Expand Down
2 changes: 1 addition & 1 deletion src/embedded.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {level3} from "./embedded/level/level_3";
* Object used to enumerate each
* level embedded into the library.
*
* @fullCity: A level to show the current capabilities of the environement.
* @fullCity: A level to show the current capabilities of the environment.
* @level0: A simple level with no other cars and a simple control (top, down, left, right)
* @level1: A level with one agent, two cars, and simple control (top, down, left, right).
* @level2: Level with no other cars. The control is handle by two continous values (throttle and steering angle)
Expand Down
8 changes: 4 additions & 4 deletions src/level.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class Level extends World {
/**
* Change the motion engine of the agent. BasicMotionEngine by default.
* This method should be called before to called 'load'.
* @motion The motion engine to used for the agent when the environement is loaded.
* @motion The motion engine to used for the agent when the environment is loaded.
* @options Options to change the behavior of the motion engine.
*/
public setAgentMotion(motion: typeof BasicMotionEngine|typeof ControlMotionEngine, options: BasicMotionOptions){
Expand All @@ -75,7 +75,7 @@ export class Level extends World {
*
* options Options to change the lidar options of the agent.
* Changing the lidar change the state representation of the car in the
* environement.
* environment.
*/
public setAgentLidar(options: LidarInfoI){
this.am.setAgentLidar(options);
Expand Down Expand Up @@ -127,7 +127,7 @@ export class Level extends World {
}

/**
* Return the last reward given by the environement
* Return the last reward given by the environment
*/
public getLastReward(): number{
return this.lastReward;
Expand All @@ -136,7 +136,7 @@ export class Level extends World {

step(delta: number, action:number|number[]=null, auto: boolean = true){
/*
Process one step into the environement
Process one step into the environment
@delta (Float) time since the last update
@action: (Integer) The action to take (can be null if no action)
*/
Expand Down
24 changes: 12 additions & 12 deletions src/metacar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class MetaCar {
private loopCallback: any = undefined;

/**
* Class used to create a new environement.
* Class used to create a new environment.
* @canvasId: HTML canvas ID
* @levelToLoad: URL of the level or directly the level's object.
* URL format: embedded://... or http(s)://...
Expand Down Expand Up @@ -77,7 +77,7 @@ export class MetaCar {
}

/**
* Return the last reward given by the environement
* Return the last reward given by the environment
*/
public getLastReward(): number{
return this.level.getLastReward();
Expand All @@ -87,7 +87,7 @@ export class MetaCar {
* options Options to change the lidar options of the agent.
* This method should be called before to called 'load'.
* Changing the lidar change the state representation of the car in the
* environement.
* environment.
*/
public setAgentLidar(options: LidarInfoI){
this.agentLidarInfo = options;
Expand All @@ -96,7 +96,7 @@ export class MetaCar {
/**
* Change the motion engine of the agent. BasicMotionEngine by default.
* This method should be called before to called 'load'.
* @motion The motion engine to used for the agent when the environement is loaded.
* @motion The motion engine to used for the agent when the environment is loaded.
* @options Options to change the behavior of the motion engine.
*/
public setAgentMotion(motion: typeof BasicMotionEngine|typeof ControlMotionEngine, options: BasicMotionOptions){
Expand All @@ -107,12 +107,12 @@ export class MetaCar {
/**
* This method is used to add a button under the canvas. When a
* click is detected on the window, the associated @fc is called.
* Some events are recognized by the environement, others can be custom.
* Some events are recognized by the environment, others can be custom.
* The following are recognized:
* - train: The render is stopped before to called @fc. You must called render(true) once your training is done.
* - play: Your function (@fc) will be called at each frame update.
* - stop: The last function passed to the play event will not be called anymore. Then @fc is called.
* - reset_env: Reset the environement. Then, @fc is called.
* - reset_env: Reset the environment. Then, @fc is called.
* - load: Load: @fc is called. You can set @options to {local:true} to load the content of a file from your computer.
* If @options is set, a content variable will be passed to the @fc function (the content of the selected file).
* @eventName Name of the event to listen.
Expand All @@ -134,7 +134,7 @@ export class MetaCar {
}

/**
* Choose whether to render the environement.
* Choose whether to render the environment.
* @val: True or False.
*/
public render(val: boolean){
Expand Down Expand Up @@ -162,15 +162,15 @@ export class MetaCar {
}

/**
* Get the action space of the environement
* Get the action space of the environment
* @return The Description of the action space.
*/
public actionSpace(): actionSpaceDescription{
return this.level.agent.motion.actionSpace();
}

/**
* Return the current state of the environement.
* Return the current state of the environment.
* The size of the state depends of the size of the Lidar.
* @return The state as a 2D Array or 1D Array (linear:true)
*/
Expand All @@ -179,7 +179,7 @@ export class MetaCar {
}

/**
Step into the environement
Step into the environment
@action Action to process to step
@return Reward value
*/
Expand All @@ -188,7 +188,7 @@ export class MetaCar {
}

/**
* Reset the environement
* Reset the environment
*/
public reset(): void{
/*
Expand Down Expand Up @@ -267,7 +267,7 @@ export class MetaCar {
}

/*
Load the environement with the parameters passed in the constructor.
Load the environment with the parameters passed in the constructor.
*/
public load(): Promise<void>{

Expand Down
4 changes: 2 additions & 2 deletions src/metacar_editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class MetaCarEditor {

public load(): Promise<void>{
/*
Load the environement
Load the environment
@level (String) Name of the json level to load
@agent (Agent class)
*/
Expand Down Expand Up @@ -75,7 +75,7 @@ export class MetaCarEditor {
/**
* This method is used to add button under the canvas. When a
* click is detected on the window, the associated @fc is called.
* Some events are recognized by the environement, others can be custom.
* Some events are recognized by the environment, others can be custom.
* @eventName Name of the event to listen.
* @fc Function to call each time this event is raised.
* @options: eventEditorLoadOptions {download: true|false}. Use to download the file as a json for the "save" event.
Expand Down
2 changes: 1 addition & 1 deletion src/motion_engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class MotionEngine {
/*
If all is false then we assume the car is alwais on a road
and never collision with other car (this behavior is used for bot cars only)
Detect the interaction with the environement
Detect the interaction with the environment
- Car collisions
- Lidar collisions
- Road position (Is the vehicle on the road)
Expand Down