Giter Club home page Giter Club logo

ant-walking's Introduction

Ant Walking

An ant walking simulation using concepts of randomness at discipline Probability & Statistics

Python simulation

simulation

Design

The python version was wrote using pygame for handling the window events, graphics and logic. The coding-style was used Programming Object-Oriented and as more modular as possible. The script whose has the main-loop is: simulation.py. The other scripts was spited into:

  • automaton.py
    • Our specific entities, as Automaton (base), Ant and Track
  • base.py
    • Abstract class called Entity designed to inherit from automaton specific classes
  • colors.py
    • Some colors constants, like WHITE and BLACK
  • graphics.py
    • 8bit-like graphics for Ant and Track (the footprint)
  • grid.py
    • about block size and the amount of blocks on screen (the size of matrix)
  • motion.py
    • directions definitions, like UP, DOWN, RIGHT and LEFT.
    • All directions definitions are in function of BLOCKSIZE variable in grid.py
  • main.py
    • a script helper, only calling the simulation.py AntSimulation.run()

Usage Instrunctions

To execute this you need Python3.x >= (3, 4) or Python2.x >= (2.6). Beyond that you need too the Pygame library. If you are using Ubuntu, you can type this:

  • sudo apt-get install python-pygame or sudo pip install pygame

If pip was not installed try: sudo apt-get install python-pip.

If you are using Windows, you need eternal suffering. Ow, I'm kidding. You can try installing using the pre-compiled lib binaries here keeping attention with your python version.

After that, only execute at terminal in proper directory: python simulation.py

ant-walking's People

Contributors

ryukinix 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.