Skip to content

AkselsLedins/google-hashcode-2018-live-simulation

Repository files navigation

Google Hash Code 2018 : live simulation

goreport CircleCI License Forks Stars Twitter

Introduction

Some context on the competition:

We are given a list of pre-booked rides in a city and a fleet of self-driving vehicles. The objective of the competition is to assign the rides to vehicles, so that riders get to their destinations on time.

The competition subject

Guide to better understanding the animation

Illustration Explanation
driver A red dot is a car.
failed-trip The red line is a representation of a failed trip. The car arrived late.
will-complete Preview Preview A blue line is a trip in progress. You can see the car going through.
will-complete will-complete A green line is a completed trip.
assigned A grey line means that a driver is assigned to the trip.
waiting A yellow line means that the driver is ready, but it's too early to start the ride.

Important: we are only showing the assigned trips. If you press [T] you can toggle off/on the unassigned ones.

off on

Preview

Preview

Installation

$> make deps
$> make

Requirements

Running

flag required explanation
-o path to the output file you have generated with your program during the hashcode
-i corresponding input file, ex: b_should_be_easy.in
-noGui you can run the simulation withtout a graphic interface. This will only output your score
-h display help

Example with a Graphic Interface

$> ./google-hash-code-2018 -o resources/output-files/b.out -i resources/input-files/b_should_be_easy.in

Preview

Example without a Graphic Interface

$> go run main.go -o resources/output-files/e.out -i resources/input-files/e_high_bonus.in -noGui
16381105

Graphic interface commands

Command effect
press "space" pause / start the simulation
press "t" shows / hide all the simulation trips
arrow keys move the camera around
mouse scroll zoom in/out

FAQ

Why ?

I thought it would be a fun project to practice Go

Contributing

See Contributing.md.

But basically feel free to contribute if you find something to improve.

License

GPL-V3