One question regarding logging: There is a log regarding actively driving (containing distance driven etc.). Should this log also be used while the driver is returning to the restaurant after the delivery?
And also 2 questions regarding the delivering logic itself:
If a group gives up on an order, is the driver notified in some way and turns around or does he still do the entire trip and just log a failure when arriving?
We have to log the travelled distance in kilometers. Should this be computed as deliveryDistance * (travelledTicks / deliveryDuration) where a deliveryDuration of 0 needs to be treated separately? And should the result always be rounded up if needed?
A customer group decides to “give up waiting” if their delivery has not arrived by 3 ticks after its expected arrival time. However, the driver continues driving and logs their progress normally. Upon arrival, the driver attempts to give the group the meals, but because the group has already given up, the delivery fails, prompting a Delivery Failed log. Only after this failed attempt is made does the driver begin the return journey to the restaurant. So the driver is not stopping midway and going back.
The total duration of a delivery in ticks is calculated as ⌈distance/5⌉.
During each driving tick, the driver logs the cumulative distance driven in kilometers ($delivery:distance km) alongside the remaining ticks ($delivery:ticks).
The driver returns to the restaurant covering the same distance and duration.
I understand the first 2 points but I’m still uncertain about the third one.
The cumulative distance up until a certain point has to be computed via a fraction based on how many ticks of the delivery duration, the driver has already driven. E.g. if the delivery distance is 9km, then the delivery duration is 2 ticks. Meaning that 1 tick is equivalent to 4.5km.
Should we actually use the exact decimal number that we computed for logging or should we e.g. always round up to the next integer (i.e. 5 in this case)?
as per the example you mentioned, you should log 5 km for the first time as that is the maximum distance covered in a tick and in the next tick, the log should be the total distance, which is 9 in this case (5+4=9).
just to make sure we understand this correctly. What should be logged for a distance of 13 km and how would the calculation work for this example? One tick would be equivalent to 4.3 km in this case.