Click here to Skip to main content
16,022,060 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a water taxi booking system with direct, non-stop routes, which works fine.

Now I have business scenario where one route has multiple stops. So if the starting point of the route is location A, then end point could be location E, with stops at B, C, and D. In between these A and E locations a passenger can board or disembark at any time, meaning it has permutations and combinations of possible start and stop points. So this is more like a metro bus route now.

How can I support this, so I can know capacity at any point along the way?

The existing system is built for continuous (nonstop) A-B routes, where vessel capacity is calculated for the particular start and stop for the full route.

What I have tried:

Added  a vessel entity which has a capacity field.
I added a Legs entity, which specifies the start and stop, as well as a sail entity which uses leg and vessel assigned to it with capacity. We also added a booking entity which makes booking for the passenger and deducts the capacity from sail entity.

This system works fine with non-stop routes, where passengers board at point A, disembark at point B, and there are no stops in between. But now I need to support more-complicated routes.
Posted
Comments
Richard Deeming 17-Sep-24 13:13pm    
No, we won't do your homework for you, no matter how many times you repost the same assignment!

You have shown no attempt to answer the question yourself. You have shown no code. Simply stating that you've already done part of the assignment, without showing us what you've done and explaining precisely where you are stuck, isn't going to convince us.
Christian Graus 17-Sep-24 19:19pm    
This is a common homework question and lots of examples exist online

1 solution

A suggestion for you on how to solve this. The trick here is to be able to visualise the journey and the passenger situation. What you could do is draw a three legged journey, cut out a rectangle to represent the taxi. Have little shapes represent both passengers and potential passengers, and perform the journey yourself. Once you have run through this once, expand it to the full journey and continue with the visualisation.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900