Maximizing on speculated state and generation of 'optimal' solutions

Qualidus

New member
Is it possible to have the maximizer operate on a speculated state instead of my current one?

For example, if I simulate a state using whatif, is there a flag I can pass to the maximizer that maximizes that state instead of my current one?

I tried using the simulate parameter but that seems to just overwrite the speculative values rather than build on top of them.

Some background of what I'm trying to accomplish:

In response to my conjecture on the autoBasement thread, I'm trying to identify the cheapest combination of maximizer options that satisfies a given condition (value >= threshold).

My first approach was to try a dynamic programming type of solution that essentially built up every possible combination of effect using precomputed tables but this got unwieldy very quickly.

Pseudoalgorithm:
Initialize level 0 of the table with every maximizer option
To build level 1, iterate level 0 and add one of each option
To build level 2, iterate level 1 and add one of each option
etc.

For each solution that satisfied the goal, add it to a list of valid solutions but don't add it to that level (prevents adding extra items to already working solutions). I intended to find the cheapest cost from this list.

There's some logic to ensure duplicates don't get added; however, this still died around level 3 of iteration. Also, the worse case size of this table is 2^n with n being values in the 100's which is rather daunting.

My second approach was to try a greedy algorithm by sorting the maximizer results by cost/score then picking the most efficient one and calling the maximizer again (since the result may have changed based on the effects gained). However, when using speculation the results aren't really changing so the maximizer keeps suggesting the same thing each time.

To compensate, I currently iterate the maximizer results looking for an effect I haven't already flagged to acquire, simulate that effect with whatif and compare it to my goal.

This approach has the problem of not being able to accurately factor in the effects of things like the stabilizing oils (until they're whatif'd) and also doesn't really produce the 'cheapest' solution as the most efficient item could end up overbuffing by a margin that could have been satisfied by an overall cheaper item.

Does anyone have any thoughts on how best to approach this?

On the other hand, my solution may be good enough in that it only overbuffs by one item each time and I've likely spent more on this timewise, than the meat I would save with a truly optimal algorithm. Nonetheless, it served as an interesting exercise to try to optimize and solve so was hard for me to just let go.
 

Bale

Minion
Oooooooooo! That's kinda a neat idea. So you want to run a maximizer string postulating a set of effects added to your character instead of the set of effects that are actually active.

The maximizer won't do that, but it sounds like it would be worth making a feature request for a _spec keyword for the maximizer.

Maybe someone smarter than me will think of a good way to do it without that feature. My only idea is to brute force it as you suggest.
 

Fluxxdog

Active member
Edit: Re-read and didn't understand the first time. Just for reference, I'm leaving the link for the 5-parameter maximize() from the wiki. It wasn't added on the wiki before, but it is now. Check out this link to read up on it.
 
Last edited:

Bale

Minion
I don't think that is relevant to his question. He wants the maximizer to speculate with different givens. For instance, if he already has One Clear Eye, then he needs less item drop to maximize a drop rate so he does a "whatif up One Clear Eye" and then wants to run a maximzier string upon the _spec state. Do you know how whatif works? It's neat!
 

Fluxxdog

Active member
Yeah, yeah, I just read his post completely wrong at first. But it does lead to an idea... Meat-based maximizing, or assigning value to effects based on their costs, much like you do with your UR program. 10 turns of One Very Clear Eye gives +100% item drops which requires one cyclops eyedrops which sells in the mall for about 9800 currently. The breaks down to one turn of 1% item drop bonus costing 9.8 meat.

I know this is quite the tangent and I didn't even have to touch the sun in only one spot! But seriously, something to play with.
 

heeheehee

Developer
Staff member
y'know, I did basically this back when I made profit_fx (i.e. assigning values to each effect for how much profit it'd yield in a given zone), although I've been meaning to rewrite that from the ground up for years and years but never got around to it.
 
Top