Code Monkey home page Code Monkey logo

Predictive Movement

Build Status

This is the source code for the collaborative open source project Predictive Movement.

About

Predictive Movement aims to create a digital platform that will act as a collaborative hub for the transports of people and goods with the help of artificial intelligence (AI). In its first phase, the project will solve the societal challenge of parcel deliveries in rural areas. Further on, the project aims to deal with optimizing availability and accessibility in areas ranging from urban to rural.

Predictive Movement is a project financed by, among others, Sweden’s Innovation Agency (Vinnova) and the Swedish Transport Administration. The project includes one Swedish region, four municipalities, a university, authorities as well as key actors within digitization and traffic/logistics. An important driving force behind the project is to combat climate change and to reduce emissions caused by road transports.

Navigating the code

The source code for the project is contained in this mono-repo. Within the packages folder you will find all included packages. Here is a summary of the components:

Running the project

Before you start running the project, start by exporting port 9200

kubectl port-forward elasticsearch-0 9200:9200 --namespace pelias

Running Predictive Movement locally

You will need the following API keys, they are stored in LastPass.

  • POSTNORD_KEY - for engine-server
  • REACT_APP_MAPBOX_ACCESS_TOKEN - for engine-ui
  • GOOGLE_API_TOKEN - for driver-interface
  • TELEGRAM_BOT_TOKEN - for driver-interface

Set environment variables

create .env-file at packages/driver-interface/.env with

GOOGLE_API_TOKEN=<API KEY>
BOT_TOKEN=<API KEY> / or create your own bot in telegram

create .env-file at packages/engine-ui/.env with

REACT_APP_MAPBOX_ACCESS_TOKEN=<API KEY>

create .env-file at packages/engine-server/.env with

POSTNORD_KEY=<API KEY>

Start the services

docker-compose up

Run migrations and start the engine

cd packages/engine_umbrella/
mix deps.get
mix setup_dev
iex -S mix

Running tests

Make sure you've started the dependencies with docker-compose up -d then run

cd packages/engine_umbrella/
mix deps.get
mix setupTestDatabase
mix test

Helper/utility functions for populating the state

The umbrella project has an application "message_generator" which is used to create rabbitMQ messages for producing transports and bookings. First start the umbrella project in an elixir shell

cd packages/engine_umbrella/
iex -S mix

Then the Generator module is available inside the shell.

add_booking/0      add_booking/1      add_transport/0    add_transport/1

The argument can be a map containing properties or an atom for creating a generic one close to a city, (:stockholm, :gothenburg, :ljusdal) or in the case of the add_transport; a keyword list can also be used containing :phone, i.e: Generator.add_transport(phone: "0735333")

Design mockup: Figma

Infrastructure

The documentation about our cloud infrastructure and tools used is available here


Vocabulary

Transport (previously vehicle){
    id
    busy
    activities
    booking_ids
    metadata
    start_address
    end_address
    earliest_start
    latest_end
    profile
    capacity
}
Booking {
    id
    pickup
    delivery
    assigned_to
    external_id
    events
    metadata
    size
    requires_transport_id
}

Plan

Route

License

Predictive Movement is licensed under the MIT license. Please see LICENSE for details.

Predictive Movement's Projects

predictivemovement icon predictivemovement

A neutral platform for coordinating transports leading to reduced emissions and increased service for rural areas

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.