BiomFrame
Class CBiomorph

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

class CBiomorph
extends CBiot

CBiomorph : defines a Biomorph as a Biot


Field Summary
(package private)  int Delta
           
(package private)  int GenomeScale
           
(package private)  JPGraphTools GT
          Pointer to App GraphTools
(package private)  CBiomorphUniverse MyUniverse
           
(package private)  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 BiomFrame.CBiot
Direction, EnergyLevel, Genome, MyType, MyUniverse, Position
 
Constructor Summary
CBiomorph(CBiomorph father, int nummutant)
          Creates a descendant with a mutation on gene nummutant
CBiomorph(CBiomorphUniverse univ)
          Create a Biom in Universe
CBiomorph(CBiomorphUniverse univ, boolean rnd, int place)
          Randomly creates Biomorph at Place
 
Method Summary
(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
(package private)  void DispGenome(CBiomView v)
          Display the Biom genome (e.d directions) in lower right square
(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)  PosReal GetClickGeneValue(CBiomView v, int numdir, int x, int y)
          Return the value of direction Genes at clicking point
(package private)  int GetGene(int GeneNum)
          Return the nth Gene as Integer
(package private)  void InitDispGene(CBiomView v)
          Some gene display init.
 void Live(JPView v)
          Live function : Draw
(package private)  void SetClickGeneValue(CBiomView v, int numdir, PosReal pos)
          Set the values of direction Genes according to clicking point
(package private)  void SetDefaultGenes()
          Set Biom genome to default values
(package private)  void SetDirOrigOffset(int numdir, CBiomView v)
          Set display OrigOffset for a Direction
(package private)  void SetGene(int GeneNum, int GeneValue)
          Gene setter
 
Methods inherited from class BiomFrame.CBiot
GetEnergyLevel, GetMyType, GetMyUniverse, SetBiotType, SetGenome
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

NbGene

final int NbGene

GenomeScale

final int GenomeScale

Delta

final int Delta

XMax

float XMax

XMin

float XMin

YMax

float YMax

YMin

float YMin

XOffsets

int[] XOffsets

YOffsets

int[] YOffsets

MyUniverse

CBiomorphUniverse MyUniverse

Place

int Place
Position on Grid

GT

JPGraphTools GT
Pointer to App GraphTools
Constructor Detail

CBiomorph

public CBiomorph(CBiomorphUniverse univ)
Create a Biom in Universe

CBiomorph

public CBiomorph(CBiomorphUniverse 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
Method Detail

SetDefaultGenes

void SetDefaultGenes()
Set Biom genome to default values

SetGene

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

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

InitDispGene

void InitDispGene(CBiomView v)
Some gene display init.

SetDirOrigOffset

void SetDirOrigOffset(int numdir,
                      CBiomView v)
Set display OrigOffset for a Direction

DispGenome

void DispGenome(CBiomView v)
Display the Biom genome (e.d directions) in lower right square

GetClickGeneValue

PosReal GetClickGeneValue(CBiomView v,
                          int numdir,
                          int x,
                          int y)
Return the value of direction Genes at clicking point

SetClickGeneValue

void SetClickGeneValue(CBiomView v,
                       int numdir,
                       PosReal pos)
Set the values of direction Genes according to clicking point