Results 1 to 11 of 11
Like Tree1Likes
  • 1 Post By ShadowWalker

Thread: Simulation program

  1. #1
    mora10 is offline Member
    Join Date
    Aug 2016
    Posts
    5
    Rep Power
    0

    Default Simulation program

    Hello, my final project consists on developing a road traffic simulation based on mathematical model .
    the inputs of this one are : the network, arrival rate of vehicles to each lane ,matrix which contain the probability of passing from a queue to another, the plan of traffic lights(green periode,red period,) .
    I have difficulty to define them, esppacially the network
    Can someone help me.
    Thanks for response in advance.

  2. #2
    ShadowWalker is offline Senior Member
    Join Date
    Mar 2013
    Location
    Greece
    Posts
    183
    Rep Power
    8

    Default Re: Simulation program

    Well the information you provide are not enough to give you a more detailed answer, but you could simulate the whole thing with a graph. The graph will simulate the network. The network will consist of Nodes and links. Each Node will be a location in the network and each link will connect two Nodes. Now you can add as many variables as you want on this model, for example, you could say that each link (lane) will have a delay of 5 Sec (lights) and it can allow only up to 10 cars and so on.. At least this is how I imagine the entire project. The use of Graph will help you later to apply existing algorithms of finding the best way to reach a node from a certain node etc..

    If you want more help, you could post some code of what you have tried until now or give us more details about the entire project.

  3. #3
    mora10 is offline Member
    Join Date
    Aug 2016
    Posts
    5
    Rep Power
    0

    Default Re: Simulation program

    The network must be configurable in terms of number of noads and links .
    Also,the road segment can contain one,two or three lanes,so i think that the use of graph is not appropriate in this case.

  4. #4
    ShadowWalker is offline Senior Member
    Join Date
    Mar 2013
    Location
    Greece
    Posts
    183
    Rep Power
    8

    Default Re: Simulation program

    The network must be configurable in terms of number of noads and links .
    Which is quite simple to make. You can create a graph using an array as an input, which is called adjacency matrix you can use google to find more information about this subject.

    Also,the road segment can contain one,two or three lanes,so i think that the use of graph is not appropriate in this case.
    Well, this is really a matter of perspective and code implementation. Let's imagine that the roads are linked in the graph. Well each road can have multiple lanes, but still is going to connect only two Nodes in the Graph. In my point of view the lanes are translated as simultaneous access to the link. In code that would mean that each road (link) will have N number of queues where N is going to be the number of lanes. If you still don't agree with my approach I would like to know how do you imagine the existence of lanes in your project.. I mean what are their purpose. Maybe trying to figure that out will help you find a better implementation of this project.

    Of course I don't want to force you to use my idea and I can't really say that it is the best way to processed with the project, but I can see some benefits to doing so

  5. #5
    mora10 is offline Member
    Join Date
    Aug 2016
    Posts
    5
    Rep Power
    0

    Default Re: Simulation program

    First,what do you mean by " simultaneous access to the link"?
    Second,how can I define the distance between two nodes (in meter for example)?

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,003
    Rep Power
    33

    Default Re: Simulation program

    If you don't understand my response, don't ignore it, ask a question.

  7. #7
    ShadowWalker is offline Senior Member
    Join Date
    Mar 2013
    Location
    Greece
    Posts
    183
    Rep Power
    8

    Default Re: Simulation program

    First,what do you mean by " simultaneous access to the link"?
    Good question.. It depends on what you want to do. Your network graph can be very abstract if you only put cities as nodes, but actually if you want to make it more detailed you will have to but as nodes cities, streets, etc. You spoke about 'arrival rate', 'traffic lights (green period, red period)' and about lanes. So I visualize it like a real situation, where for example, we will be in a road stoped in the lights and the green period will be 10 seconds and we will have 3 lanes. In 10 seconds only 5 cars have time to go thought the road before the lights turn to red. So the access of the link in a specific period of time will be 5 chars (max) of each lane (simultaneous access because each lane is independent from the others). So if a link (road) has N number of Queues (lanes), K, L and M number of vehicles are going to be removed in each period of time from each queue where these numbers have a max value depends on the road specification like my example above.


    Second,how can I define the distance between two nodes (in meter for example)?
    You can do that while defining the links in your graph. Let's just say that you manage to create all the nodes as entities. Then you want to make the links between them. If you want to connect the Node A to Node B you could do something like A.makeLink(B,150) which will say that there is a directional link between node A and Node B and the distance of those is 150meters.


    PS. I am really sorry for my English. If there is something that you still don't understand, just ask and I will try to explain it better :P
    mora10 likes this.

  8. #8
    mora10 is offline Member
    Join Date
    Aug 2016
    Posts
    5
    Rep Power
    0

    Default Re: Simulation program

    You can do that while defining the links in your graph. Let's just say that you manage to create all the nodes as entities. Then you want to make the links between them. If you want to connect the Node A to Node B you could do something like A.makeLink(B,150) which will say that there is a directional link between node A and Node B and the distance of those is 150meters.
    So I have prepare a conception to my program?

  9. #9
    mora10 is offline Member
    Join Date
    Aug 2016
    Posts
    5
    Rep Power
    0

    Default Re: Simulation program

    Quote Originally Posted by Norm View Post
    I published the problem in other forum in order to gain the time

  10. #10
    ShadowWalker is offline Senior Member
    Join Date
    Mar 2013
    Location
    Greece
    Posts
    183
    Rep Power
    8

    Default Re: Simulation program

    But of course.. I believe you have to prepare all the entities first like nodes and links with all their properties and then to connect them. Now how are you going to create all the nodes and the links are on another matter. I believe you could make a file for the nodes and a file with the links to all properties inside and create a method that reads these files and prepare the objects. After that you will make all the connections with the same way.

  11. #11
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,059
    Rep Power
    26

    Default Re: Simulation program

    Quote Originally Posted by mora10 View Post
    I published the problem in other forum in order to gain the time
    https://coderanch.com/wiki/660346/Wi...-Posting-Sites
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Car Simulation (Array)
    By slacoul in forum New To Java
    Replies: 1
    Last Post: 09-29-2011, 10:04 AM
  2. BPA registration simulation
    By noahwhygodwhy in forum New To Java
    Replies: 4
    Last Post: 04-04-2011, 12:47 AM
  3. Simulation in Java
    By Eranga in forum Advanced Java
    Replies: 15
    Last Post: 08-15-2010, 04:32 AM
  4. Dice Simulation Program
    By touandcim in forum New To Java
    Replies: 3
    Last Post: 03-15-2010, 12:09 PM
  5. beehive simulation
    By BlueF4re in forum New To Java
    Replies: 2
    Last Post: 12-02-2009, 08:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •