wodka.ga.geno.lang
Class AbstractProgram

java.lang.Object
  extended bywodka.ga.geno.lang.AbstractProgram
All Implemented Interfaces:
Genotype, Program, java.io.Serializable, StreamPersistable
Direct Known Subclasses:
AssemblerProgram, TurtleProgram

public abstract class AbstractProgram
extends java.lang.Object
implements Program

A sequence of commands.

See Also:
Serialized Form

Field Summary
protected  SodaGlobalsRanges globalRanges
           
protected  Language language
           
 
Constructor Summary
AbstractProgram()
           
AbstractProgram(SodaGlobalsRanges ranges)
           
 
Method Summary
 void add(Command cmd)
           
 java.util.Iterator commands()
           
 void createRandomAttributes()
           
 Model eval()
           
 Model evalNoRewise()
           
 void fromStream(java.io.DataInputStream inStream, int version)
           
 java.util.Collection getCommands()
           
 GenotypeDesc getGenotypeDesc()
           
 SodaGlobalsRanges getGlobalRanges()
           
 SodaGlobals getGlobals()
           
 Language getLanguage()
           
 int getVersion()
           
 Genotype recombine(Genotype parent, double mutationRate)
           
 void setCommands(java.util.Collection commands)
           
 void setGenotypeDesc(GenotypeDesc geno)
           
 void setGlobalRanges(SodaGlobalsRanges globalRanges)
           
 void setGlobals(SodaGlobals globals)
           
 void setLanguage(Language language)
           
 void toStream(java.io.DataOutputStream outStream)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface wodka.ga.geno.lang.Program
createEmptyChildProgram, interpreter
 

Field Detail

globalRanges

protected SodaGlobalsRanges globalRanges

language

protected Language language
Constructor Detail

AbstractProgram

public AbstractProgram()

AbstractProgram

public AbstractProgram(SodaGlobalsRanges ranges)
Method Detail

getCommands

public java.util.Collection getCommands()

setCommands

public void setCommands(java.util.Collection commands)

getGlobalRanges

public SodaGlobalsRanges getGlobalRanges()

setGlobalRanges

public void setGlobalRanges(SodaGlobalsRanges globalRanges)

getLanguage

public Language getLanguage()
Specified by:
getLanguage in interface Program

setLanguage

public void setLanguage(Language language)

getGenotypeDesc

public GenotypeDesc getGenotypeDesc()
Specified by:
getGenotypeDesc in interface Genotype

setGenotypeDesc

public void setGenotypeDesc(GenotypeDesc geno)
Specified by:
setGenotypeDesc in interface Genotype

getGlobals

public SodaGlobals getGlobals()
Specified by:
getGlobals in interface Program

setGlobals

public void setGlobals(SodaGlobals globals)
Specified by:
setGlobals in interface Program

add

public void add(Command cmd)
Specified by:
add in interface Program

createRandomAttributes

public void createRandomAttributes()

commands

public java.util.Iterator commands()
Specified by:
commands in interface Program

recombine

public Genotype recombine(Genotype parent,
                          double mutationRate)
Specified by:
recombine in interface Genotype

toString

public java.lang.String toString()

toStream

public void toStream(java.io.DataOutputStream outStream)
              throws java.io.IOException
Specified by:
toStream in interface StreamPersistable
Throws:
java.io.IOException

fromStream

public void fromStream(java.io.DataInputStream inStream,
                       int version)
                throws java.io.IOException
Specified by:
fromStream in interface StreamPersistable
Throws:
java.io.IOException

getVersion

public int getVersion()
Specified by:
getVersion in interface StreamPersistable

eval

public Model eval()
Specified by:
eval in interface Genotype

evalNoRewise

public Model evalNoRewise()
Specified by:
evalNoRewise in interface Genotype