Login  •  Register

Go to RichardDawkins.net | Store | OUT Campaign | Disclaimer | Search the Forum | E-Mail Forum Admin

Computer Programmer Wanted: Custom verson of "Weasel"

Life the universe and everything, for topics that don't fit in any of the other forum sections.

Moderators: Randy Ping, Fraser, THWOTH

Computer Programmer Wanted: Custom verson of "Weasel"

Postby OHSU » Tue Nov 03, 2009 4:43 pm

I would like to pay someone to help me create a custom version of Dawkins' "weasel" program. I don't want to have to take out another morgage on my house to pay for this project, but I would like for it to reasonably approximate the principles of seleciton and look polished.

If you would like to take up the project, or if you know anyone who would like to, please contact me.
"Yes we have a soul; but it's made of lots of tiny robots." -- Daniel Dennett

"Successions of anecdotes selected to fit a story do not constitute evidence." -- N.N. Taleb

"For every problem, there is a solution that is simple, neat, and wrong." -- H.L. Mencken
User avatar
OHSU
Forum Member
 
Posts: 4933
Joined: Sun Oct 07, 2007 8:13 pm
Location: Tucson, Arizona, USA

Re: Computer Programmer Wanted: Custom verson of "Weasel"

Postby camoguard » Tue Nov 03, 2009 7:56 pm

I can do it. It doesn't look very tough. Give me a couple days to spec it out for sure since I'm less than part-timing on it.
Image
User avatar
camoguard
Forum Member
 
Posts: 387
Joined: Sun Mar 02, 2008 1:07 pm
Location: Charlottesville, VA

Re: Computer Programmer Wanted: Custom verson of "Weasel"

Postby OHSU » Tue Nov 03, 2009 8:01 pm

Thanks!!

I have some specific ideas of what I'd like it to look like and how I'd like it to work. My specific requests will probably triple or quadruple the amount of work required. So, you should probably take whatever time you estimate you'll spend on the project and multiply it by tree or four.
"Yes we have a soul; but it's made of lots of tiny robots." -- Daniel Dennett

"Successions of anecdotes selected to fit a story do not constitute evidence." -- N.N. Taleb

"For every problem, there is a solution that is simple, neat, and wrong." -- H.L. Mencken
User avatar
OHSU
Forum Member
 
Posts: 4933
Joined: Sun Oct 07, 2007 8:13 pm
Location: Tucson, Arizona, USA

Re: Computer Programmer Wanted: Custom verson of "Weasel"

Postby camoguard » Tue Nov 03, 2009 8:26 pm

1. Start with a random string of 28 characters
2. Copy this string 100 times, with a 5% chance per character of that character being replaced with a random character
3. Compare each new string with the target "METHINKS IT IS LIKE A WEASEL", and give each a score
4. If any of the new strings has a perfect score, halt
5. Otherwise, take the highest scoring string, and go to step 2

There's the algorithm from Wikipedia. Your variables are the eligible characters, the number of copies, the percentage of chance a character is replaced with a random character, the scoring mechanism and the target string. What do you have in mind?
Image
User avatar
camoguard
Forum Member
 
Posts: 387
Joined: Sun Mar 02, 2008 1:07 pm
Location: Charlottesville, VA

Re: Computer Programmer Wanted: Custom verson of "Weasel"

Postby OHSU » Tue Nov 03, 2009 8:53 pm

camoguard wrote:1. Start with a random string of 28 characters
2. Copy this string 100 times, with a 5% chance per character of that character being replaced with a random character
3. Compare each new string with the target "METHINKS IT IS LIKE A WEASEL", and give each a score
4. If any of the new strings has a perfect score, halt
5. Otherwise, take the highest scoring string, and go to step 2

There's the algorithm from Wikipedia. Your variables are the eligible characters, the number of copies, the percentage of chance a character is replaced with a random character, the scoring mechanism and the target string. What do you have in mind?


I'd like to use the program as a component of my daughter's science fair project, so I'd like for it to be user friendly and polished-looking. I'd also like to be able to easily change the the variables to demonstrate how the process changes when the variables are tinkered with.

So, this is what I envision:

1. An applet (or whatever it's called) with several boxes
2. In one box you can type your target sentence, whatever you want it to be.
3. In one box you can vary the mutation rate, or the likelihood that any given character will mutate.
4. In one box you can vary the number of offspring.
5. In one box you can vary the generation time. (Basically, be able to make it take longer between generations so an observer can watch the process unfold, or speed it up so you can get results quickly.)

and a couple more boxes....

6. One showing a continually mutating string that is NOT undergoing selection. Of course, this string will not get any closer to the target sentence, remaining a random jumble of letters. This will visually demonstrate that random variation without selection doesn't result in adaptation (or in this case, progression toward the target).
7. One counting the number of generations that have elapsed.

It should also have a START button, a PAUSE button, and a RESET button.

I might want to tinker a bit with it beyond that, but I think that would be an excellent starting point.

If you want to see a couple variations of the program, a couple members posted their versions here:

http://forum.richarddawkins.net/viewtopic.php?f=4&t=91554&start=0

I dowloaded and ran my_wan's program, and it works great, although it's not quite as user-friendly and polished-looking as I'd like. If you basically took his program and added the buttons and boxes I've suggested, I think it would be pretty close to perfect.

Here's his program:

Code: Select all
Opt("MustDeclareVars",1)
Opt("GUIOnEventMode",1)
Opt("TrayAutoPause",0)
Dim $weasel, $genes, $children, $mutation, $parent, $fitness, $speed, $wLen, $gLen, $cnt, $lbla, $lblb, $tmp
; //Settings//
$weasel="Me thinks it is like a weasel." ; Make this whatever sentence (species) you want.
$genes="'!?. ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" ; Alphabet (genes) including puctuations and spaces.
$children=5 ; Change this to how many children (litter size) each surviving weasel will have.
$mutation=20 ; Odds of mutation per gene = 1 in 'mutation #'. Some weasels may not have any mutations, some several.
$speed=0 ; Slow evolution so you can watch the output easier. 0 = no slowdown, 1000 = 1 second per generation
; //End Settings//

; Let's make a settings file to change settings in the compiled version, NOT required.
; Can either be changed above, as defaults, or changed in Weasel.ini in the same folder as Weasel.au3 or Weasel.exe.
$weasel=IniRead(@ScriptDir&"\Weasel.ini","Settings","weasel",$weasel)
$genes=IniRead(@ScriptDir&"\Weasel.ini","Settings","genes",$genes)
$children=IniRead(@ScriptDir&"\Weasel.ini","Settings","children",$children)
$mutation=IniRead(@ScriptDir&"\Weasel.ini","Settings","mutation",$mutation)
$speed=IniRead(@ScriptDir&"\Weasel.ini","Settings","speed",$speed)

$wLen=StringLen($weasel)
$gLen=StringLen($genes)
$genes=StringSplit($genes,"")
For $i=1 To $wLen ; Create a random first weasel ancestor to evolve
   $parent=$parent & $genes[Random(1,$genes[0],1)]
Next

; //Make GUI window//
GuiCreate("Weasel Evolution",500,102,-1,-1,-1)
GUISetOnEvent(-3,"Xit")
GUICtrlCreateLabel($weasel,0,0,500,20,0x1000)
$lbla=GUICtrlCreateLabel($parent,0,30,500,20,0x1000)
$lblb=GUICtrlCreateLabel($parent,0,60,500,20,0x1000)
GUICtrlCreateButton("Breed",195,82,50,20,0x1000)
GUICtrlSetOnEvent(-1,"breed")
GUICtrlCreateButton("Kill",255,82,50,20,0x1000)
GUICtrlSetOnEvent(-1,"Xit")
GuiSetState()
; //GUI done//

$weasel=StringSplit($weasel,"") ; Get whole weasels genetic code for mutations. Each gene mutation can be good, bad, or neutral.
$parent=StringSplit($parent,"") ; Get the first ancestor parent genetic code.
$fitness=0 ; Starting fitness
Sleep(2000000000) ; Will live approximately 23 days unless killed.

Func breed()
   While $fitness < $wLen
      $tmp=kits()
      If IsArray($tmp) Then $parent=$tmp ; Yippie!!! The little kit escaped the big bad wolf!
      updGUI()
      Sleep($speed)
   WEnd
updGUI(1)
EndFunc

Func kits() ; Have # of random children and send back survivor.
   Local $child, $fit=0, $kit ; Parent got pregnant.
   For $i = 1 To $children ; A litter of this many little weasel pups is on the way.
      $kit=$parent; Copy parent, random mutations to be added next.
      For $j=1 To $wLen ; Add some random mutations to the poor little weasel kit.
         If Random(1,$mutation,1) = 1 Then ; Did we get a mutation on this gene, regardless of good, bad, or neutral?
         $kit[$j]=$genes[Random(1,$genes[0],1)] ; If mutated, randomly select any gene (alphabet) to mutate to.
         EndIf
      Next ; Ouch, labor pains! I hope the next one don't hurt so much.
         $tmp=0
      For $j=1 To $kit[0] ; Will the poor fellow live, or be diseased, starve, or get eaten by the big bad wolve?
         If $kit[$j]==$weasel[$j] Then $tmp=$tmp+1 ; How fit is our cute littel weasel?
      Next
         If $tmp >= $fitness Then ; I live! I live! As long as my siblings don't take all the milk or the wolf get me :(
            $fitness=$tmp
            $child=$kit
         EndIf
   Next ; Ouch! Another one on the way...
   Return $child ; I got my milk! Now I go out and have my own pups.
EndFunc

Func Xit()
   MsgBox(8240,"Weasel","Please no! I don't want to die!!!")
   Exit
EndFunc

Func updGUI($a=0)
   Local $t
   $cnt=$cnt+1
   For $i=1 To $wLen
      $t=$t&$parent[$i]
   Next
   GUICtrlSetData($lbla, $t)
   $t="Fitness = "&$fitness&" Generation = "&$cnt
   If $a Then $t=$t&" >Finished"
   GUICtrlSetData($lblb,$t)
EndFunc



*EDIT* Also, I like the fact that he has used a larger number of characters than the original program, the letters are case sensitive, and string length is a mutable variable.

Also, if I understand correctly, in my_wan's version, it's possible for characters to mutate away from the target. I think that element is important. "Locking in" characters once they've hit the target gives unrealistic results.
Last edited by OHSU on Tue Nov 03, 2009 9:14 pm, edited 4 times in total.
"Yes we have a soul; but it's made of lots of tiny robots." -- Daniel Dennett

"Successions of anecdotes selected to fit a story do not constitute evidence." -- N.N. Taleb

"For every problem, there is a solution that is simple, neat, and wrong." -- H.L. Mencken
User avatar
OHSU
Forum Member
 
Posts: 4933
Joined: Sun Oct 07, 2007 8:13 pm
Location: Tucson, Arizona, USA

Re: Computer Programmer Wanted: Custom verson of "Weasel"

Postby pcCoder » Tue Nov 03, 2009 9:01 pm

Code: Select all
import random

_target = list('METHINKS IT IS LIKE A WEASEL')
_source = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ ')

def mutate(input, prob=5, variance=5, lock=False):
    results = []
    for i in range(100):
        result = list(input)
        for (i, v) in enumerate(result):
            if lock and v == _target[i]:
                continue
            if random.randint(1, 100) <= prob:
                index = _source.index(v)
                index = (index + random.randint(-variance, variance)) % len(_source)
                result[i] = _source[index]
        results.append(result)
    return results

def score(input):
    assert(len(input) == len(_target))
    score = 0

    for (t1, t2) in zip(input, _target):
        i1 = _source.index(t1)
        i2 = _source.index(t2)
        diff = abs(i1 - i2)
        score += diff
    return score

# Start
input = [random.choice(_source) for i in range(len(_target))]
gen = 0

found = False
while not found:
    mutants = mutate(input)
    # mutants = mutate(input, lock=True)
    best_score = None
    best_index = None

    for (i, v) in enumerate(mutants):
        s = score(v)
        if best_score is None or s < best_score:
            best_score = s
            best_index = i

    input = mutants[best_index]
    gen += 1

    print('Generation: ' + str(gen))
    print('Best: ' + ''.join(input))

    if input == _target:
        break


Edit, added locking support
pcCoder
Forum Member
 
Posts: 1520
Joined: Wed Feb 11, 2009 1:44 am
Location: USA

Re: Computer Programmer Wanted: Custom verson of "Weasel"

Postby McSwan » Wed Nov 04, 2009 7:37 am

Hi,

I did a masters degree in Code Generation Design.

Instead of using "METHINKS IT IS LIKE A WEASEL" I attempted to generate valid c++ programs, like "int main(){}" (simplest possible c++ program) and tested it's accuracy through a compiler (experiment 3).

http://codegenerationdesign.webs.com/index.htm ( There are videos of the experiments)

Experiment 3 is probably closest to what your looking for, it uses a genetic algorithm to form the simplest c++ program.

Experiment 6
"A program that can learn it's own code, and change itself to what the user wants, provided what the user wants is a combination of what it knows."

Is also interesting in the sense that it is proof of the future of evolution, ie once we know how to program DNA, we'd be able to write our own life forms.

ie Evolutionary changes in the future will likely be instantaneous due to Genetic engineering. After testing itself, the program re-wites itself to the ideal life-form in a single iteration.
McSwan
Newbie
 
Posts: 77
Joined: Wed Jun 18, 2008 12:24 am

Re: Computer Programmer Wanted: Custom verson of "Weasel"

Postby camoguard » Wed Nov 04, 2009 2:57 pm

That's actually really cool McSwan.

OHSU, what is the time frame between now and the science fair?
Image
User avatar
camoguard
Forum Member
 
Posts: 387
Joined: Sun Mar 02, 2008 1:07 pm
Location: Charlottesville, VA

Re: Computer Programmer Wanted: Custom verson of "Weasel"

Postby OHSU » Wed Nov 04, 2009 3:20 pm

McSwan wrote:Hi,

I did a masters degree in Code Generation Design.

Instead of using "METHINKS IT IS LIKE A WEASEL" I attempted to generate valid c++ programs, like "int main(){}" (simplest possible c++ program) and tested it's accuracy through a compiler (experiment 3).

http://codegenerationdesign.webs.com/index.htm ( There are videos of the experiments)

Experiment 3 is probably closest to what your looking for, it uses a genetic algorithm to form the simplest c++ program.

Experiment 6
"A program that can learn it's own code, and change itself to what the user wants, provided what the user wants is a combination of what it knows."

Is also interesting in the sense that it is proof of the future of evolution, ie once we know how to program DNA, we'd be able to write our own life forms.

ie Evolutionary changes in the future will likely be instantaneous due to Genetic engineering. After testing itself, the program re-wites itself to the ideal life-form in a single iteration.


Absolutely astounding. Thank you for sharing. We'll probably try moving toward something like this as she gets older and we expand the project.
"Yes we have a soul; but it's made of lots of tiny robots." -- Daniel Dennett

"Successions of anecdotes selected to fit a story do not constitute evidence." -- N.N. Taleb

"For every problem, there is a solution that is simple, neat, and wrong." -- H.L. Mencken
User avatar
OHSU
Forum Member
 
Posts: 4933
Joined: Sun Oct 07, 2007 8:13 pm
Location: Tucson, Arizona, USA

Re: Computer Programmer Wanted: Custom verson of "Weasel"

Postby OHSU » Wed Nov 04, 2009 3:21 pm

camoguard wrote:That's actually really cool McSwan.

OHSU, what is the time frame between now and the science fair?


I'd love to have the program done in a week or two. My daugther and I need to run various experiments using the software before the fair, write up the outcome of the experiments, create graphs and text, etc. The completion of this program is just the first step in the project.

NOTE:

I've had people PMing me asking if I think it is ethical to have someone else write the program for my daughter's science fair project. Let me answer that here so nobody else need send a PM. The project isn't about computer programming. It's about natural selection. She needs a program that simulates some basic principles of natural selection and permits her to hypothesize about some aspect of selection and test the hypothesis, but it doesn't matter where she gets the program. There is nothing whatsoever unethical about having someone write a program for her.

Now, if she were doing her project in the field of computer science and claiming that she had written the program, that would be a different matter.
"Yes we have a soul; but it's made of lots of tiny robots." -- Daniel Dennett

"Successions of anecdotes selected to fit a story do not constitute evidence." -- N.N. Taleb

"For every problem, there is a solution that is simple, neat, and wrong." -- H.L. Mencken
User avatar
OHSU
Forum Member
 
Posts: 4933
Joined: Sun Oct 07, 2007 8:13 pm
Location: Tucson, Arizona, USA

Re: Computer Programmer Wanted: Custom verson of "Weasel"

Postby lordshipmayhem » Wed Nov 04, 2009 3:44 pm

I'd head off to the nearest Linux Users' Group, you should be able to Google one close to you and contact them through their website. They tend to be greybearded old programmers with a wealth of contacts. In other words if nobody there can help you, chances are they know someone who can.

(When I first went to a local LUG meeting, I was expecting a ton of eager youngsters in their 20's. I turned out to be the youngest one there, most of the others being eager "youngsters" in their 50's and 60's.)
There are 10 kinds of people in the world - those who understand binary, and those who don't
User avatar
lordshipmayhem
Forum Member
 
Posts: 241
Joined: Fri Mar 06, 2009 11:47 pm

Re: Computer Programmer Wanted: Custom verson of "Weasel"

Postby OHSU » Wed Nov 04, 2009 4:44 pm

lordshipmayhem wrote:I'd head off to the nearest Linux Users' Group, you should be able to Google one close to you and contact them through their website. They tend to be greybearded old programmers with a wealth of contacts. In other words if nobody there can help you, chances are they know someone who can.

(When I first went to a local LUG meeting, I was expecting a ton of eager youngsters in their 20's. I turned out to be the youngest one there, most of the others being eager "youngsters" in their 50's and 60's.)


Could they write a Windows app for me?
"Yes we have a soul; but it's made of lots of tiny robots." -- Daniel Dennett

"Successions of anecdotes selected to fit a story do not constitute evidence." -- N.N. Taleb

"For every problem, there is a solution that is simple, neat, and wrong." -- H.L. Mencken
User avatar
OHSU
Forum Member
 
Posts: 4933
Joined: Sun Oct 07, 2007 8:13 pm
Location: Tucson, Arizona, USA

Re: Computer Programmer Wanted: Custom verson of "Weasel"

Postby NineBerry » Wed Nov 04, 2009 8:48 pm

Do you have any preferences regarding the programming language used?
There must be security for all — or no one is secure... This does not mean giving up any freedom except the freedom to act irresponsibly.
User avatar
NineBerry
Forum Member
 
Posts: 10485
Joined: Sat Oct 20, 2007 10:53 pm
Location: Karlsruhe, nSk state

Re: Computer Programmer Wanted: Custom verson of "Weasel"

Postby pcCoder » Wed Nov 04, 2009 9:09 pm

OHSU wrote:Could they write a Windows app for me?


What language would be used? With Python a simple Python/wxWidgets app is quite easy to make. A C++ app could also be made with a little more work. With Python, you would have to download the Python and wxPython installers, but it would be very easy to change the code without recompiling it. With C++ statically linked the only thing needed would be the executable, but it would have to be recompiled after changes, which would still require downloading a compiler (MinGW) and the GUI toolset (wxWidgets) if not coding it directly in the Windows API. You could also have one made in HTML/Javascript where it could simply be loaded in a web browser, such as this: http://pastebin.com/f54d05a8e

Edited: html example
pcCoder
Forum Member
 
Posts: 1520
Joined: Wed Feb 11, 2009 1:44 am
Location: USA

Re: Computer Programmer Wanted: Custom verson of "Weasel"

Postby OHSU » Wed Nov 04, 2009 11:34 pm

pcCoder wrote:
OHSU wrote:Could they write a Windows app for me?


What language would be used? With Python a simple Python/wxWidgets app is quite easy to make. A C++ app could also be made with a little more work. With Python, you would have to download the Python and wxPython installers, but it would be very easy to change the code without recompiling it. With C++ statically linked the only thing needed would be the executable, but it would have to be recompiled after changes, which would still require downloading a compiler (MinGW) and the GUI toolset (wxWidgets) if not coding it directly in the Windows API. You could also have one made in HTML/Javascript where it could simply be loaded in a web browser, such as this: http://pastebin.com/f54d05a8e

Edited: html example


I have only the barest clue what any of that meant.

I would like to be able to click on an icon and have a window (or applet or whatever) open with the boxes in it that I described above. I don't care what language it's written in or how it's made, as long as I can click on the icon and the program appears and functions the way i've described. I suppose it would also be nice to be able to tinker with the source code without too much fuss.

Since I'm almost entirely illiterate with regard to computer programming, I can't really say more than that.
"Yes we have a soul; but it's made of lots of tiny robots." -- Daniel Dennett

"Successions of anecdotes selected to fit a story do not constitute evidence." -- N.N. Taleb

"For every problem, there is a solution that is simple, neat, and wrong." -- H.L. Mencken
User avatar
OHSU
Forum Member
 
Posts: 4933
Joined: Sun Oct 07, 2007 8:13 pm
Location: Tucson, Arizona, USA

Re: Computer Programmer Wanted: Custom verson of "Weasel"

Postby NineBerry » Thu Nov 05, 2009 1:48 am

So, I made a quick program.

You can download it under http://www.neunbeere.de/ExtRef/Weasel.zip.

The zip contains the actual program, which is "weasel.exe". You can just run that on any Windows.

It also contains the source code in the "source" sub-folder if you want to look at it or change it.

The program is written in Lazarus, which is a object pascal based development environment. Lazarus is also available for Linux and Mac OS X. So, you can also compile it for that operating systems and run the program on Linux or Mac OS X.

Lazarus can be downloaded for free at http://www.lazarus.freepascal.org/

Here is how the program looks (Click for full image):
Image
There must be security for all — or no one is secure... This does not mean giving up any freedom except the freedom to act irresponsibly.
User avatar
NineBerry
Forum Member
 
Posts: 10485
Joined: Sat Oct 20, 2007 10:53 pm
Location: Karlsruhe, nSk state

Re: Computer Programmer Wanted: Custom verson of "Weasel"

Postby OHSU » Thu Nov 05, 2009 2:39 am

THANK YOU SO MUCH!!! I haven't tried it out yet, but it looks awesome!!!! It has EVERYTHING I was thinking of, plus some features that hadn't occurred to me! I particularly like that you can input the starting text.

Very nice work!! We definitely have a science fair winner here!!

We would like to credit you with the creation of this program in the write-up for her project. Would you mind PMing me your name and some information about you, such as your employment, credentials, etc? Alternatively, I could refer to your RD.net username. That might be cool, too.

If there's anything in the world I can do for you, please just ask.
"Yes we have a soul; but it's made of lots of tiny robots." -- Daniel Dennett

"Successions of anecdotes selected to fit a story do not constitute evidence." -- N.N. Taleb

"For every problem, there is a solution that is simple, neat, and wrong." -- H.L. Mencken
User avatar
OHSU
Forum Member
 
Posts: 4933
Joined: Sun Oct 07, 2007 8:13 pm
Location: Tucson, Arizona, USA

Re: Computer Programmer Wanted: Custom verson of "Weasel"

Postby NineBerry » Thu Nov 05, 2009 2:56 am

Hey, I am just NineBerry, 31 year old software engineer from Germany. There is not much more to know :-D

If you want any minor changes, just tell me. Minor changes should be done easily.
There must be security for all — or no one is secure... This does not mean giving up any freedom except the freedom to act irresponsibly.
User avatar
NineBerry
Forum Member
 
Posts: 10485
Joined: Sat Oct 20, 2007 10:53 pm
Location: Karlsruhe, nSk state

Re: Computer Programmer Wanted: Custom verson of "Weasel"

Postby McSwan » Thu Nov 05, 2009 3:08 am

I found this on the web, the weasel program that you can run from the web site.

http://www.antievolution.org/cs/dawkins_weasel

The irony is that it is on a site called antievolution though ;)

* edit * Nineberry's program looks nice!
McSwan
Newbie
 
Posts: 77
Joined: Wed Jun 18, 2008 12:24 am

Re: Computer Programmer Wanted: Custom verson of "Weasel"

Postby OHSU » Thu Nov 05, 2009 3:22 am

NineBerry wrote:Hey, I am just NineBerry, 31 year old software engineer from Germany. There is not much more to know.


If that's how you'd like to be cited, I think that's great! I think it would be cool to cite someone by their RD.net username.

I've had a chance to run the program several times, and I think it's GREAT. I like several of the features you've added. For example, I really like being able to leave the program running AFTER the target sentence has been reached. It is interesting to see mutations pop up even after the target has been achieved. I like being able to enter the starting text. I LOVE watching the starting text degrade in the bottom box in the absence of selection. THAT KICKS BUTT!! It's an awesome visual representation of the effect of mutation without selection.

I have some questions, though. What, exactly, do the "skip" buttons do? What does it mean to "skip 100 generations"? What effect does that have on the process?
"Yes we have a soul; but it's made of lots of tiny robots." -- Daniel Dennett

"Successions of anecdotes selected to fit a story do not constitute evidence." -- N.N. Taleb

"For every problem, there is a solution that is simple, neat, and wrong." -- H.L. Mencken
User avatar
OHSU
Forum Member
 
Posts: 4933
Joined: Sun Oct 07, 2007 8:13 pm
Location: Tucson, Arizona, USA

Re: Computer Programmer Wanted: Custom verson of "Weasel"

Postby lordshipmayhem » Thu Nov 05, 2009 5:35 am

OHSU wrote:
lordshipmayhem wrote:I'd head off to the nearest Linux Users' Group, you should be able to Google one close to you and contact them through their website. They tend to be greybearded old programmers with a wealth of contacts. In other words if nobody there can help you, chances are they know someone who can.

(When I first went to a local LUG meeting, I was expecting a ton of eager youngsters in their 20's. I turned out to be the youngest one there, most of the others being eager "youngsters" in their 50's and 60's.)


Could they write a Windows app for me?

As I said, if they couldn't help you, they'd know someone who could. Lots of them program in a variety of languages. Not many people know that many games are programmed first in Linux and then converted to Windows.

But someone has been very nice and given you your program, so this can be filed under "for future consideration". Much thanks, Nineberry!! :toast:
There are 10 kinds of people in the world - those who understand binary, and those who don't
User avatar
lordshipmayhem
Forum Member
 
Posts: 241
Joined: Fri Mar 06, 2009 11:47 pm

Re: Computer Programmer Wanted: Custom verson of "Weasel"

Postby natselrox » Thu Nov 05, 2009 5:59 am

Wow! So many good programmers here!
Image

Soft Rains follow...
User avatar
natselrox
Forum Member
 
Posts: 2415
Joined: Tue Jan 22, 2008 3:36 pm

Re: Computer Programmer Wanted: Custom verson of "Weasel"

Postby NineBerry » Thu Nov 05, 2009 12:46 pm

OHSU wrote:I have some questions, though. What, exactly, do the "skip" buttons do? What does it mean to "skip 100 generations"? What effect does that have on the process?


I wasn't very content with the word, either. I was looking for a better one that is short enough to fit on the buttons but couldn't find one. ;) Maybe someone has a better idea:

"Skip" runs the given number of generations without applying the "delay" before each generation. This can be used for two purposes:

While the normal breeding process is running, this might be used to "skip forward" a given number of generations like you would do with your VCR when watching a boring sequence of a film because you are impatient.

It is also a way of running the given number of generations while the breeding process is paused. For example, when starting the breeding process by clicking "(Re)Start", first check the check box "Start paused". So the system will reset and is ready to work but is paused and doesn't run automatically. You can now use the skip buttons to run a given number of generations.

That might be useful if you want to log an experiment to draw a chart, for example. Just start the experiment paused. Then repeatedly hit the "skip 100 generations" button to run 100 generations at once. So, you can easily write down the current mutated texts and the distances to the target after 100, 200, 300, 400, 500, 600 ... generations.
There must be security for all — or no one is secure... This does not mean giving up any freedom except the freedom to act irresponsibly.
User avatar
NineBerry
Forum Member
 
Posts: 10485
Joined: Sat Oct 20, 2007 10:53 pm
Location: Karlsruhe, nSk state

Re: Computer Programmer Wanted: Custom verson of "Weasel"

Postby NineBerry » Thu Nov 05, 2009 1:07 pm

What I wanted to add: All the settings that are grouped under "Settings" can be changed while the algorithm is running and will immediately be applied.

It is especially interesting to modify the "mutation rate" and "offspring" settings while the experiment is running:

Increasing the mutation rate makes the distance increase, reducing the mutation rate makes the distance decrease, but also slows down the process. You can see that with few mutations, there is nearly no "progress", but with too many mutations, the text becomes unstable.

Number of generations has a different effect: reducing the number of generations makes the text unstable: Natural Selection has few variants to choose from, so the chance is high that all daughter texts are worse than their mother text in one generation and the string degenerates. Increasing the number of generations decreases distance and speeds up the process. Natural selection has a large set of mutated daughters to choose from, so there is a high chance, one of the daughters of a generation is much better than the mother text.

Given the right combination of mutation rate and offspring per generation (e.g. mutation rate 3.0 and 10 offspring), the system is in a state where it is always close to the target text and occasionally hits it, but small changes occur constantly.
There must be security for all — or no one is secure... This does not mean giving up any freedom except the freedom to act irresponsibly.
User avatar
NineBerry
Forum Member
 
Posts: 10485
Joined: Sat Oct 20, 2007 10:53 pm
Location: Karlsruhe, nSk state

Re: Computer Programmer Wanted: Custom verson of "Weasel"

Postby OHSU » Thu Nov 05, 2009 1:59 pm

NineBerry wrote:
OHSU wrote:I have some questions, though. What, exactly, do the "skip" buttons do? What does it mean to "skip 100 generations"? What effect does that have on the process?


I wasn't very content with the word, either. I was looking for a better one that is short enough to fit on the buttons but couldn't find one. ;) Maybe someone has a better idea:

"Skip" runs the given number of generations without applying the "delay" before each generation. This can be used for two purposes:

While the normal breeding process is running, this might be used to "skip forward" a given number of generations like you would do with your VCR when watching a boring sequence of a film because you are impatient.

It is also a way of running the given number of generations while the breeding process is paused. For example, when starting the breeding process by clicking "(Re)Start", first check the check box "Start paused". So the system will reset and is ready to work but is paused and doesn't run automatically. You can now use the skip buttons to run a given number of generations.

That might be useful if you want to log an experiment to draw a chart, for example. Just start the experiment paused. Then repeatedly hit the "skip 100 generations" button to run 100 generations at once. So, you can easily write down the current mutated texts and the distances to the target after 100, 200, 300, 400, 500, 600 ... generations.


UNBELIEVABLE! You really did think of everything. I think I'd call it "fast forward" rather than "skip", but that wouldn't really fit on the button. So, I think "skip" is a perfectly good term.

This is a fantastic tool for my daughter's project. Again, I can't thank you enough.
Last edited by OHSU on Thu Nov 05, 2009 2:09 pm, edited 1 time in total.
"Yes we have a soul; but it's made of lots of tiny robots." -- Daniel Dennett

"Successions of anecdotes selected to fit a story do not constitute evidence." -- N.N. Taleb

"For every problem, there is a solution that is simple, neat, and wrong." -- H.L. Mencken
User avatar
OHSU
Forum Member
 
Posts: 4933
Joined: Sun Oct 07, 2007 8:13 pm
Location: Tucson, Arizona, USA

Next

Return to General Discussion

Who is online

Users browsing this forum: alanesq, Daan, Eryemil, ff5167, Gareth1984, Goldenmane, Harmonica, Mononoke, Nautyskin, Or Bar, tap1966 and 29 guests


Go to RichardDawkins.net Store | OUT Campaign | Disclaimer | E-Mail Forum Admin