Git Product home page Git Product logo

vacuumcleanerworld's Introduction

WARNING

IT IS A DEMO PROJECT THAT HAS CRITICAL ISSUES IN FUNCTIONALITY AND HARDCODED VALUES

Vacuum Cleaner World on JS

main view

How to run

  1. Install npm on your OS.
  2. Install webpack -- npm install webpack
  3. Run next command to download required dependencies -- npm install
  4. Run webpack command in the project directory.
  5. Now you can open index.html in browser and start playing.

Short description

Vacuum cleaner know about map and trash location. You can run four different algorithms - Greedy Algorithm, Random Algorithm, Genetic Algorithm and Method of Branch and Bound, also you can control robot manually. When robot starts building trip it creates Adjacency matrix using A start algorithm to find shorter route between two points and two additional structures - dictionary where key is coordinates of two points and value is array of waypoints between them and array pointMapping that allows us to associate point id with point coordinates.

Greedy Algorithm

Just pick the nearest point on each iteration. The fastest algorithms among all.

Random Algorithm

Randomly choose direction and move on one to three steps. Stop when all rooms are clean.

Genetic Algorithm

The slowest algorithm among all. It finds better trip comparing with greedy and random but takes a lot of time.

Method of Branch and Bound

Build tree of possible paths with a depth of 5 levels. Take significant amount of time when we have more then 13 room with trash but faster than genetic algorithm and if depth equals number of trash find optimum trip.

Trash generator

You have two modes static trash generation when press generate trash button and when you press Run button trash are generated dynamically.

Comparing algorithm

If you want to compare two algorithm choose one, generate trash, build trip, then press Restart button and choose another algorithm and after the second completed building the trip and run through, one can compare amount of wasted energy.

vacuumcleanerworld's People

Contributors

kirill380 avatar kliubun avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.