Git Product home page Git Product logo

mdacs's Introduction

MDACS: a multithreading and distributed simulator of ant colonies

MDACS is a multithreading and distributed simulator of ant colonies.

Goal

The goal of this program is to simulate transporting and clustering objects by an ant colony. It consists of representing an ant colony dropping and picking different types of objects on heaps depending on their density. Ants will move and explore an area represented as a 2D grid.

How it works

  • initialization of objects, ants and grid is done randomly by the server
  • both server and clients are multithreading
  • number of threads and ants per client is randomly decided by server
  • server synchronizes clients
  • clients send their ants positions to server. Server can accept or not
  • client(s) handle(s) transporting and clustering of ants given by the server
  • three different configurations are provided: easy, hard, and extreme

Features

  • chance to execute the program on a single computer or on multiple computers connected to a network
  • clients can be on the same server's computer or on multiple computers

Requirements

  • Linux distribution
  • GLUT is required for the GUI

GUI

A very basic GUI is used for showing colony's progress. Thanks to Guillaume Perez for his GLUT based library.

Usage

Clone the repository on all computers you want to use:

$ git clone --recursive [email protected]:lukesmolo/MDACS.git

Go to src and choose which configuration to use by copying and renaming the Config file you want to use in Config.h.

For example:

$ cd src
$ cp Config.h.hard Config.h

If you want to use just one computer for both server and clients

Compile the program:

$ make

Open a terminal for each client and run the server and clients in different terminals.
For example, on terminal 1:

$ ./main

On terminal 2 and 3:

$ ./client

If you use rxvt-unicode, you can just use:

$ make run

If you want to use more computers

On each client modify the DEFAULT_SERVER_ADDRESS macro in Config.h, inserting the server IP address.
For example:

#define DEFAULT_SERVER_ADDRESS "192.168.1.18"

Compile the program on each computer involved:

$ make

Run server on the server computer:

$ ./main

Run client on each client computer:

$ ./client

Of course, you can have more clients on the same computer. Just use more terminals.
If you modify Config.h file, please clean all and compile again:

$ make clean
$ make

Warning

Sometimes the server or a client seems not working. This is actually caused by the random distribution function that spreads in a very bad way threads/ants. Please, just restart the program and hopefully this time everything will be ok.

Credits

libEngine.a, the GLUT based library used in this project for GUI, was written by Guillaume Perez.
Here his project.

License

MDACS is released under the GPLv2 license.

TODO

  • improve client's ant algorithm for deciding how to move ants

mdacs's People

Contributors

lukesmolo avatar

Stargazers

Roberto Paes avatar

Watchers

 avatar

Forkers

jiafu2018

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.