daAlx1 has proposed merging lp:~amdat/widelands/HunterBug1407418 into
lp:widelands.
Requested reviews:
Widelands Developers (widelands-dev)
For more details, see:
https://code.launchpad.net/~amdat/widelands/HunterBug1407418/+merge/251689
solves Bug 1407418 Multiple Hunters hunt for same anima
I would like to keep this stuff separated.
You understand this is not a queue in a FIFO meaning. When actual job is
running it is not obvious which one will be run afterwards. Might be the same
job again. And it is not important to know order of subsequent jobs.
It is merely to provide equal c
Shorter code sounds good :)
--
https://code.launchpad.net/~widelands-dev/widelands/ai-scheduler/+merge/251327
Your team Widelands Developers is requested to review the proposed merge of
lp:~widelands-dev/widelands/ai-scheduler into lp:widelands.
___
Ma
When using simple std::pair, I would completely
eliminate the scheduler_review() function. It would made the code shorter and a
bunch of variables would disappear.
--
https://code.launchpad.net/~widelands-dev/widelands/ai-scheduler/+merge/251327
Your team Widelands Developers is requested to rev
Sounds more like a priority queue is needed
Also, widelands already has a command queue. How about just making a new
command for each action you want to perform and use this to be called back? You
would not need to reinvent the scheduling logic.
The class is Game::commandqueue or something alo
This is not ideal. These due times should be treated as variables - everytime
defined; with the queue there is a chance they can be not present in queue, or
put into queue multiple times.
Also sorting entire structure is a bit overkill - I just need to find the
oldest. No sense to re-sort struc
Set elements are pairs of . Just use the duetime as the key and the
job type as the value, and your entries will automatically be sorted by
duetime. Pop the next job off the front and insert a new check of the same job
type into the set with the new duetime and you will have everything you need.
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
I am going to investigate priority_queue :)
--
https://code.launchpad.net/~widelands-dev/widelands/ai-scheduler/+merge/251327
Your team Widelands Developers is requested to review the proposed merge of
lp:~widelands-dev/widelands/ai-scheduler into lp:widelands.
__
You are right the code is not the most elegant as it can be...
but sets are not fine, because we need something that takes pairs duetime:job,
and ideally that would re-order itself after each entry, so the the job with
oldest duetime is on the bottom or top
As for identical duetime - it wou
10 matches
Mail list logo