net.sourceforge.cilib.entity.visitor
Class ClosestEntityVisitor

java.lang.Object
  extended by net.sourceforge.cilib.container.visitor.Visitor<Topology<? extends Entity>>
      extended by net.sourceforge.cilib.entity.visitor.TopologyVisitor
          extended by net.sourceforge.cilib.entity.visitor.ClosestEntityVisitor

public class ClosestEntityVisitor
extends TopologyVisitor

Vistor to calculate the closest entity to the provided targetEntity using a DistanceMeasure.

Author:
gpampara

Field Summary
 
Fields inherited from class net.sourceforge.cilib.entity.visitor.TopologyVisitor
currentAlgorithm, distanceMeasure
 
Constructor Summary
ClosestEntityVisitor()
           
 
Method Summary
 Entity getResult()
          Get the result of the visitor.
 Entity getTargetEntity()
          Get the target entity for which this visitor bases it's calculations on.
 void setTargetEntity(Entity targetEntity)
          Set the entity for which the calculations are based on.
 void visit(Topology<? extends Entity> topology)
          Perform the search for the closest entity.
 
Methods inherited from class net.sourceforge.cilib.entity.visitor.TopologyVisitor
getCurrentAlgorithm, getDistanceMeasure, setCurrentAlgorithm, setDistanceMeasure
 
Methods inherited from class net.sourceforge.cilib.container.visitor.Visitor
isDone
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClosestEntityVisitor

public ClosestEntityVisitor()
Method Detail

visit

public void visit(Topology<? extends Entity> topology)
Perform the search for the closest entity.

Specified by:
visit in class TopologyVisitor
Parameters:
topology - The topology to search.

getResult

public Entity getResult()
Get the result of the visitor. IE: Get the located entity that is the closest entity spatially to the provided targetEntity.

Specified by:
getResult in class TopologyVisitor
Returns:
The entity that is the closest to the targetEntity.

getTargetEntity

public Entity getTargetEntity()
Get the target entity for which this visitor bases it's calculations on.

Returns:
The entity on which the visitor operates.

setTargetEntity

public void setTargetEntity(Entity targetEntity)
Set the entity for which the calculations are based on.

Parameters:
targetEntity - The entity to set.


Copyright © 2009 CIRG. All Rights Reserved.