## Movesets

A moveset is the combination of a quick move and a charged move. Each Pokémon has a moveset, that it uses while fighting.

### Fight simulation

In order to calculate the offensive and defensive power of each Pokémon's movesets, Goptimiz simulates all the possible fights in Pokémon Go.

The parameters of the fights and the formulas that allow to calculate the damage dealt by a Pokémon being known, each simulation is made with the maximum precision possible.

The formula used is the one which determines the damage dealt by a move. This is the formula :

`floor(0,5 × `

`Atk _{ attacker}`

`Def`×

_{ defender}`Power`×

_{ move}`STAB`×

`Efficiency`) + 1

All the possible figth are tested : each Pokémon species with each moveset are simulated, both in offense and in defense.

This represents **2,891,904 fight simulations** in total.

#### Fight parameters

The fight simulations are based on these parameters :

- Both opponents are level 40 with perfect IV.
- The fight lasts 99 seconds or until one of the Pokémon faint.
- The defending Pokémon has twice its normal HP.
- A Pokémon can store 100 energy.
- The defending Pokémon waits on average 2 seconds after using a move (between 1.5 and 2.5 seconds).
- The defending Pokémon starts the fight with a double quick move. The second quick move starts at 1 second (even if the first one is not finished yet) and doesn't count in the cooldowns of the defender.
- The attacking Pokémon dodges every charged move in the most optimized way possible. The damage of the charged move are reduced by 75%, but dodging takes 500ms.
- A Pokémon gains 0.5 energy for each HP it loses (rounded up).
- The defending Pokémon uses its charged move 50% of the time when it is available.

At the end of the fight, a score between 0% and 100% are given to each fighters using 3 variables :

`Duration`: the length of the fight in percentage (0 seconds = 0%, 99 seconds = 100%)`Dmg`: the damage dealt by the attacking Pokémon in percentage of the defender's max HP (0% if the defender didn't lose HP, 100% if it lost all its HP)._{ att}`Dmg`: the damage dealt by the defending Pokémon in percentage of the attacker's max HP._{ def}

The scores are calculated using these formulas :

- Attacking Pokémon :
`Dmg`+ (1 -_{ att}`Duration`) + 0.5 ×`Dmg`2.5_{ def} - Defending Pokémon :
`(1 -`

`Dmg`) +_{ att}`Duration`+ 0.5 ×`Dmg`2.5_{ def}

These formulas allow to take into account both the DPS of a Pokémon and its tankiness, while favourizing damage for the attacker and tankiness and fight duration for the defender.