- AIVehicle.GetDirection(vehicle_id)
- Would be nice if AIVehicle.GetCurrentSpeed() reported zero when vehicles are stuck in queues.
- AIStation.IsCargoAccepted
An AI could get the direction of vehicles by storing their current location and then sleep for a few days and check again. However that is a quite expansive operation even if you store the position for all vehicles, sleep and then compare. It will still only work for vehicles that are not stuck in a queue etc.
My guess is that it is non-trival to make AIVehicle.GetCurrentSpeed() to return zero when vehicles don't move. Is there a constant for the maximum speed a vehicle that stands still can have? I've for now used 20% of the max speed as threshold for when vehicles stand still.
I've also found the need for AIStation.IsCargoAccepted but if
FS#3799 gets implemented, then AIStation.IsCargoAccepted is not needed. The pro of having this in the API is that if the acceptance pattern changes, then the AIs do not need to re-implement this function. On the other hand, as I wrote in a comment to that FS task, both my main AIs will probably break anyways if acceptance pattern changes as I'm sure I've hardcoded the 3,4,5 acceptance radius of stations at other places.