In this project, you will have to fix a concurrent Java program that, at present, runs but has a data race condition. The Java program that included models a country road with a one-lane bridge. Cars can go through the bridge only in onde direction at a time, because the bridge is too narrow for two cars to pass through it in different directions.
The following high-level abstractions are used in the buggy version of the program:
**Car** A car that drives through the portion of the road that is modeled.
**Road** The portion of road modeled in this program. The middle of this portion represents a one-lane bridge.
**Bridge** The part of the road that is one-lane.
**Segment** The road through which cars go is partitioned into segments. A segment allows cars to pass either in one particular direction (left or right) or in both directions. In any case, no more than one car at a time can be in a segment. The bridge consists of multiple segments.
At present, the program contains a bug: cars can enter the bridge from two different directions and then get stuck in the middle of the bridge. You have to add code to the program so that when a car is about to enter the bridge, checks if there are any cars on the bridge that are moving in the opposite direction and prevent the car from entering the bridge if that is the case.
See attachement for detail.
Must use the file in the zip folder.
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):
a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.
b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.
3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).
## Platform
Must use JDK1.4.2 and Eclipse to compile and run the program.