-
Notifications
You must be signed in to change notification settings - Fork 7
v2.58.0 Simulated Annealing
New climb-algorithm simulated annealing
The algorithm is heavily stochastic, so don't expect the same results from runnning the same sim (except using same seeds). By now this algorithm is still being tested. I recommend to use 'endgame 2' and a trimmed/whitelisted inventory to speed it up. Also cross-check the result against a normal sim.
It takes(similar to climbex) three parameters:
- itterations (recommended: 500)
- initial 'temperature' (recommended: 100)
- exponential decrease of temperature (recommended: 0.001)
I am not sure about perfect initial parameters. This requires much experimenting due to the stochastics. Any sort of feedback is much appreciated.
TL;DR and less math
Checks which deck is the best with changing a single card (by itteration) and repeats this procedure with the first deck which improved the winrate.
Checks decks with changing a single card (choosen randomly). In the beginning the deck is used for further simulations even if the winrate is less than the initial deck. Later only better decks will be used. During the simulations TUO keeps track of the best perfoming deck.
TL;DR end
First we got a start-deck and a list of all possible cards (ownedcards.txt and funds).
TUO itterates through all possible cards and checks if replacing/adding one of the cards improves the winrate. When no card inreases the winrate TUO is done, else it will start again itterating through all possible cards.
There are two decks, one active deck which is changed+simmed and one to save the current best deck. TUO replaces/adds one of the possible cards in the active deck (choosen randomly). If this makes the winrate higher than the winrate of the best deck, it will become the new best deck. Based on the temperature-variable the active deck keeps the change and starts again from the beginning or tries a different change. The temperature-variable is decreased after each simulation by multiplication with a number < 1 (eg. 0.001).
The Temperature is used to calculate when to accept a deck for further simmulations (ie. to become the active deck). The probability of accepting the deck is calculated by this formula:
Basic situations would be:
- new_score > old_score: results in 100% acceptance
- new_score < old_score: results in a probability that decreases with a low temperature.
All in all the simulated annealing algorithm changes the deck heavily in the begining, but with a lower temperature it becomes similiar to a hill climb algorithm.
PS: Maybe i didn't explain something very well, just let me know where I've been unclear.