## Creating a mathematical model to optimize gameplay in Pokemon GO

I know this sounds kind of silly, but it's been a while since I've done mathematical modeling and I wanted to challenge myself.

For those of you familiar with Pokemon GO, I'm basically trying to figure out how many caterpies, weedles, pidgeys, rattatas and poliwags I should transfer before I start mass evolving using a lucky egg, making sure that I optimize my strategy so I get the most evolutions throughout the lucky egg.

For those of you not familiar with Pokemon GO:

It's a game where you catch different creatures (pokemon) and sort of collect them in your storage. Pokemons have the ability to evolve to a new and better pokemon. In order to do that, they require candy (12 or 25 depending on the pokemon) and a good strategy to advance fast in the game is to use an item called a lucky egg that doubles your XP for 30 minutes and evolving as many pokemons as possible. I have a specific amount of candy for each of the pokemon (each type of pokemon eat their own type of candy only) and if I want more candy I can "transfer" a pokemon (let it go) which in turn will get me 1 extra candy however the pokemon will be gone for good.

Say I have 2 pidgeys and 11 pidgey candy. I can then transfer one of my pidgeys which in return will get me one extra pidgey candy, totalling 12 candies. Now I only have 1 pidgey available however I have enough pidgey candy to evolve this pokemon.

I hope all of that made sense. I'm willing to try explaining it again in case it wasn't clear.

My mathematical model looks like this so far:

Set:
"Pokemon" (the different types of pokemon I can evolve, this set is denoted as "p"): caterpie, weedle, pidgey, rattata, poliwag

Parameters:
C(p): This parameter includes the number of candy for each of the 5 pokemon that they have available
A(p): This parameter includes the amount of each pokemon in my storage

Variables:
e(p): Number of evolutions for each pokemon
t(p): Number of transfers for each pokemon
Z: The total number of evolutions

Equations:
Z = sum(p, e(p))
(All of the evolutions for each pokemon added together for the total number of evolutions)

t(p) =< A(p)
(Making sure that I don't transfer more of a specific pokemon than I have available in storage)

e(p) =e= A(p)-t(p)
(The number of evolutions for each pokemon is equal to the amount of pokemon I have available after I have transferred some of them for candy)

e(p) =e= (C(p)+t(p))/12
(It takes 12 candies for each pokemon to evolve, so the number of evolutions for a specific pokemon is defined by the number of candies I already had c(p) plus the optimal number of candies I've received from transferring t(p))

I previously mentioned that some pokemon require 12 candies to evolve and others require 25, but for now I'd like to keep it simple and assume all pokemon require 12. Then once the model is correct, I'll add that extra constraint.