edu.udo.cs.ie.cowbots.bdi.desgen
Class DesireState

Package class diagram package DesireState
java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.AbstractSequentialList<E>
              extended by java.util.LinkedList<CDesire>
                  extended by edu.udo.cs.ie.cowbots.bdi.desgen.DesireState
All Implemented Interfaces:
IDesireState, java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<CDesire>, java.util.Collection<CDesire>, java.util.Deque<CDesire>, java.util.List<CDesire>, java.util.Queue<CDesire>

public class DesireState
extends java.util.LinkedList<CDesire>
implements IDesireState

Implementation of a cowbots desirestate. For reference see the javadoc in IDesireState.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
DesireState()
           
 
Method Summary
 int getIntensityByUniqueName(Literal uniqueName)
          Returns the intensity of the desire identified by the given unique name.
 CDesire getMostMotivatedDesire()
          Returns the desire with the highest intensity TODO: Ugly, but we cannot use TreeSet because we need equals *and* compareTo with different meanings
 
Methods inherited from class java.util.LinkedList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, toArray, toArray
 
Methods inherited from class java.util.AbstractSequentialList
iterator
 
Methods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
 
Methods inherited from interface java.util.Deque
iterator
 

Constructor Detail

DesireState

public DesireState()
Method Detail

getIntensityByUniqueName

public int getIntensityByUniqueName(Literal uniqueName)
Returns the intensity of the desire identified by the given unique name. If the desire does not exist, zero is returned.

Specified by:
getIntensityByUniqueName in interface IDesireState

getMostMotivatedDesire

public CDesire getMostMotivatedDesire()
Returns the desire with the highest intensity TODO: Ugly, but we cannot use TreeSet because we need equals *and* compareTo with different meanings

Specified by:
getMostMotivatedDesire in interface IDesireState