Rail Road Yard Simulation

Closed Posted 7 years ago Paid on delivery
Closed Paid on delivery

In this project, you will be implementing a rail road yard simulation program. The user will provide a set of incoming cars, and then a desired outgoing order. Your program will determine if the given incoming cars can be rearranged to the desired outgoing order or not.

Background: This is an example of a control/management system: in order to deliver specific resources to specific destinations, we have to guarantee that those resources are available at their destinations. Consider: the easiest car to detact from a train transporting materials is the back most one. Thus, it would ideal to arrange the train's cars in such a way that the order of destinations visited, matches the order of the cars. If the required car is in the middle of the train, there will be trouble! Our goal is to address this by trying to arrange the cars into the order of the destinations they will visit ("desired outgoing order").

Problem: Imagine that the rail yard looks like this:

Incoming cars Outgoing cars (based on destination order)

>----------------------------------------------------------------------------------->

A B C D E E D C B A

>-----------------------------\ /----------------------------------->

\ /

| |

| |

| |

| |

| |

----------------

Waiting Line

In this example, the incoming cars come in the order E, D, C, B and A. The desired outgoing order (since the track moves only to the right) is A, B, C, D and E. Our program considers the first incoming car, vs the desired outgoing car. Since E != A, E must go into the waiting line. Now our program will consider both the car at the top of the waiting line (since it is blocking all the others cars) as well as the incoming car each time. Again, E != A but also D != A, so D gets put in the waiting line, blocking E in the process. This will continue until A is the only car left in the incoming line, and it will be sent out. This leaves nothing incoming, but B would be the top car in the waiting line. Since B == B, B gets taken from the waiting line and sent out. This will repeat until all cars are gone, meaning the input was successfully matched to the output. An example that does NOT match is UGTA to AGTU. A, T and G would go into the waiting line. U would be sent out, but then the next required outgoing car is T. There would be nothing left in the incoming line, and the top car in the waiting line would be G. So, the match fails.

Java Software Architecture

Project ID: #11645086

About the project

8 proposals Remote project Active 7 years ago

8 freelancers are bidding on average $52 for this job

vano101

Hello. It is easy project it can be completed in few hours of pure working time.

$21 USD in 1 day
(1030 Reviews)
7.2
einestine1

Changing to be more competitive with other candidates, and after revising the given requirements by the client.

$20 USD in 1 day
(5 Reviews)
3.0
johnsonaugust76

i am alread working to Simulation i have experince of 5 yyear ..i am alread working to Simulation i have experince of 5 yyear ..i am alread working to Simulation i have experince of 5 yyear ..i am alread working More

$35 USD in 1 day
(0 Reviews)
0.0
nikitin743

I think that this project is quite interesting, and I am ready to cooperate with you.

$20 USD in 3 days
(0 Reviews)
0.0