https://github.com/akselsledins/google-hashcode-2018-live-simulation
Google Hash Code 2018 - Simulation / Result Viewer
https://github.com/akselsledins/google-hashcode-2018-live-simulation
go golang google hashcode hashcode-2018 results results-viewer simulation
Last synced: 6 months ago
JSON representation
Google Hash Code 2018 - Simulation / Result Viewer
- Host: GitHub
- URL: https://github.com/akselsledins/google-hashcode-2018-live-simulation
- Owner: AkselsLedins
- License: gpl-3.0
- Created: 2018-03-01T20:09:04.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-05-18T15:47:47.000Z (over 3 years ago)
- Last Synced: 2025-06-20T13:52:12.381Z (8 months ago)
- Topics: go, golang, google, hashcode, hashcode-2018, results, results-viewer, simulation
- Language: Go
- Homepage:
- Size: 9.86 MB
- Stars: 14
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
Google Hash Code 2018 : live simulation

[](https://circleci.com/gh/AkselsLedins/google-hashcode-2018-live-simulation)




## 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](resources/subject.pdf)
#### Guide to better understanding the animation
| Illustration | Explanation |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|
|  | A red dot is a car. |
|  | The red line is a representation of a failed trip. The car arrived late. |
|    | A blue line is a trip in progress. You can see the car going through. |
|   | A green line is a completed trip. |
|  | A grey line means that a driver is assigned to the trip. |
|  | 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.
## Preview

## Installation
```
$> make deps
$> make
```
### Requirements
* OpenGL see [github.com/faiface/glhf](https://github.com/faiface/glhf#which-version-of-opengl-does-glhf-use)
* [github.com/faiface/pixel](https://github.com/faiface/pixel#requirements)
* [github.com/go-gl/glfw/v3.2/glfw](https://github.com/go-gl/glfw#installation)
* `go>=1.8.1`
## Running
| flag | required | explanation |
|--------|----------|-------------------------------------------------------------------------------------------|
| -o | :white_check_mark: | path to the output file you have generated with your program during the hashcode |
| -i | :white_check_mark: | 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
```

#### 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](https://tldrlegal.com/license/gnu-general-public-license-v3-(gpl-3))