Gav
Class CBiomorph

java.lang.Object
  |
  +--Gav.CBiot
        |
        +--Gav.CBiomorph

class CBiomorph
extends CBiot

CBiomorph : defines a Biomorph as a Biot


Field Summary
(package private)  long BiomGenome
           
(package private)  java.util.Vector BiomPhenotype
          points Vector.
(package private)  long DefaultGenome
           
(package private)  int Delta
           
(package private)  double Fitness
           
(package private) static int GeneBitLength
           
(package private)  int GenomeScale
           
(package private)  JPGraphTools GT
          Pointer to App GraphTools
(package private)  long MaskGenome
           
(package private) static int MaxBranch
           
(package private) static int MinBranch
           
(package private)  CGavUniverse MyUniverse
           
(package private) static int NbGene
           
(package private)  int Place
          Position on Grid
(package private)  float XMax
           
(package private)  float XMin
           
(package private)  int[] XOffsets
           
(package private)  float YMax
           
(package private)  float YMin
           
(package private)  int[] YOffsets
           
 
Fields inherited from class Gav.CBiot
Direction, EnergyLevel, MyType, MyUniverse, Position, Selected
 
Constructor Summary
CBiomorph(CBiomorph father, CBiomorph mother, int place)
          Creates an offspring
CBiomorph(CBiomorph father, int nummutant)
          Creates a descendant with a mutation on gene nummutant
CBiomorph(CGavUniverse univ)
          Create a Biom in Universe
CBiomorph(CGavUniverse univ, boolean rnd, int place)
          Randomly creates Biomorph at Place
 
Method Summary
(package private)  void CalcBiomSize()
           
(package private)  void CalcBiomSize(float X, float Y, int Length, int Direction, int[] XOffsets, int[] YOffsets)
          Determines the global size of the Biom
(package private)  void CalcXOffset()
          Calculate X and Y Offsets from the genes
 java.lang.String DispGenome()
          return Genome as String
(package private)  void Draw(java.awt.Graphics g, float X, float Y, int Length, int Direction, int[] XOffsets, int[] YOffsets)
          Recursive Drawing algorithm
(package private)  void GenPhenotype()
          Generate Vector Phenotype
(package private)  java.lang.String GetBitGenomeString(long g)
          Creates a binary string representation of genome
(package private)  int GetGene(int GeneNum)
          Return the nth Gene as Integer
 void Live(JPView v)
          Live function : Draw
(package private)  void MutateBiom()
          Mutate a Biom
(package private)  void SetDefaultGenes()
          Set Biom genome to default values
 void SetGene(int GeneNum, int GeneValue)
          Gene setter
 
Methods inherited from class Gav.CBiot
GetEnergyLevel, GetMyType, GetMyUniverse, SetBiotType
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

MaxBranch

static final int MaxBranch

MinBranch

static final int MinBranch

GeneBitLength

static final int GeneBitLength

NbGene

static final int NbGene

GenomeScale

final int GenomeScale

DefaultGenome

final long DefaultGenome

MaskGenome

final long MaskGenome

Delta

final int Delta

XMax

float XMax

XMin

float XMin

YMax

float YMax

YMin

float YMin

XOffsets

int[] XOffsets

YOffsets

int[] YOffsets

MyUniverse

CGavUniverse MyUniverse

BiomGenome

long BiomGenome

BiomPhenotype

java.util.Vector BiomPhenotype
points Vector. Contains ending point of each branch. Represents Phenotype in GA

Place

int Place
Position on Grid

Fitness

double Fitness

GT

JPGraphTools GT
Pointer to App GraphTools
Constructor Detail

CBiomorph

public CBiomorph(CGavUniverse univ)
Create a Biom in Universe

CBiomorph

public CBiomorph(CGavUniverse univ,
                 boolean rnd,
                 int place)
Randomly creates Biomorph at Place

CBiomorph

public CBiomorph(CBiomorph father,
                 int nummutant)
Creates a descendant with a mutation on gene nummutant

CBiomorph

public CBiomorph(CBiomorph father,
                 CBiomorph mother,
                 int place)
Creates an offspring
Method Detail

MutateBiom

void MutateBiom()
Mutate a Biom

SetDefaultGenes

void SetDefaultGenes()
Set Biom genome to default values

SetGene

public void SetGene(int GeneNum,
                    int GeneValue)
Gene setter

GetGene

int GetGene(int GeneNum)
Return the nth Gene as Integer

CalcXOffset

void CalcXOffset()
Calculate X and Y Offsets from the genes

Live

public void Live(JPView v)
Live function : Draw
Overrides:
Live in class CBiot

GenPhenotype

void GenPhenotype()
Generate Vector Phenotype

CalcBiomSize

void CalcBiomSize()

CalcBiomSize

void CalcBiomSize(float X,
                  float Y,
                  int Length,
                  int Direction,
                  int[] XOffsets,
                  int[] YOffsets)
Determines the global size of the Biom

Draw

void Draw(java.awt.Graphics g,
          float X,
          float Y,
          int Length,
          int Direction,
          int[] XOffsets,
          int[] YOffsets)
Recursive Drawing algorithm

DispGenome

public java.lang.String DispGenome()
return Genome as String

GetBitGenomeString

java.lang.String GetBitGenomeString(long g)
Creates a binary string representation of genome