As far as modifying its team, I think there are a number of interesting ways to do it. The way I'm working on, every time the genetic algorithm finishes a generation, the best team for that generation will become its new team, so it changes that way. You could also consider the team that just beat you, or consider counters to the thing that just beat you. There are a number of possible ways (and they all can be somewhat complicated. ^_^)
Ah, the elitist GA strategy, right? IIRC, this GA strategy has problems with local maximums/minimums. Which is why people prefer to add noise into the equation, even if it means losing the current best team in the short term. Which goes into why I'm saying inaccuracy in the evaluation formula can actually work to the GA's advantage.
There can be advantages to use "inaccurate" fitness functions. To take a dumb but obvious example, if you use a convex function which has only one maximum and that it's near the real function's global maximum, you'll find it a lot quicker. Some algorithms, such as EM (Expectation Maximization) use a cost function that's not exactly the same as the real function because it's easier to optimize (though in that case I think there's a guarantee about where the maximum will be so it converges to the right thing). But basically it can be a good idea to have a simpler, less accurate fitness function if it is smoother than the real one. In any case, if your function has a shitton of local maxima, it'll be much faster to get near the interesting regions if you use a more stable function at first.
If only we had that formula for pokemon teams :-p I certainly agree with your point, I'd just like to expand this assertion even further.
Lets assume we had a perfect team evaluation function, that can generate the exact ranking of all teams. (And if you are smart enough to think that there is no "best" team because of the inherent nature of rock-paper-scissors in this game, then pretend that I'm saying "best team generation strategy" instead. "Best team" is just much easier to say and conceptualize). It goes without saying that there are local maximums in pokemon team building strategies. Theme based teams
ARE by definition local maximums. Whether they are the global maximum or not is another difficult question :-p
But either way, it is obvious that:
1. The "perfect" evaluation function of Pokemon teams have a "shit-ton" of local maximums
2. As we still don't know what the best team is, the inaccurate "convex" that Brain theorized about, while a good example for his argument, is too difficult to find in Pokemon anyway.
3. This "perfect" pokemon team evaluator probably exists mathematically, but is beyond the skill of today's programmers and computers. But it exists.
So, lets first assume we have this perfect team evaluator. If we run a hill-climber on it, it will certainly reach one of these local maximums, be it a baton-pass team, or a rain dance team, or even the "standard" local maximum. (T-Tar, Skarm/Bliss, whatever)
To "knock it out" of this local maximum, you have to be non-elitist. You must be willing to sacrifice the current known maximum and start the search over again elsewhere. Because of this, we have probabilistic methods of finding children in GAs. But lets say we are just using a simple hill-climber :-p
Anyway, so we run the hill-climber, reach a local maximum, and how do we try to get out of this local maximum? The easiest way that I've found is to simply introduce "noise" into the evaluator. That is, just add a random number to the evaluation function. Make it imperfect. So lets say this perfect evaluator is a function that converts "pokemon teams" to "integers". All you would do to add noise is simply add a random integer to the evaluation function.
So if PE == perfect evaluator. And PE(team) == the team's "global ranking", to solve this problem of getting out of a local maximum, all you have to do is do PE(team) + random_int. The larger the random integer, the easier you get out of local maximums... but then again, it takes longer to find these maximums as well :-p
Furthermore, when a hill climber runs on a PE + noise, it has a much higher chance of staying at global maximums than at local maximums. Entropy works with the hill climber, not against it.
Now lets take a step back to reality. Where does this put us? It simply states that if we are going to use a hill-climbing procedure (which
MOST of these search methods really are, a GA is really just a massively parallel hill-climber), then a perfect evaluation function is not what we want. We want something close to the perfect evaluation function with a good bit of noise so that we can get knocked out of local maximums and find the true global maximum.
------------------
Okay, so now that we know that the evaluation function does not have to be perfect (it simply must be "close enough"), here is my plan if I were to create a GA team creator.
1. First, I program a very basic AI. A little more advanced than just randomly picking any move, but one that can see the benefits of rain-dance, spikes, and so forth. It doesn't have to look ahead further than 5 or so moves, and certainly doesn't have to beat a human.
2. Now, I create a set of random (legal) teams. To evaluate the teams, I sort them using insertion sort or something. The "compare" function is going to be an actual simulation of the game. AI vs AI using the two different teams. The winner is judged as "better". And of course, after insertion sort is run (or maybe shell-sort or something). Or maybe even just a tourney is run... the general thing happens. Cross teams, mutate teams, etc. etc.
3. Iterate for hundreds of thousands of loops.
4. Write a better AI, and write a simple hill climber based on random mutations. No crossover or anything, just change 1 to 4 aspects of the team, compare old vs new. Keep the better one. Iterate for thousands of generations till the team cannot be improved. The goal at this point is to find the local maximum. Hopefully, the GA found a solution close to the global maximum, and a specialized hill-climber will find the local maximum faster.
5. Profit!
KOs mean more than the percentage of damage dealt. But anyway, the problem is how far ahead it can see. Sometimes payoffs are distant, such as when you use Heal Bell/Aromatherapy or spiking moves. If status effects, spikes, etc are associated with a penalty, part of that foresight is immediately taken into account and the bot's play should improve.
Certainly. However, those issues can be simplified down to damage dealt later on in the min/max expansion. I'm probably beginning to stretch the heuristic here too far, but please correct me if you see things otherwise.
Heal Bell/Aromatherapy can be seen as preventing damage from the opponent. This would be caught in the "min" part of the min/max tree. Minimizing the % damage the opponent would do to you in a given turn in the future.
Spikes, inflicting status effects, and so forth can be seen as Maximizing the total damage dealt by us, or minimizing the total damage dealt by the opponent. As a stupid example, if we look ahead 5 turns, and we predict that the enemy will switch 4 times with our given plan,
EVEN if spikes are on the field, then that can be seen as increasing our % damage 5 turns later. If the opponent has a rapid spinner, he'd want to
MINIMIZE the % damage dealt to him by switching his rapid spinner first, and then switching 3 times. Or at least, that would be his plan.
Again, this is a heuristic. Just as chess computers heavily use a bad heuristic to play chess well, I'm sure we can use a bad heuristic to make Pokemon AIs play pokemon well. As stated before, many chess and checkers AIs simply count the number of pieces left on the board, and check for the possibility of forced checkmate. Similarly, all a Pokemon AI would have to do would count the total % damage dealt to the opponent, and check for the possibility of a perfect sweep.