Coder Social home page Coder Social logo

trafficsimulation's Introduction

#Traffic Simulation

The aim is to develop an application allowing to test crossing strategies for trains. A train is composed of vehicles attached one to each other by an immaterial link. Each vehicle has a starting point and a destination.
When two trains are crossing, they have to nor stop themselves neither bump into each other. The crossing has to be done thanks to spacing between vehicles.
When a vehicle alone (a train which has only one vehicle) bumps into a train, the vehicle alone and the bumped vehicle in the train are both destructed.
When a vehicle alone bumps into a train which has the same destination (or at least the next intermediate in its trip), it joins it.
The user has four options on the simulation:

  • accelerate a vehicle (only possible if in a train which only contains this vehicle).
  • decelerate a vehicle (only possible if in a train which only contains this vehicle).
  • quit its train as soon as possible (at the next cross road, the vehicle has to quit its train, even if it means it has to take a way which does not allow it to reach its destination).
  • switch color of the traffic lights.

####Authors: Johann NOVAK ([email protected])
Quentin SCHULZ ([email protected])

####Usage:

  • Continue the project

Clone the repository and directly import it in your favorite IDE (it was developed thanks to Eclipse, so it will work also with NetBeans).

  • Take a look at the project

Download the .jar and all images at the root of this project and run it on your computer (the safest way to run the project is to import it in your IDE and export it to a .jar file instead of downloading it).
Next, set the .jar file executable: chmod +x TrafficSimulation.jar
Then run it with: java -jar TrafficSimulation.jar

#####Changelog

v0.1 - 2014-02-23 Initial release.

#####Bonus

####How to create a new map

Create a new .xml file wherever you want and follow the guides.

  • Creation of a new cross road:
    <CrossRoad>
    <Name>C1</Name>
    <PosX>77</PosX>
    <PosY>20</PosY>
    </CrossRoad>

  • Creation of a new road:
    <Road>
    <Starting_CrossRoad>C1</Starting_CrossRoad>
    <Ending_CrossRoad>C3</Ending_CrossRoad>
    </Road>

  • Creation of a new map:
    <?xml version=”1.0“ encoding=”UTF-8“?>
    <map>

    <CrossRoad>
    <Name>C1</Name>
    <PosX>77</PosX>
    <PosY>20</PosY>
    </CrossRoad>

    <CrossRoad>
    <Name>C2</Name>
    <PosX>98</PosX>
    <PosY>63</PosY>
    </CrossRoad>

    <CrossRoad>
    <Name>C3</Name>
    <PosX>6</PosX>
    <PosY>150</PosY>
    </CrossRoad>

    <Road>
    <Starting_CrossRoad>C1</Starting_CrossRoad>
    <Ending_CrossRoad>C3</Ending_CrossRoad>
    </Road>

    <Road>
    <Starting_CrossRoad>C3</Starting_CrossRoad>
    <Ending_CrossRoad>C2</Ending_CrossRoad>
    </Road>

    </map>

trafficsimulation's People

Watchers

James Cloos avatar Quentin Schulz 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.