Elitist Jerks
Register
Blogs
Forums


Go Back   Elitist Jerks » Class Mechanics » Death Knights

Reply
 
LinkBack Thread Tools
Old 01/22/11, 4:08 PM   #1126
Jonneh
Glass Joe
 
Human Death Knight
 
Outland (EU)
More reforge strangeness;

Stat weights as the unholy thread (str 3.09, hit 0.78, haste 0.75, crit 0.62, mastery 0.24, expertise 0.66) hit cap of 961 and expertise cap of 781.

It tells me to leave my [Heart of Rage] unreforged, sacreficing 128 haste and my [Drape of Inimitable Fate] un-reforged as well, losing 50 expertise. Both of those together seem like a strange trade off, meaning you lose 128 haste (96 dps) and 50 expertise (33 dps) for 50 crit (31 dps) and 128 expertise (84.48 dps).

It seems to be trying too hard to get expertise for some reason. As I said in my post before, it leaves HoR un-reforged on some calculations, despite there never being a situation where you would want to do so.

Offline
Reply With Quote
Old 01/25/11, 10:54 AM   #1127
Zellski
Glass Joe
 
Troll Mage
 
Uther
Originally Posted by Afabar View Post
Regarding the optimizer, I think I need some help if some of you have good algorithm knowledge.
There's an enormous amount of existing research (and algorithms) in the domain of global optimization. I haven't kept up with research but I did delve into it at some depth in the mid-90's for my thesis. This is a rather specialized problem, but it'll still benefit from an algorithm that cleverly avoids the 99.9999% of the search space that is clearly not interesting.

Basic approaches are simulated annealing (good for discrete problems such as this), sequential quadratic programming (perhaps better for continuous functions), genetic (or other evolutionary) algorithms. There's a whole field of combinatorial optimization / integer programming that I don't know much about. It's possible those approaches would be better suited to this specific problem.

Genetic algorithms have the great virtue of being very easy to implement (you mostly just have to calculate a fitness function for every possible state, which I'm sure you already have). If they seem to work well, you're done. They are notoriously difficult to analyze -- but for a pragmatic task like this, maybe that doesn't matter.

Is the implementation in C#?

Offline
Reply With Quote
Old 01/25/11, 11:47 AM   #1128
rudy9443
Glass Joe
 
Orc Death Knight
 
Drenden
currently cannot access the link to get to the simulator

Offline
Reply With Quote
Old 01/25/11, 12:00 PM   #1129
Afabar
Don Flamenco
 
Draenei Death Knight
 
Chants Eternels (EU)
My host seems to have a problem, my guild forum is also unavailable, I hope it will soon be back.

By the way, I have updated the sim, in the optimizer part. This should avoid the unreforged item when there is only one stat on it that is Hit or Expertise.


Offline
Reply With Quote
Old 01/25/11, 12:06 PM   #1130
rudy9443
Glass Joe
 
Orc Death Knight
 
Drenden
what about uploading it to a free file hoster for the time being?

Offline
Reply With Quote
Old 01/25/11, 1:52 PM   #1131
Afabar
Don Flamenco
 
Draenei Death Knight
 
Chants Eternels (EU)
Server is back.
I could send you the Silverlight package, your computer wouldn't know what to do with that. It need at least a HTML page to load the plug-in. However when online, you can download it with a right click -> Install on computer.
The armory sync would not work and I'm not sure if it would detect a newer version have been uploaded.


Offline
Reply With Quote
Old 01/26/11, 11:58 PM   #1132
Saranrap
Banned
 
Saranrap
Human Death Knight
 
No WoW Account
Originally Posted by Afabar View Post
Thanks for the detailed report.
1) Regarding Armory, it's not possible as long as blizzard has not updated their new armory to support Xml export like the old one. For the time being, it's nearly impossible to read their bad formed html to export data so I use the old armory to extract character informations which do not have reforge data.
Ok for the reforge, but what about the stats being completely wrong in the stats summary after import?

Canada Offline
Reply With Quote
Old 01/27/11, 5:26 AM   #1133
Anathem
Glass Joe
 
Orc Death Knight
 
Blackrock
Originally Posted by Zellski View Post
There's an enormous amount of existing research (and algorithms) in the domain of global optimization. I haven't kept up with research but I did delve into it at some depth in the mid-90's for my thesis. This is a rather specialized problem, but it'll still benefit from an algorithm that cleverly avoids the 99.9999% of the search space that is clearly not interesting.

Basic approaches are simulated annealing (good for discrete problems such as this), sequential quadratic programming (perhaps better for continuous functions), genetic (or other evolutionary) algorithms. There's a whole field of combinatorial optimization / integer programming that I don't know much about. It's possible those approaches would be better suited to this specific problem.

Genetic algorithms have the great virtue of being very easy to implement (you mostly just have to calculate a fitness function for every possible state, which I'm sure you already have). If they seem to work well, you're done. They are notoriously difficult to analyze -- but for a pragmatic task like this, maybe that doesn't matter.

Is the implementation in C#?
Simulated annealing will only give you an approximation and quadratic programming won't work because the function to be optimized is not quadratic (it isn't linear either, although that's closer). You probably want nonlinear integer programming.

I've been doing some work on a gear/gem/reforging/enchant optimizer in my spare time. Let's take the very simple case of gear alone, ignoring all other factors (gemming and reforging are essentially the same optimization problems). The question we have to answer is this: given multiple item choices for each slot and a set of weights for each stat, can we find the optimal combination of items more efficiently than enumerating every possible item set and calculating the result of multiplying the stat weights by the sum of the stats on the items in each set? The number of item sets is the product of the number of item options you have for each slot, so it's easy to see that this blows up really quickly given sixteen slots and multiple items in each. Reforging is worse; with something like 6 reforging options per item, you're looking at something like 2.8 trillion reforging possibilities, were you to take a naive approach (although you can easily cut this down by not considering reforging into sub-optimal secondary stats excluding hit/exp).

If not for the hit and expertise caps, we absolutely could beat enumerating them all -- because the item values could then be calculated independently. You could write a greedy algorithm that simply takes the item with the highest calculated score for each slot. Unfortunately this won't work, because the hit and expertise caps mean that item values can't be calculated independent of their set.

I spent a little time investigating solving this with 1-0 integer programming, as it is an instance of the set partitioning problem (by definition NP-Hard), but I don't think it is possible now. Even construction the decision matrix governing item inclusion in sets requires enumerating all sets and storing them in memory... The problem appears intractable. In the short-term, I'm going to implement a naive exhaustive search, which will give an optimum result, if inefficiently.

If you continue with this, I would recommend using a solver library, rather than attempting to roll your own algorithm. Try Microsoft Solver Foundation - Express Edition - Home. Intuition tells me that this should be solved with an integer programming formulation similar to set partitioning, but I can't figure out how to make it work.

Something like:
Variables:
one variable per piece of gear, takes 0-1 value to indicate its presence in the set with the multiplier being the calculated value of that piece of gear (in a minimization problem, this would be the cost)

Constraints: 16, one for each slot (input matrix)
for each gear slot:
(x1 xor x2 xor x3 xor ... xor xn) to ensure we select one and only one piece of gear per slot (rings and trinkets are treated as one slot since we do that combination before optimization)

Last edited by Anathem : 01/27/11 at 5:47 AM.

Offline
Reply With Quote
Old 01/27/11, 5:46 AM   #1134
Anathem
Glass Joe
 
Orc Death Knight
 
Blackrock
Originally Posted by Afabar View Post
Regarding the optimizer, I think I need some help if some of you have good algorithm knowledge.
Basically, what it does:
It create for each slot, 3 variations of an item. One with hit reforge, one with expertise reforge and the last one with the best secondary stat. then it create all possible assembly. The issue is that for 17 slot it generate 3^17 or 129,140,163 possibility and without memory management it explode.
I have 2 possibilities, reduce the memory size of all my objects or find an algorithm that would detect which pieces are not worth to be calculated. This is for the later I need some ideas.
Ah, you only need to store in-memory the best reforge set you've seen so far and the replace it when you get a better one. Don't generate all the reforging options sets and then make another pass over all of them to find the best one -- instead get the score of each item set as you create it, and dispose the object immediately unless it is better than your previous best. This way you only need to have memory allocated for two item sets at any time; the best one you've seen previously and the one you just generated.

The time complexity is still O(numReforgeOptionPerPiece ^ numPiecesReforged), but space complexity is constant.

Edit: It has occurred to me that 129 million sets might be too many to evaluate in a reasonable amount of time anyway. I'll implement this tomorrow night and let you know what kind of running time I get.

If anyone has experience with integer programming problems or optimization problems in general, send me a PM. I want to talk to you.

Last edited by Anathem : 01/27/11 at 6:02 AM.

Offline
Reply With Quote
Old 01/27/11, 10:42 AM   #1135
JMBattista
Glass Joe
 
Blood Elf Death Knight
 
Hydraxis
So, I am getting sim hits of ~ 17300, but with +/- 1700 error bars, changing it to a longer running sim has the error bars growing up towards 2500.

Any suggestions on getting the error bars to be less than 24 times the size of the changes I see when swapping out single pieces of gear?

Offline
Reply With Quote
Old 01/27/11, 11:11 AM   #1136
JMBattista
Glass Joe
 
Blood Elf Death Knight
 
Hydraxis
On the reforging, this problem is as Anathem pointed out.... the *optimal* reforge calculation will always run in non-polynomial time - ie take effing forever. If someone comes up with an efficient solution to finding the optimal setup... please let me know so I can jack your work, publish a paper and retire o0.

You have two choices:
1 - find the optimal setup, this *will* be an exhaustive search, you can try to optimize it... but its still exhaustive
2 - accept an approximate solution, that may or may not be identical to the optimal solution (local vs. global maxima).

Since our dataspace is finite, you *can* pre-compute optimal values for various gear combinations and store them... even then it will be huge unless you place limitations on storing, ie - only plate gear within 1 tier jump or something or you'll just explode the memory cost in a nasty nasty way.

Offline
Reply With Quote
Old 01/27/11, 12:14 PM   #1137
Martialbob
Glass Joe
 
Worgen Death Knight
 
Cenarius
What is the current big O value of the algorithm that runs the optimization?

Offline
Reply With Quote
Old 01/27/11, 12:28 PM   #1138
Anathem
Glass Joe
 
Orc Death Knight
 
Blackrock
delete

Last edited by Anathem : 01/27/11 at 5:31 PM. Reason: Not necessary.

Offline
Reply With Quote
Old 01/27/11, 12:39 PM   #1139
Martialbob
Glass Joe
 
Worgen Death Knight
 
Cenarius
I think we can improve on this by never reforging into hit or exp when the value on the current gearset exceeds the cap already. Trimming optimizations like this are probably the best we can do.
The problem with this though is most times the most optimal reforge will come from getting away from hit on some items, and going towards hit on others. So the reforging towards hit cannot be removed.

Last edited by Martialbob : 01/27/11 at 12:48 PM.

Offline
Reply With Quote
Old 01/27/11, 12:47 PM   #1140
Anathem
Glass Joe
 
Orc Death Knight
 
Blackrock
delete

Last edited by Anathem : 01/27/11 at 5:30 PM. Reason: unnecessary given later post synthesizing content

Offline
Reply With Quote
Reply

Go Back   Elitist Jerks » Class Mechanics » Death Knights

Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
WoW Simulator - What do you want? Ullas User Interface and AddOns 60 08/30/11 10:23 AM
EnhSim, DPS simulator tukez Shamans 2763 11/30/09 11:45 AM
DPS Simulator Grim13 Warriors 133 11/12/08 7:20 AM
[Mage] DPS Simulator zurmagus Class Mechanics 41 11/08/07 9:11 PM