I would like to ask you some suggestions and ideas for my java application to compute a taxi scheduling with sharing ride.
Let's suppose that i have a taxi with two users (passengers). The users are going to share the trip, but both passengers are located in different places and are going to be picked up/dropped off at different times. The user model with its pick up and drop off locations, is:
(Grid1)<-[:PICK_UP {time:'10:30'}]-(user1)-[:DROP_OFF {time:'11:00'}]->(Grid9)
(Grid4)<-[:PICK_UP {time:'10:15'}]-(user2)-[:DROP_OFF {time:'10:45'}]->(Grid11)
Or even i can write all the properties inside a User Node e.g. user 1
pickUpLocation:'Grid1'
pickUpTime:'10:30'
dropOffLocation:'Grid9'
dropOffTime:'11:00'
Are both options okay?
I would like to compute the taxi path scheduling, in order to know which user has to be picked/dropped first/last, something like this:
Grid4 --- Grid1 --- Grid11 --- Grid9
10:15 10:30 10:45 11:00
(pick (pick (drop (drop
user2) user1) user2) user1)
My idea is to get the pick up-time value for each user, and store it into a Collection(TreeSet), then do the same with the drop-times. So i can get an ordered collection. Is that a good idea??
But then, where should i store the Grid location (Grid4, Grid1, etc.)?? So then at the end, i can have all the information for the taxi, Where to go and at what time.
Any suggestions or ideas?
Thank you in advance!