Class FollowTarget

  • All Implemented Interfaces:
    it.unibo.alchemist.model.movestrategies.TargetSelectionStrategy , java.io.Serializable

    
    public class FollowTarget<T, P extends Position<P>>
     implements TargetSelectionStrategy<T, P>
                        

    This strategy reads the value of a "target" molecule and tries to interpret it as a coordinate.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

      • FollowTarget

        FollowTarget(Environment<T, P> environment, Node<T> node, Molecule targetMolecule)
        Parameters:
        environment - the environment
        node - the node
        targetMolecule - the target molecule
    • Method Detail

      • getTarget

         final P getTarget()
        Returns:

        the next target where the Node is directed

      • cloneIfNeeded

         FollowTarget<T, P> cloneIfNeeded(Node<T> destination, Reaction<T> reaction)
        Parameters:
        destination - the Node where the strategy is being cloned
        reaction - the Reaction where strategy is being cloned
        Returns:

        A copy of the strategy if the strategy is stateful, and this object otherwise. The default implementation assumes a stateless strategy.