islandev
Class ClientRecord

java.lang.Object
  |
  +--islandev.ClientRecord
All Implemented Interfaces:
java.io.Serializable

public class ClientRecord
extends java.lang.Object
implements java.io.Serializable

A client record holds information about the client's current state such as its best individual, its id (position in the grid) its current generations, next migrating individual, etc... This class also deals with new information arriving from the client and updates its own data based on it. It also does other stuff with this information from the client such as logging whole populations to disk. For this it uses the ibm loggging package. A ClientRecord object is also capable of painting itself which is used for the IslandsEvoGUI.

See Also:
Serialized Form

Field Summary
protected  java.util.Vector bestIndividuals
           
protected  java.util.Vector currentAvgFitnesses
           
protected  java.util.Vector currentGenerations
           
protected  com.ibm.logging.FileHandler fileLog
           
protected  java.awt.Point id
           
protected  boolean justRegistered
           
protected  java.lang.String lastPopLogFileName
           
protected  java.util.Vector[] migrators
           
protected  javax.swing.JPanel myPanel
           
protected  java.lang.String name
           
protected  int nextMigration
           
protected  com.ibm.logging.MessageLogger popLogger
           
 
Constructor Summary
ClientRecord(java.awt.Point id, java.lang.String name)
          Creates new ClientRecord
 
Method Summary
 void cycleMigration()
           
 java.util.Vector getAvgFitnesses()
           
 java.util.Vector getBestIndividuals()
           
 java.util.Vector getGenerations()
           
 java.awt.Point getID()
           
 boolean getJustRegistered()
           
 java.util.Vector getMigrators(int direction)
           
 java.lang.String getName()
           
 int getNextMigration()
           
 javax.swing.JPanel getPanel()
           
 void handleReport(java.util.Vector report)
          format is 0: best genotype 1: int of current generation 2: double of average fitness
 void migrateOut(java.util.Vector indivs)
           
 void refreshLog()
           
 void setCurrentGenerations(int[] currGen)
           
 void setJustRegistered(boolean value)
           
 void startLog()
           
 void stopLog()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

protected java.awt.Point id

name

protected java.lang.String name

justRegistered

protected boolean justRegistered

bestIndividuals

protected java.util.Vector bestIndividuals

migrators

protected java.util.Vector[] migrators

nextMigration

protected int nextMigration

currentGenerations

protected java.util.Vector currentGenerations

currentAvgFitnesses

protected java.util.Vector currentAvgFitnesses

myPanel

protected javax.swing.JPanel myPanel

popLogger

protected transient com.ibm.logging.MessageLogger popLogger

fileLog

protected transient com.ibm.logging.FileHandler fileLog

lastPopLogFileName

protected transient java.lang.String lastPopLogFileName
Constructor Detail

ClientRecord

public ClientRecord(java.awt.Point id,
                    java.lang.String name)
Creates new ClientRecord
Method Detail

refreshLog

public void refreshLog()

startLog

public void startLog()

stopLog

public void stopLog()

handleReport

public void handleReport(java.util.Vector report)
format is 0: best genotype 1: int of current generation 2: double of average fitness

getNextMigration

public int getNextMigration()

migrateOut

public void migrateOut(java.util.Vector indivs)

cycleMigration

public void cycleMigration()

getMigrators

public java.util.Vector getMigrators(int direction)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getBestIndividuals

public java.util.Vector getBestIndividuals()

getGenerations

public java.util.Vector getGenerations()

getAvgFitnesses

public java.util.Vector getAvgFitnesses()

getName

public java.lang.String getName()

getID

public java.awt.Point getID()

getPanel

public javax.swing.JPanel getPanel()

setCurrentGenerations

public void setCurrentGenerations(int[] currGen)

setJustRegistered

public void setJustRegistered(boolean value)

getJustRegistered

public boolean getJustRegistered()