diff --git a/README.md b/README.md index 6bb0d55..b7d1e81 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ You can also take a look at the [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) @@ -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(); @@ -237,7 +237,7 @@ env.load().then(() => { -Custom the environement +Customize the environment ------------ !WARNING: The method presented in this section must be called BEFORE loading the environment. @@ -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(); ``` diff --git a/demo/README.md b/demo/README.md index 5c66328..4198c0d 100644 --- a/demo/README.md +++ b/demo/README.md @@ -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 diff --git a/demo/webapp/public/js/ddpg/ddpg_agent.js b/demo/webapp/public/js/ddpg/ddpg_agent.js index 95f922f..66fb50f 100644 --- a/demo/webapp/public/js/ddpg/ddpg_agent.js +++ b/demo/webapp/public/js/ddpg/ddpg_agent.js @@ -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 diff --git a/demo/webapp/public/js/index.js b/demo/webapp/public/js/index.js index cebaeb5..ebb9422 100644 --- a/demo/webapp/public/js/index.js +++ b/demo/webapp/public/js/index.js @@ -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(); \ No newline at end of file diff --git a/demo/webapp/public/js/policy_monte_carlo/index.js b/demo/webapp/public/js/policy_monte_carlo/index.js index b8b5632..7e0d334 100644 --- a/demo/webapp/public/js/policy_monte_carlo/index.js +++ b/demo/webapp/public/js/policy_monte_carlo/index.js @@ -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 diff --git a/demo/webapp/public/js/policy_monte_carlo/policy_agent.js b/demo/webapp/public/js/policy_monte_carlo/policy_agent.js index 5f2d2fd..767b50f 100644 --- a/demo/webapp/public/js/policy_monte_carlo/policy_agent.js +++ b/demo/webapp/public/js/policy_monte_carlo/policy_agent.js @@ -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; diff --git a/demo/webapp/public/js/q_table/index.js b/demo/webapp/public/js/q_table/index.js index 4e6f42b..47abbfa 100644 --- a/demo/webapp/public/js/q_table/index.js +++ b/demo/webapp/public/js/q_table/index.js @@ -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}); diff --git a/demo/webapp/qtable.html b/demo/webapp/qtable.html index 2b1a82b..20c540a 100644 --- a/demo/webapp/qtable.html +++ b/demo/webapp/qtable.html @@ -37,7 +37,7 @@

Current state (Lidar points)



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

- The algorithm is implemented here using the metacar environement. + The algorithm is implemented here using the metacar environment. You can see below the content of the Q-table once the model is loaded.

diff --git a/src/asset_manager.ts b/src/asset_manager.ts index e7fa6f6..beb6dac 100644 --- a/src/asset_manager.ts +++ b/src/asset_manager.ts @@ -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; @@ -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){ diff --git a/src/basic_motion_engine.ts b/src/basic_motion_engine.ts index ace5827..4ae3bbd 100644 --- a/src/basic_motion_engine.ts +++ b/src/basic_motion_engine.ts @@ -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; @@ -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) */ @@ -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 @@ -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 diff --git a/src/bot_motion_engine.ts b/src/bot_motion_engine.ts index 1dfc9af..c0c65d2 100644 --- a/src/bot_motion_engine.ts +++ b/src/bot_motion_engine.ts @@ -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 @@ -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}; diff --git a/src/car.ts b/src/car.ts index 5428fab..30c9e20 100644 --- a/src/car.ts +++ b/src/car.ts @@ -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) */ diff --git a/src/control_motion_engine.ts b/src/control_motion_engine.ts index 437269c..b3b3940 100644 --- a/src/control_motion_engine.ts +++ b/src/control_motion_engine.ts @@ -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 */ @@ -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; @@ -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 diff --git a/src/embedded.ts b/src/embedded.ts index a2ea369..a96f44c 100644 --- a/src/embedded.ts +++ b/src/embedded.ts @@ -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) diff --git a/src/level.ts b/src/level.ts index 67a3ffb..26fd8aa 100644 --- a/src/level.ts +++ b/src/level.ts @@ -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){ @@ -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); @@ -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; @@ -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) */ diff --git a/src/metacar.ts b/src/metacar.ts index 38480fe..e711697 100644 --- a/src/metacar.ts +++ b/src/metacar.ts @@ -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)://... @@ -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(); @@ -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; @@ -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){ @@ -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. @@ -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){ @@ -162,7 +162,7 @@ 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{ @@ -170,7 +170,7 @@ export class MetaCar { } /** - * 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) */ @@ -179,7 +179,7 @@ export class MetaCar { } /** - Step into the environement + Step into the environment @action Action to process to step @return Reward value */ @@ -188,7 +188,7 @@ export class MetaCar { } /** - * Reset the environement + * Reset the environment */ public reset(): void{ /* @@ -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{ diff --git a/src/metacar_editor.ts b/src/metacar_editor.ts index bae9037..b4b2cf0 100644 --- a/src/metacar_editor.ts +++ b/src/metacar_editor.ts @@ -28,7 +28,7 @@ export class MetaCarEditor { public load(): Promise{ /* - Load the environement + Load the environment @level (String) Name of the json level to load @agent (Agent class) */ @@ -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. diff --git a/src/motion_engine.ts b/src/motion_engine.ts index 8744618..0451bdf 100644 --- a/src/motion_engine.ts +++ b/src/motion_engine.ts @@ -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)