Description
Lessons Learned:
I learned a lot about concurrent programming in Java. I learned how to set up threads that correspond to certain tasks and to increment time by having them sleep. I learned the difference between pausing and stopping a thread, as well as how to restart and interrupt a thread that is waiting or sleeping. I also learned a lot about Java swing and how to update values in a JLabel based on values returned by a threaded process. I found this program challenging and fun.
Test case Input Expected output Actual output Pass
1 add a car add an intersection add a car add an intersection add a car add an intersection press start press pause press resume press stop “created car 1
“created intersection 1”
“created car 2
“created intersection 2”
“created car 3
“created intersection 3”
“sim running”
“sim paused”
“sim resumed”
“sim ended” “created car 1
“created intersection 1”
“created car 2
“created intersection 2”
“created car 3
“created intersection 3”
“sim running”
“sim paused”
“sim resumed”
“sim ended” pass
Adding car
Adding intersection
Adding cars and intersections Starting sim
(All Cars are stopped because they are within 50 meters before a red traffic light) Pausing sim
.resuming sim ending sim
Test case Input Expected output Actual output Pass
2 add a car add a car add a car add a car add an intersection add an intersection add an intersection add an intersection “created car 1”
“created car 2”
“created car 3”
“max cars added”
“created intersection 1”
“created intersection 2”
“created intersection 3”
“max lights added” “created car 1”
“created car 2”
“created car 3”
“max cars added”
“created intersection 1”
“created intersection 2”
“created intersection 3”
“max lights added” pass
Max cars added Max lights added
Test case Input Expected output Actual output Pass
3 add a car add a car add an intersection add an intersection press start press pause press resume press stop “created car 1”
“created car 2”
“created intersection 1”
“created intersection 2”
“sim running”
“sim paused”
“sim resumed”
“sim ended” “created car 1”
“created car 2”
“created intersection 1”
“created intersection 2”
“sim running”
“sim paused”
“sim resumed”
“sim ended” pass
2 lights and 2 intersections created
simulation running
simulation paused simulation resumed
simulation ended UML diagram
Reviews
There are no reviews yet.