Code review comment for lp:~widelands-dev/widelands/ai-scheduler

Revision history for this message
TiborB (tiborb95) wrote :

Well it is not so simple.

I thought priority_queue + pairs would do the trick, but I realized that I dont need to remove and add items into queue, instead, all items would be stable, only second member of pair would be changing. And this is not possible with priority_queue.

But I could create pairs under name f.e. dueTimes as job:dueTime, and all these variables like next_economies_check_due_, would be replaced with 'dueTime.at(kCheckEconomies)' and the oldest item (=first member of a pair) in dueTime would be get with some primitive function "out of sight"

« Back to merge proposal