Traffic Simulation Programming
Building with software is only limited by our imagination and creativity. Our goal was to build a program in StarLogo TNG or another coding software. The program could be either a game or simulation. While creating our program we had to learn techniques of god programming design such as documenting and writing and testing.
As a student driver, I pay lots of attention to the road, and more specifically traffic lights. They drive me nuts. With modern technology, cities have been able to implement systems that change the lights using sensors in the road. Intersections that don't have sensors are painful. These lights run through a simple patterns designed for heavy traffic. Because this was something I could relate to, I decided to make a traffic light simulation. The terrain, or space-land, would be a large intersection with three lanes going straight north and south and two going west and east. At the beginning of the project, I was working very slowly. I took a little longer to finish my gates which were small write ups that we filled out to keep track of what we had accomplished and what still needed to be done, mostly because I was uninspired and lazy. As the project continued on, I put more and more effort into making my simulation work. Right off the bat I was experiencing that "one step forward two steps back" feeling with every problem I had. When I would discover a problem for car one, I realized that car two had it in a different place. And then car three in another, and so on. But within one week of hard work, I was getting towards what I had originally envisioned.
As I talked about earlier, our gates were short write ups we did periodically to keep track of what exactly we had already planned and executed. We could also track what we still needed to accomplish and in what amount of time. For this reason, they had the potential to be extremely helpful. unfortunately, I did not use them to their fullest and now realize just how much they could have helped.
Gate One
I would like to write a program on traffic light flow. Because I drive to school every day, I notice how inefficient traffic lights with no forms of sensors are. My program is going to start out as a simulation but will most likely evolve into a semi interactive system. Some of my first drafts would be designing the background with a template for the road system.
My intersection will most likely have the following:
-a straight lane for each direction
-a turn lane for each direction
-possible secondary turn lanes (left or right)
-possible secondary straight lanes
-multi option lanes in place of a straight lane
Some of the more challenging factors I will have to program are:
-slow driver
-red light runners
-large vehicles with slow takeoff
-emergency vehicles manually switching lights
I think the biggest challenges I will face will be making the cars appear to be random and not coordinate to each other but still go in the same direction as others.
Gate Two
My goal is to have a realistic looking intersection centered in spaceland. It would have roads that lead away from it all the way to the edge of spaceland. The actual intersection would have:
-lights for all directions
-turn lanes for at least two directions
-accurate lane lines
-those lines that go out into the intersection to guide a left hand turn
The goal for user experience is to have the player control the intersections congestion. They player would be using multiple controlling aspects such as:
-sliders
-switches
-variables
I would like for the car movement to be as realistic as possible. Although making them stop at the line and then go when the light turns green is still mysterious to me, I am more worried about figuring out how to make cars turn corners without looking really weird. I've done some experimenting and tried to find the right angle to turn at but I'm not sure its a task a program can handle. I would also like to implement uncontrollable factors like distracted drivers. To do this, i will have cars at random stall before taking off and have larger vehicles go slower.
Gate Three
Pre-Alpha Features
-spaceland layout
Alpha Features
-spaceland layout
Hopefully in Alpha
Beta Features
As a student driver, I pay lots of attention to the road, and more specifically traffic lights. They drive me nuts. With modern technology, cities have been able to implement systems that change the lights using sensors in the road. Intersections that don't have sensors are painful. These lights run through a simple patterns designed for heavy traffic. Because this was something I could relate to, I decided to make a traffic light simulation. The terrain, or space-land, would be a large intersection with three lanes going straight north and south and two going west and east. At the beginning of the project, I was working very slowly. I took a little longer to finish my gates which were small write ups that we filled out to keep track of what we had accomplished and what still needed to be done, mostly because I was uninspired and lazy. As the project continued on, I put more and more effort into making my simulation work. Right off the bat I was experiencing that "one step forward two steps back" feeling with every problem I had. When I would discover a problem for car one, I realized that car two had it in a different place. And then car three in another, and so on. But within one week of hard work, I was getting towards what I had originally envisioned.
As I talked about earlier, our gates were short write ups we did periodically to keep track of what exactly we had already planned and executed. We could also track what we still needed to accomplish and in what amount of time. For this reason, they had the potential to be extremely helpful. unfortunately, I did not use them to their fullest and now realize just how much they could have helped.
Gate One
I would like to write a program on traffic light flow. Because I drive to school every day, I notice how inefficient traffic lights with no forms of sensors are. My program is going to start out as a simulation but will most likely evolve into a semi interactive system. Some of my first drafts would be designing the background with a template for the road system.
My intersection will most likely have the following:
-a straight lane for each direction
-a turn lane for each direction
-possible secondary turn lanes (left or right)
-possible secondary straight lanes
-multi option lanes in place of a straight lane
Some of the more challenging factors I will have to program are:
-slow driver
-red light runners
-large vehicles with slow takeoff
-emergency vehicles manually switching lights
I think the biggest challenges I will face will be making the cars appear to be random and not coordinate to each other but still go in the same direction as others.
Gate Two
My goal is to have a realistic looking intersection centered in spaceland. It would have roads that lead away from it all the way to the edge of spaceland. The actual intersection would have:
-lights for all directions
-turn lanes for at least two directions
-accurate lane lines
-those lines that go out into the intersection to guide a left hand turn
The goal for user experience is to have the player control the intersections congestion. They player would be using multiple controlling aspects such as:
-sliders
-switches
-variables
I would like for the car movement to be as realistic as possible. Although making them stop at the line and then go when the light turns green is still mysterious to me, I am more worried about figuring out how to make cars turn corners without looking really weird. I've done some experimenting and tried to find the right angle to turn at but I'm not sure its a task a program can handle. I would also like to implement uncontrollable factors like distracted drivers. To do this, i will have cars at random stall before taking off and have larger vehicles go slower.
Gate Three
Pre-Alpha Features
-spaceland layout
- truck forward
- truck turn right
- truck turn left
- car forward
- car turn right
- car turn left
- slow vehicle
- distracted driver
Alpha Features
-spaceland layout
- Pre-Alpha
- truck stop
- truck wait on vehicle in front of it
- car stop
- car wait on vehicle in front of it
Hopefully in Alpha
- light turn green
- light turn red
- sensor sense waiting car
- sensor send pulse to stop light
Beta Features
- Alpha
- light turn green
- light turn red
- sensor sense waiting car
- sensor send pulse to stop light
Reflection
This project was one of a kind. I'm 90% sure I've never had such mixed feelings bout a project. With this one, I hated it like crazy at times but also had lots of fun other times. Overall the project went fairly well. I did learn quite a few tricks in programming in StarLogo and I did get better at staring at screens for a long time. Some things that didn't go well for me was that I feel that I didn't get to work on any apparent math skills. A lot of the work I did was clicking and dragging. A ton of the work was logistics in my head, but not much math. I also didn't get nearly as far as I had hoped to. At this point, my cars can turn corners and go the right direction, but they do not avoid each other at all. I do believe that if I depended on my gates more, I would have gone further. Although I set up my three gates, I didn't exactly work to what they said. If I were to do this project again, that is something I would improve on.
This project was one of a kind. I'm 90% sure I've never had such mixed feelings bout a project. With this one, I hated it like crazy at times but also had lots of fun other times. Overall the project went fairly well. I did learn quite a few tricks in programming in StarLogo and I did get better at staring at screens for a long time. Some things that didn't go well for me was that I feel that I didn't get to work on any apparent math skills. A lot of the work I did was clicking and dragging. A ton of the work was logistics in my head, but not much math. I also didn't get nearly as far as I had hoped to. At this point, my cars can turn corners and go the right direction, but they do not avoid each other at all. I do believe that if I depended on my gates more, I would have gone further. Although I set up my three gates, I didn't exactly work to what they said. If I were to do this project again, that is something I would improve on.