Imperial stockpile and production queue future simulation

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

Message
Author
Ophiuchus
Vacuum Dragon
Posts: 557
Joined: Tue Sep 30, 2014 10:01 am

Re: Why is production queue calculation not used for simulat

#16 Post by Ophiuchus » Wed May 31, 2017 4:43 pm

I tried to modify the dynamic simulator to accomodate imperial projects and made the coroutines for inter-supply-group issues work without bigger refactoring. But now I hit a wall / need to change my strategy.

Also inside of a single supply group one has to iterate first by turns, then by elements (at the moment it is the opposite way round).
The case when this happens is when there is an element which is fundable takes more than one turn to finish and there is more than one fundable element.

E.g.
There are two scouts in the queue, both are VIP (very imperial projects; i.e. may be funded by imperial stockpile). There is no other production in that group so only imperial stockpile can build these scouts. There are 14.4 PP in the imperial stockpile, a scout costs 12.4 PP
After first turn both scouts get funded each 6.2 PP.
After the second round the first scout gets funded 2 PP, the imperial stockpile is empty, no scout is built.

If iteration goes turns first, then elements I get a wrong result: the first scout gets completely built and the second gets funded 2 PP.


Instead of changing to iterating first over the supply groups, then the elements, then the turns;
I guess one could go the whole way and go iterate first over the turns, then the different supply groups, then over the elements. In that case i guess one wouldnt need the coroutines anymore.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Ophiuchus
Vacuum Dragon
Posts: 557
Joined: Tue Sep 30, 2014 10:01 am

Re: Imperial stockpile and production queue future simulatio

#17 Post by Ophiuchus » Fri Jun 09, 2017 8:36 am

@Dilvish are you actively working on refactoring the queue simulation? If not I probably could give it again a stab next week.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

User avatar
Dilvish
AI Lead, Programmer
Posts: 4720
Joined: Sat Sep 22, 2012 6:25 pm

Re: Imperial stockpile and production queue future simulatio

#18 Post by Dilvish » Sat Jun 10, 2017 6:01 pm

Ophiuchus wrote:@Dilvish are you actively working on refactoring the queue simulation? If not I probably could give it again a stab next week.
Yes I am , I'll try to get something posted today or tomorrow.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Ophiuchus
Vacuum Dragon
Posts: 557
Joined: Tue Sep 30, 2014 10:01 am

Re: Imperial stockpile and production queue future simulatio

#19 Post by Ophiuchus » Sat Jun 10, 2017 6:48 pm

Dilvish wrote:
Ophiuchus wrote:@Dilvish are you actively working on refactoring the queue simulation? If not I probably could give it again a stab next week.
Yes I am , I'll try to get something posted today or tomorrow.
Sorry, I am impatient. Very excited :)
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

User avatar
Dilvish
AI Lead, Programmer
Posts: 4720
Joined: Sat Sep 22, 2012 6:25 pm

Re: Imperial stockpile and production queue future simulatio

#20 Post by Dilvish » Tue Jun 13, 2017 6:13 am

Ophiuchus wrote:
Dilvish wrote:
Ophiuchus wrote:@Dilvish are you actively working on refactoring the queue simulation? If not I probably could give it again a stab next week.
Yes I am , I'll try to get something posted today or tomorrow.
Sorry, I am impatient. Very excited :)
an update for you: as you may have noticed, I discovered a bug in the current projections code and I'm waiting on finalizing and merging the bugfix PR I have up before I post the follow-on reorg PR. I think we'll probably have that done within the next day or so.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
Dilvish
AI Lead, Programmer
Posts: 4720
Joined: Sat Sep 22, 2012 6:25 pm

Re: Imperial stockpile and production queue future simulatio

#21 Post by Dilvish » Sat Aug 05, 2017 2:31 am

I just wanted to note here that I just rebased the Basic Imperial Stockpile PR in order to clean up some conflicts that had arisen with ongoing developments in master....

Ophiuchus, have you had a chance to work with this, has it proven to be a suitable base for the rest of the Imperial Stockpile features you were working on?
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Ophiuchus
Vacuum Dragon
Posts: 557
Joined: Tue Sep 30, 2014 10:01 am

Re: Imperial stockpile and production queue future simulatio

#22 Post by Ophiuchus » Sun Aug 06, 2017 4:02 pm

Dilvish wrote:I just wanted to note here that I just rebased the Basic Imperial Stockpile PR in order to clean up some conflicts that had arisen with ongoing developments in master....

Ophiuchus, have you had a chance to work with this, has it proven to be a suitable base for the rest of the Imperial Stockpile features you were working on?
I tried some laenfa game combining with sneaky species trait, but the effects for stealthy intermixed expansion were not strong enough.
The stockpile in that basic version mostly worked as a buffer for the capital supply group. (Which is fun, but I dont think AI can use it at the moment and doesnt help with peaceful expansion).

That was some weeks ago. If i remember correctly, the basic mechanism was working, so i probably could add my stuff on top of that.

I still think that restricting the extraction from the stockpile makes more sense than restricting the total stockpile amount.

Also your choice of giving the stockpile a location leads to extra questions which have not been answered yet. E.g. what happens if somebody relocates the capital? Is the stockpile automatically relocated?

Im not sure how to proceed though. I got a new job and not so much free time to spare. Your code is not really based on mine, so i have to reimplement. I'll give it a shot tonight.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Post Reply