net.sourceforge.cilib.entity.visitor
Class ClosestEntityVisitor
java.lang.Object
net.sourceforge.cilib.container.visitor.Visitor<Topology<? extends Entity>>
net.sourceforge.cilib.entity.visitor.TopologyVisitor
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
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 |
ClosestEntityVisitor
public ClosestEntityVisitor()
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.