es.udc.gii.common.eaf.algorithm.parallel.topology.migration
Class MigrationObject

java.lang.Object
  extended by es.udc.gii.common.eaf.algorithm.parallel.topology.migration.MigrationObject
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, java.lang.Cloneable

public class MigrationObject
extends java.lang.Object
implements java.lang.Cloneable, java.io.Externalizable

A exchange object is a sort of envelope that contains the data to exchange between to processes in a parallel evolutionary algorithm.

Author:
Rafael Tedin Alvarez
See Also:
Serialized Form

Field Summary
private  int generation
          Current generation at which the sending process is.
private  java.util.List<Individual> individuals
          List of individuals to exchange.
static int NOT_SPECIFIED
          Special value of a generation.
 
Constructor Summary
MigrationObject()
          Creates a new instance of MigrationObject
MigrationObject(java.util.List<Individual> individuals, int generation)
          Creates a new instance of MigrationObject
 
Method Summary
 java.lang.Object clone()
          Clones this object.
 boolean equals(java.lang.Object obj)
           
 int getGeneration()
           
 java.util.List<Individual> getIndividuals()
           
 int hashCode()
           
 void readExternal(java.io.ObjectInput in)
           
 void setGeneration(int generation)
           
 void setIndividuals(java.util.List<Individual> individuals)
           
 java.lang.String toString()
           
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

individuals

private java.util.List<Individual> individuals
List of individuals to exchange.


generation

private int generation
Current generation at which the sending process is.


NOT_SPECIFIED

public static final int NOT_SPECIFIED
Special value of a generation. It states that the current generation is unknown, not needed, etc.

See Also:
Constant Field Values
Constructor Detail

MigrationObject

public MigrationObject()
Creates a new instance of MigrationObject


MigrationObject

public MigrationObject(java.util.List<Individual> individuals,
                       int generation)
Creates a new instance of MigrationObject

Method Detail

toString

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

clone

public java.lang.Object clone()
Clones this object. Take care: the list of individiduals is not cloned. Thus this object and its clone share the same list!

Overrides:
clone in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getIndividuals

public java.util.List<Individual> getIndividuals()

setIndividuals

public void setIndividuals(java.util.List<Individual> individuals)

getGeneration

public int getGeneration()

setGeneration

public void setGeneration(int generation)

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException