edu.udo.cs.ie.cowbots.internalActions.scout
Class getScoutCandidate

Package class diagram package getScoutCandidate
java.lang.Object
  extended by DefaultInternalAction
      extended by edu.udo.cs.ie.cowbots.internalActions.scout.getScoutCandidate

public class getScoutCandidate
extends DefaultInternalAction

This class implements an internal action which computes candidate points for the scout.


Field Summary
(package private)  java.awt.Point corralPos
           
(package private)  ICowbot cowbot
           
(package private)  GridMap map
           
(package private)  java.awt.Point[] notWeightedCandidates
           
(package private)  int numberOfPoints
           
(package private)  java.util.List<WeightedPoint> weightedCandidate
           
(package private)  int WorldKnownThreshold
           
 
Constructor Summary
getScoutCandidate()
           
 
Method Summary
private  java.awt.Point calculateRandomTarget()
          Utility function to get a Point if the Agent's beliefs no longer contain an unexplored cell
private  void distToCorral(java.util.List<WeightedPoint> weightedCandidate)
           
 java.lang.Object execute(TransitionSystem ts, Unifier un, Term[] args)
           
private  java.awt.Point[] getRandomCandidates(int numberOfPoints, TransitionSystem ts)
          Utility function to get a number of random points for candidates
private  java.util.List<WeightedPoint> getWeightedCandidates(java.awt.Point[] p)
          Utility function to apply a weight to each point
private  void orderCandidates(java.util.List<WeightedPoint> weightedCandidate)
          Utility function to sort the targets
private  void printCandidte()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

map

GridMap map

numberOfPoints

int numberOfPoints

notWeightedCandidates

java.awt.Point[] notWeightedCandidates

weightedCandidate

java.util.List<WeightedPoint> weightedCandidate

cowbot

ICowbot cowbot

corralPos

java.awt.Point corralPos

WorldKnownThreshold

int WorldKnownThreshold
Constructor Detail

getScoutCandidate

public getScoutCandidate()
Method Detail

execute

public java.lang.Object execute(TransitionSystem ts,
                                Unifier un,
                                Term[] args)
                         throws java.lang.Exception
Throws:
java.lang.Exception

printCandidte

private void printCandidte()

getRandomCandidates

private java.awt.Point[] getRandomCandidates(int numberOfPoints,
                                             TransitionSystem ts)
Utility function to get a number of random points for candidates

Parameters:
numberOfPoints - the number of points generated
ts - the TransisionSystem
Returns:
an array containing all the points

getWeightedCandidates

private java.util.List<WeightedPoint> getWeightedCandidates(java.awt.Point[] p)
Utility function to apply a weight to each point

Parameters:
p - the array of points
Returns:
the List of weighted points

distToCorral

private void distToCorral(java.util.List<WeightedPoint> weightedCandidate)

orderCandidates

private void orderCandidates(java.util.List<WeightedPoint> weightedCandidate)
Utility function to sort the targets

Parameters:
weightedCandidate - List of all weighted points

calculateRandomTarget

private java.awt.Point calculateRandomTarget()
Utility function to get a Point if the Agent's beliefs no longer contain an unexplored cell

Returns:
Point encoding the coordinates