Skip to content
This repository has been archived by the owner on Nov 23, 2017. It is now read-only.
/ ant-walking Public archive

A stochastic simulation of an ant walking | A college project for the discipline Probability & Statistics

License

Notifications You must be signed in to change notification settings

ryukinix/ant-walking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A stochastic simulation of an ant walking | A college project for the discipline Probability & Statistics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages