net.sourceforge.cilib.entity.topologies
Class HypercubeTopology<E extends Entity>

java.lang.Object
  extended by net.sourceforge.cilib.entity.AbstractTopology<E>
      extended by net.sourceforge.cilib.entity.topologies.GBestTopology<E>
          extended by net.sourceforge.cilib.entity.topologies.HypercubeTopology<E>
Type Parameters:
E - The Entity type.
All Implemented Interfaces:
Serializable, Iterable<E>, Collection<E>, List<E>, Topology<E>, Cloneable

public class HypercubeTopology<E extends Entity>
extends GBestTopology<E>

Author:
Gareth David
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class net.sourceforge.cilib.entity.topologies.GBestTopology
GBestTopology.IndexedIterator<T extends Entity>
 
Field Summary
 
Fields inherited from class net.sourceforge.cilib.entity.topologies.GBestTopology
entities
 
Constructor Summary
HypercubeTopology()
           
HypercubeTopology(HypercubeTopology<E> copy)
           
 
Method Summary
 HypercubeTopology<E> getClone()
          Create a cloned copy of the current object and return it.
 int getNeighbourhoodSize()
          Accessor for the number of particles in a neighbourhood.
 Iterator<E> neighbourhood(Iterator<? extends Entity> iterator)
          Returns an Iterator over all particles in the neighbourhood of the particle referred to by the given Iterator.
 void setNeighbourhoodSize(int neighbourhoodSize)
          Sets the number particles in the neighbourhood of each particle.
 
Methods inherited from class net.sourceforge.cilib.entity.topologies.GBestTopology
add, add, addAll, addAll, asList, clear, contains, containsAll, equals, get, getId, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, remove, removeAll, retainAll, set, setId, size, subList, toArray, toArray
 
Methods inherited from class net.sourceforge.cilib.entity.AbstractTopology
accept, accept, clearBestEntity, getBestEntity, getBestEntity, update
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HypercubeTopology

public HypercubeTopology()

HypercubeTopology

public HypercubeTopology(HypercubeTopology<E> copy)
Method Detail

getClone

public HypercubeTopology<E> getClone()
Create a cloned copy of the current object and return it. In general the created copy will be a deep copy of the provided instance. As a result this operation an be quite expensive if used incorrectly.

Specified by:
getClone in interface Topology<E extends Entity>
Specified by:
getClone in interface Cloneable
Overrides:
getClone in class GBestTopology<E extends Entity>
Returns:
An exact clone of the current object instance.
See Also:
Object.clone()

neighbourhood

public Iterator<E> neighbourhood(Iterator<? extends Entity> iterator)
Returns an Iterator over all particles in the neighbourhood of the particle referred to by the given Iterator.

Specified by:
neighbourhood in interface Topology<E extends Entity>
Overrides:
neighbourhood in class GBestTopology<E extends Entity>
Parameters:
iterator - An iterator that refers to a particle in this topology.
Returns:
A particle iterator.

setNeighbourhoodSize

public void setNeighbourhoodSize(int neighbourhoodSize)
Sets the number particles in the neighbourhood of each particle. The default is 5.

Parameters:
neighbourhoodSize - The size of the neighbourhood.

getNeighbourhoodSize

public int getNeighbourhoodSize()
Accessor for the number of particles in a neighbourhood.

Returns:
The size of the neighbourhood.


Copyright © 2009 CIRG. All Rights Reserved.