Back to Recipes Homepage
recipe picture
Recipe: GA Bands
4.75
Your rating: None Average: 4.8 (4 votes)
Used 1279 times with an average impact of -57194 points.

Profile

Name: GA Bands
ID: 5969
Created on: Tue, 07/20/2010 - 15:51
Updated on: Sun, 08/01/2010 - 22:18
Description:

A genetic algorithm on band sets.



Best For


Comments

Joined: 01/16/2010
Groups: None
Comments from the top of the script

Beware: This script uses global best. We have to use it.
Beware: Ugly code ahead. And I mean it!

A _primative_ genetic algorithm on bands.

Run this in the early to mid game, after you have
a general structure but long before you do your tweaks
to get the last few fractions of a point.

A brief overview:

1) [Optional] Create some bands that you think may help the fold.
The bands that you create will not be modified. Note, that the
bands that you create do not have to be anchored at both ends.

2) This script will fill in random bands to make a enuf bands so that
the genetic algorithm can run smoothly. These bands will be
anchored and they may be deleted by the script.

3) The script generates a "herd" of random critters, a critter is a
subset of all of the bands both user and script generated.

4) Score how well each critter (band subset) does.

5) Keep the best critters and kill the rest.

6) "Breed" the critters you kept by mixing roughly half of the bands
from the "mom" with half of the bands from the "dad" critter. Do
this until you have filled the herd back up.

7) Some critters are mutated during breeding. A mutation is
the replacement of one of the critter's bands with another
randomly chosen band.

8) If the scores aren't going anywhere after a few generations
start over with a new herd and a new set of script generated
bands, step 2.

9) Repeat from the scoring step (4) until the max generation is
reached or we can't lock the script generated bands.

This is a greedy GA, we keep score increases as soon as they occur.
If it's half way thru scoring a generation then so be it. This is why
we use relative improvements as a critter score.

Joined: 09/18/2009
Groups: SETI.Germany
:)

Interesting strategy!

Joined: 09/18/2009
Groups: SETI.Germany
Questions:

1.: May I fix a bug according to the selection?
Had a state where shake/wiggle coundln't be executed.
2.: May I change the code, that the script takes the user's applied bands ara threated as if they were generated by script?
3.: May I change breeding this way, that it doesn't take a random band but a band which is near the orignial one?

regards,
Alex

Joined: 01/16/2010
Groups: None
Please feel free to change it as you see fit

I submitted this as an idea generator so any changes that you make will reflect well on that. I have actually tried other variants and I'm going to try still more. Work is getting real crazy so I wanted to get the ideas other there before i got buried.

One thing I was thinking of doing was having a 2nd "chromosome" that freezes segments of the peptide. I haven't had time to work on that yet.

There's only so far that a random process like a GA will take us, that's a negative, but on the plus side when it works it works really really well. It is the only reason i have been able to FINALLY break into the top 10 a few times.

Joined: 09/18/2009
Groups: SETI.Germany
First...

I want to change the script, that it can also run not only with the very best puzzle state.
This means, I'll have to redirect "reset very best" to another slot.
So, do you use any saveslots except of recent best?

Joined: 09/18/2009
Groups: SETI.Germany
More...

I' don't think that the code is ugly.

Joined: 09/18/2009
Groups: SETI.Germany
More...

To keep away the locking problem and the very-best-use, I've written a script from scratch, and included freezing, too.

http://fold.it/portal/recipe/7812

But in opposite to breeding, I clone good critters (called cluster here) and modify them.
If I have time, I'll also include breeding.

Thanks for you inspiration!

Want to try?
Add to Cookbook!
To download recipes to your cookbook, you need to have the game client running.
Parent

none

Children
Authors
Sitemap

Developed by: UW Center for Game Science, UW Institute for Protein Design, Northeastern University, Vanderbilt University Meiler Lab, UC Davis
Supported by: DARPA, NSF, NIH, HHMI, Amazon, Microsoft, Adobe, RosettaCommons