项目作者: notAFK

项目描述 :
Aston Hackathon 2016. #astonhack #geesehack
高级语言: Python
项目地址: git://github.com/notAFK/astonhack-2016.git
创建时间: 2016-11-05T10:50:39Z
项目社区:https://github.com/notAFK/astonhack-2016

开源协议:Other

下载


ASTON HACK 2016

Geese themed hackathon!

npm license
AstonHack2016 Status
Docker IMG

Travis CI Status

Build Status

Goose

Description

Fragile/Swarming Geese Simulator, is a Python program that “simulates” the
behaviour of geese (a common theme around Birmingham). The main idea was to
create the activity history of groups and individual geese and then plot their
actions on a map (using Google Maps API). The history is stored using the crate.io
database.

How to run the program.

  1. source/geesemanager.py

This will start a custom “shell” that allows you to call some of the main
functions of the program. You can also use RAW Python if you wish.

Inside the “shell” you can run:

  1. jimmy = createGoose()

This will start a “wizzard” to help you define
Jimmy, you can either use random data or custom
data.

  1. jimmy = createGoose()
  2. Use random data? (y/n)
  3. ---> y
  4. >_

Now we have a random goose in ‘jimmy’.

  1. print jimmy
  2. 89e129f6
  3. >_

Printing ‘jimmy’ like that will return the hashid.

If we were to choose custom data for ‘jimmy’, the
setup would look like this:

  1. >_ jimmy = createGoose()
  2. Use random data? (y/n)
  3. ---> n
  4. name ---> Jimmy
  5. age (d) ---> 600
  6. span (d) ---> 600
  7. health ---> 200
  8. hunger ---> 300
  9. X: 90
  10. Y: 80
  11. gender ---> 2
  12. range ---> 55
  13. >_

Creating a clan.

  1. >_ someclan = createClan(50,0,2)
  2. # 50 is the number of geese.
  3. # 0 is the X coordinate.
  4. # 2 is the Y coordinate.

Simulating a clan.

  1. >_ start(someclan)
  2. # After this you are prompted to give a date.
  3. # Then hell breaks loose!!!
  4. # Some geese die, some are born, overall they win!

More

For more information on what the program can do, look at the functions defined inside source/geesemanager.py


crate.io

The program tries to connect to a crate.io database, so make sure you have one running

  1. crate/crate # Linux/Mac

and when asked provide the ip and port:

  1. # Should work on most machines!
  2. ip: localhost
  3. port: 4200

After this, Python connects to the database and stores data about the geese! AMAZING!