eaLib API Docs
Last Modified : January 7 2002

mss.ea.core
Interface IndividualGate

All Known Implementing Classes:
AbstractPopulation

public interface IndividualGate

Interface for classes where individuals are able to pass through. Gates are some kind of a combination of sources and sinks and act as buffers.

Since:
0.1
Version:
$Revision: 1.4 $ $Date: 2001/11/22 19:04:57 $
Author:
Andreas Rummler

Method Summary
 void add(Individual i)
          Adds an individual to the sink.
 void add(Individual[] ia)
          Adds an array of indiviualds to the sink.
 void add(IndividualStream is)
          Adds a stream of individuals to the sink.
 Individual get(int index)
          Get a single individual from the gate.
 IndividualStream getStream()
          Deprecated. replaced by toStream()
 void remove(int index)
          Removes an individual from the gate.
 void remove(int lowerIndex, int upperIndex)
          Removes several individuals from the gate.
 void removeAll()
          Removes all individuals from the gate.
 int size()
          Returns the current size of the gate.
 Individual[] toArray()
          Returns the contents of the gate in an array.
 IndividualStream toStream()
          Gets a stream of individuals from the gate.
 

Method Detail

add

public void add(Individual i)
Adds an individual to the sink.
Parameters:
i - individual to add

add

public void add(Individual[] ia)
Adds an array of indiviualds to the sink.
Parameters:
ia - array with individuals

add

public void add(IndividualStream is)
Adds a stream of individuals to the sink.
Parameters:
is - stream of individuals

get

public Individual get(int index)
Get a single individual from the gate.
Parameters:
index - index of individual
Returns:
individual from gate

toStream

public IndividualStream toStream()
Gets a stream of individuals from the gate.
Returns:
stream of individuals

toArray

public Individual[] toArray()
Returns the contents of the gate in an array.
Returns:
array of individuals

getStream

public IndividualStream getStream()
Deprecated. replaced by toStream()

Gets a stream of individuals from the gate.
Returns:
stream of individuals

remove

public void remove(int index)
Removes an individual from the gate.
Parameters:
index - index of the individual

remove

public void remove(int lowerIndex,
                   int upperIndex)
Removes several individuals from the gate.
Parameters:
lowerIndex - lower index (inclusive)
upperIndex - upper index (exclusive)

removeAll

public void removeAll()
Removes all individuals from the gate.

size

public int size()
Returns the current size of the gate.
Returns:
size of the gate

eaLib API Docs
Last Modified : January 7 2002

Copyright © 2000-2001 Technical University of Ilmenau, Department ESS