org.dbe.eve.opt.alg.ga
Class Individuum

java.lang.Object
  extended by org.dbe.eve.opt.alg.ga.Individuum
All Implemented Interfaces:
java.lang.Cloneable

public class Individuum
extends java.lang.Object
implements java.lang.Cloneable

Author:
cmasuch TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates

Field Summary
private  java.util.Vector attributes
           
private  double fitness
           
(package private) static MersenneTwister mt
           
(package private)  int position
           
private  java.util.Vector services
           
static int SORT_BY_FITNESS
           
static int SORT_BY_LENGTH
           
private  int sortOrder
           
 
Constructor Summary
Individuum()
           
Individuum(java.util.Vector _services)
           
 
Method Summary
 java.lang.Object clone()
          create hard copy of an Individuum
static Individuum createDemandedIndividuum(DemandedService service)
           
static Individuum createIndividuumFromServiceVector(java.util.Vector serviceVector)
           
static Individuum createRandomIndividuum(LocalServicePool sp, Individuum request)
           
private  void extractIndividuumAttributes()
          Extracts all Attributes of all services in this individual
 java.util.Vector getAttributes()
           
 double getFitness()
           
 int getNumberOfAttributes()
           
 int getPosition()
           
 java.util.Vector getServices()
           
 int getSortOrder()
           
private  void init()
           
 void setAttributes(java.util.Vector attributes)
           
 void setFitness(double fitness)
           
 void setPosition(int position)
           
 void setServices(java.util.Vector services)
           
 void setSortOrder(int sortOrder)
           
 java.lang.String toString()
          Represents the Attributes of a Individuum as String
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SORT_BY_FITNESS

public static final int SORT_BY_FITNESS
See Also:
Constant Field Values

SORT_BY_LENGTH

public static final int SORT_BY_LENGTH
See Also:
Constant Field Values

mt

static MersenneTwister mt

services

private java.util.Vector services

attributes

private java.util.Vector attributes

fitness

private double fitness

position

int position

sortOrder

private int sortOrder
Constructor Detail

Individuum

public Individuum()

Individuum

public Individuum(java.util.Vector _services)
Method Detail

createRandomIndividuum

public static Individuum createRandomIndividuum(LocalServicePool sp,
                                                Individuum request)

createDemandedIndividuum

public static Individuum createDemandedIndividuum(DemandedService service)

createIndividuumFromServiceVector

public static Individuum createIndividuumFromServiceVector(java.util.Vector serviceVector)

init

private void init()

extractIndividuumAttributes

private void extractIndividuumAttributes()
Extracts all Attributes of all services in this individual


getNumberOfAttributes

public int getNumberOfAttributes()

getServices

public java.util.Vector getServices()
Returns:
Returns the services.

setServices

public void setServices(java.util.Vector services)
Parameters:
services - The services to set.

setSortOrder

public void setSortOrder(int sortOrder)
Parameters:
sortOrder - The sortOrder to set.

getSortOrder

public int getSortOrder()

getFitness

public double getFitness()
Returns:
Returns the fitness.

setFitness

public void setFitness(double fitness)
Parameters:
fitness - The fitness to set.

getAttributes

public java.util.Vector getAttributes()

setAttributes

public void setAttributes(java.util.Vector attributes)

getPosition

public int getPosition()

setPosition

public void setPosition(int position)

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
create hard copy of an Individuum

Overrides:
clone in class java.lang.Object
Returns:
Object returns the cloned Individuum
Throws:
java.lang.CloneNotSupportedException

toString

public java.lang.String toString()
Represents the Attributes of a Individuum as String

Overrides:
toString in class java.lang.Object
Returns:
A string which includes the Individuum description