Git Product home page Git Product logo

exploring-mars's Introduction

Exploring Mars Challenge

Decisions taken

Since probes are valuable resources, any action that could damage or put a probe in an unknown state is considered forbidden. The covered cases are:

  • Collisions
    1. Creating a new probe in a position already occupied by another probe;
    2. Taking a MOVE action to a position already occupied by another probe.
  • "Falling" from the map
    1. Creating a new probe in a position out of the map bounds;
    2. Taking a MOVE action to a position out of the map bounds;
    3. Updating the map to a size that can't contain one or more existing probes in their current positions.

Extra

The version at the main branch depends heavily on database constraints to deal with concurrent calls and performs poorly when a probe is updated with thousands of MOVE instructions (because every MOVE instruction generates an update command on the probes table). To address that problem, I have developed a caching mechanism for accessing maps on operations that can change the map state. With that, many threads can hold a reference to the same instance of a map and make synchronized MOVE operations in memory. I decided to commit this solution to a different branch (feature/map-cache) because, even tough the performance got much better, the code of the service layer became less clear in this version.

API documentation

An interactive documentation is automatically generated with Swagger UI once the application is running.

Compilation and testing

./mvnw package

Running on Docker

docker build -t exploring-mars . 
docker run -dp 3000:3000 exploring-mars

exploring-mars's People

Contributors

vitorsamora avatar

Watchers

 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.