Suppose a game where you are a miner that mines and stockpiles different gems each with a different value. Some are rare and you only have a small number of them (trade for a significant amount); some are common and you have a large amount (trade for much less). At the end of a mining day you can trade in gems but you are limited by your rank as a miner. A higher rank miner can turn in any combination of gems for a higher total daily profit.
You can pick however many to turn in at once, but turning in too many will "waste" profit and not count to daily profit or roll over; turning in too few will not reach the daily limit and you will end up wasting time. It could be said that the miner's goal is to reach a long term profit quota as quickly as possible.
Question: Is it possible to create a system or function of:
- Daily profit limit
- Long term profit goal (minus current profit?)
- current gem stockpile
to generate suggested trades on any given day and to minimize the amount of times the miner would have to go back to mining.
(for example: turning in many rare gems and a handful of common gems would easily get you daily profit but running out of rare gems would make it harder to reach the daily profit limit on subsequent days.
Or would waste profit or time if the number of traded gems and profit dont align with the daily profit limit)
Something like function(profit_needed,current_stockpile) = 3gem_rare_1 + 20gem_common_1 + ....
I tried approaching this as a global optimization problem with toolkits from scipy but given the nature of the problem and constraints I feel it may have something closer to a closed form or analytical solution.It also seems quite computationally expensive to figure this out by brute force through global optimization methods.