Gav
Class CGavUniverse

java.lang.Object
  |
  +--Gav.CUniverse
        |
        +--Gav.CGavUniverse

class CGavUniverse
extends CUniverse
implements java.lang.Runnable

Defines GAV Universe


Field Summary
(package private)  CGavApp App
          Pointer to calling App
(package private)  double AvgFitness
           
(package private)  double BaseFitness
          Base for fitness calc.
(package private)  int BaseUsefulPop
          The first bioms in Biots can be excluded from analysis.
(package private)  CBiomorph BestBiom
          Some Bioms
(package private)  int BestMorphIdx
          Best Morph Index
(package private)  CBiomorph CurrentBiom
          Some Bioms
(package private) static boolean DefaultElitistSel
           
(package private) static boolean DefaultGenCalcType
           
(package private) static int DefaultGrid
           
(package private) static boolean DefaultMutateGene
           
(package private) static int DefaultPopIdx
           
(package private) static int DefaultScalingType
           
(package private) static int DefaultSpeed
           
(package private)  int DispSpeed
          Display each DispSpeed generations
(package private)  double Diversity
          Current Diversity
(package private)  boolean ElitistSel
          Elitist selection flag
(package private)  boolean FitGenomeCalc
          Fitness calc type
(package private)  double FtA
          Fitness transfo data
(package private)  double FtB
           
(package private)  java.lang.Thread GavUnivThread
           
(package private)  long Generation
          Generation #
(package private)  double GlobalFitness
          Stats data
(package private)  int InitPopSize
           
 boolean IsInit
           
 boolean IsRunning
           
(package private)  CGavView MainView
          View of the Universe
(package private)  double MaxFitness
           
(package private)  int MaxPopSize
           
(package private)  double MinFitness
           
(package private)  int MinPopSize
           
(package private)  boolean MutateGene
          Mutation type
(package private)  double MutationRate
           
(package private)  double PercentAvgFitness
          Avg fitness in %
(package private)  double PercentMaxFitness
          Max fitness in %
(package private) static int SCALEEXPO
           
(package private) static int SCALELINEAR
           
(package private) static int SCALELINEAR2
           
(package private) static int SCALENONE
           
(package private) static int SCALEWINDOW
           
(package private)  int ScalingType
          Scaling type
(package private)  CBiomorph SelectedBiom
          Some Bioms
 boolean SolFound
          Solution found
(package private)  int Speed
          Iteration delay
(package private) static int[] TabPop
          Tab of population and corresponding mutation rate
(package private)  CFitView ViewAvgFit
           
(package private)  CGenBitView ViewCurrentBitGen
           
(package private)  CGenView ViewGene1
          View of a genome
(package private)  CGenView ViewGene2
           
(package private)  CGenView ViewGene3
           
(package private)  CGenBitView ViewGoalBitGen
          Bit genome view
(package private)  CFitView ViewMaxFit
          Fitness View
(package private)  CBiomorph WorseBiom
          Some Bioms
(package private)  int WorseMorphIdx
          Worse Morph Index
 
Fields inherited from class Gav.CUniverse
Biots, BIOTS_BKP_SIZE, BiotsBkp, MyApp, NbDirections
 
Constructor Summary
CGavUniverse(CGavApp ga)
          Construct World in Application
 
Method Summary
(package private)  void CalcBiomFitness(CBiomorph biom)
          Calculate a Biom fitness
(package private)  void CalcFitness()
          Determine Fitness of each Biom
(package private)  void CalcFitnessStats()
          Calculate pop fitness stats
(package private)  void CalcTransfoFactor()
          Calculate linear transfo factor
(package private)  void DispStats()
          Displays statistics
 void DrawWorld()
          Default drawing
 void DrawWorld(JPView jpv)
          Draw World
 void end()
          This is the end...
 void GenInitPop()
          Create a random init population
(package private)  void GenNewPop()
          Generate a new population according to fitness
(package private)  void GenRndBioms()
          Generate Random Bioms
 CBiomorph GetCurrentBiom()
          Return current biom
 boolean GetElitistSel()
          Get Elitist selection flag
 CGavView GetMainView()
          View getter
 void Go()
          Default Run
 void Go(JPView jpv)
          Run the World in View e.g. creates a new pop and draw world.
(package private)  void InitDefaultWorld()
          Set default param
(package private)  void InitResearch(int mr)
          Init the research process
 void InitView()
          Init View
(package private)  void InitWorld()
          Init a World
(package private)  void LaunchResearch()
          Launch the Genetic Research.
(package private)  void QuickSort(java.util.Vector v, int low, int up)
          Quick sort algorithm
 void RemoveViews()
          Remove views
 void run()
          Main running loop
(package private)  double Scale(double f, double a, double b)
          Returns transfo fitness
(package private)  void ScalePop()
          Transform pop fitness
(package private)  CBiomorph SelectBiom(double ttfitness)
          Random Wheel selection
 void SetBasicParam(int pop, int mr)
          Set Basic parameters
 void SetCurrentBiom(int num)
          set Current Biom
 void SetElitistSel(boolean set)
          Set Elitist selection flag
 void SetGenCalcType(boolean gen)
          Set genome type calc type flag
 void SetGrid(int incr)
          In/decrease grid
 void SetMutationType(boolean mutgene)
          Set Mutation type
 void SetPopSize(int pop)
          Set a new population size with the corresponding grid.
 void SetScalingType(int st)
          Set Caling type
 void SetSelectedBiom(int num)
          set selected Biom
 void SetSpeed(int s)
          Set current speed
(package private)  void Sort(java.util.Vector v)
          Quick sort of a Morph Vector according to fitness
 void stop()
           
private  void Swap(java.util.Vector v, int i, int j)
          Swap element i and j in Vector v
 
Methods inherited from class Gav.CUniverse
AddBiotBkp, EmptyBiotBkp, GetBiotAt, GetBiotBkp, RemoveBiotBkp
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

SCALENONE

static final int SCALENONE

SCALEWINDOW

static final int SCALEWINDOW

SCALEEXPO

static final int SCALEEXPO

SCALELINEAR

static final int SCALELINEAR

SCALELINEAR2

static final int SCALELINEAR2

DefaultElitistSel

static final boolean DefaultElitistSel

DefaultGenCalcType

static final boolean DefaultGenCalcType

DefaultMutateGene

static final boolean DefaultMutateGene

DefaultScalingType

static final int DefaultScalingType

DefaultSpeed

static final int DefaultSpeed

DefaultGrid

static final int DefaultGrid

TabPop

static int[] TabPop
Tab of population and corresponding mutation rate

DefaultPopIdx

static int DefaultPopIdx

BaseUsefulPop

final int BaseUsefulPop
The first bioms in Biots can be excluded from analysis. The #0 is the Current Researched Biom

App

CGavApp App
Pointer to calling App

MainView

CGavView MainView
View of the Universe

ViewGene1

CGenView ViewGene1
View of a genome

ViewGene2

CGenView ViewGene2

ViewGene3

CGenView ViewGene3

ViewMaxFit

CFitView ViewMaxFit
Fitness View

ViewAvgFit

CFitView ViewAvgFit

ViewGoalBitGen

CGenBitView ViewGoalBitGen
Bit genome view

ViewCurrentBitGen

CGenBitView ViewCurrentBitGen

BaseFitness

double BaseFitness
Base for fitness calc. This is the maximum fitness Value

PercentMaxFitness

double PercentMaxFitness
Max fitness in %

PercentAvgFitness

double PercentAvgFitness
Avg fitness in %

Diversity

double Diversity
Current Diversity

CurrentBiom

CBiomorph CurrentBiom
Some Bioms

BestBiom

CBiomorph BestBiom
Some Bioms

WorseBiom

CBiomorph WorseBiom
Some Bioms

SelectedBiom

CBiomorph SelectedBiom
Some Bioms

ElitistSel

boolean ElitistSel
Elitist selection flag

FitGenomeCalc

boolean FitGenomeCalc
Fitness calc type

MutateGene

boolean MutateGene
Mutation type

ScalingType

int ScalingType
Scaling type

IsInit

public boolean IsInit

IsRunning

public boolean IsRunning

MinPopSize

final int MinPopSize

MaxPopSize

final int MaxPopSize

InitPopSize

int InitPopSize

MutationRate

double MutationRate

GavUnivThread

java.lang.Thread GavUnivThread

GlobalFitness

double GlobalFitness
Stats data

MaxFitness

double MaxFitness

MinFitness

double MinFitness

AvgFitness

double AvgFitness

FtA

double FtA
Fitness transfo data

FtB

double FtB

BestMorphIdx

int BestMorphIdx
Best Morph Index

WorseMorphIdx

int WorseMorphIdx
Worse Morph Index

Generation

long Generation
Generation #

Speed

int Speed
Iteration delay

DispSpeed

int DispSpeed
Display each DispSpeed generations

SolFound

public boolean SolFound
Solution found
Constructor Detail

CGavUniverse

public CGavUniverse(CGavApp ga)
Construct World in Application
Method Detail

DrawWorld

public void DrawWorld()
Default drawing

DrawWorld

public void DrawWorld(JPView jpv)
Draw World
Overrides:
DrawWorld in class CUniverse

GetMainView

public CGavView GetMainView()
View getter

InitView

public void InitView()
Init View

RemoveViews

public void RemoveViews()
Remove views

GetCurrentBiom

public CBiomorph GetCurrentBiom()
Return current biom

SetCurrentBiom

public void SetCurrentBiom(int num)
set Current Biom

SetSelectedBiom

public void SetSelectedBiom(int num)
set selected Biom

GenRndBioms

void GenRndBioms()
Generate Random Bioms

Go

public void Go(JPView jpv)
Run the World in View e.g. creates a new pop and draw world.
Overrides:
Go in class CUniverse

Go

public void Go()
Default Run

LaunchResearch

void LaunchResearch()
Launch the Genetic Research.

InitResearch

void InitResearch(int mr)
Init the research process

run

public void run()
Main running loop
Specified by:
run in interface java.lang.Runnable

stop

public void stop()

end

public void end()
This is the end...

GenInitPop

public void GenInitPop()
Create a random init population

DispStats

void DispStats()
Displays statistics

GenNewPop

void GenNewPop()
Generate a new population according to fitness

SelectBiom

CBiomorph SelectBiom(double ttfitness)
Random Wheel selection

CalcFitnessStats

void CalcFitnessStats()
Calculate pop fitness stats

CalcFitness

void CalcFitness()
Determine Fitness of each Biom

CalcBiomFitness

void CalcBiomFitness(CBiomorph biom)
Calculate a Biom fitness

ScalePop

void ScalePop()
Transform pop fitness

Scale

double Scale(double f,
             double a,
             double b)
Returns transfo fitness

CalcTransfoFactor

void CalcTransfoFactor()
Calculate linear transfo factor

InitWorld

void InitWorld()
Init a World

InitDefaultWorld

void InitDefaultWorld()
Set default param

SetElitistSel

public void SetElitistSel(boolean set)
Set Elitist selection flag

SetGenCalcType

public void SetGenCalcType(boolean gen)
Set genome type calc type flag

SetMutationType

public void SetMutationType(boolean mutgene)
Set Mutation type

GetElitistSel

public boolean GetElitistSel()
Get Elitist selection flag

SetScalingType

public void SetScalingType(int st)
Set Caling type

SetSpeed

public void SetSpeed(int s)
Set current speed

SetBasicParam

public void SetBasicParam(int pop,
                          int mr)
Set Basic parameters

SetPopSize

public void SetPopSize(int pop)
Set a new population size with the corresponding grid.

SetGrid

public void SetGrid(int incr)
In/decrease grid

Sort

void Sort(java.util.Vector v)
Quick sort of a Morph Vector according to fitness

Swap

private void Swap(java.util.Vector v,
                  int i,
                  int j)
Swap element i and j in Vector v

QuickSort

void QuickSort(java.util.Vector v,
               int low,
               int up)
Quick sort algorithm