fr.lifl.jedi.model.interactionSelection.reactiveSelection
Class PreferredSelectionNature<Element>

java.lang.Object
  extended by fr.lifl.jedi.model.interactionSelection.reactiveSelection.PreferredSelectionNature<Element>
All Implemented Interfaces:
ElementSelectionNature<Element>

public abstract class PreferredSelectionNature<Element>
extends java.lang.Object
implements ElementSelectionNature<Element>

The preferred selection nature.

This provides a tool that gives to every element a preferrence/utility value. It selects the element of the list that has the maximal utility value.

If more than one element has the maximal value, the selected one is chosen at random among them.

The value is computed thanks to the getValueFor(Object) method.

Version:
JEDI V 2.2
Created the 7th nov. 2008
Created the 4th may 2009
Author:
Yoann Kubera
SMAC Team (Systèmes Multi-Agents et Comportement)
LIFL (Laboratoire d'Informatique Fondamentale de Lille)
University of Lille, France

Constructor Summary
PreferredSelectionNature()
          Constructor of a preferred selection nature.
 
Method Summary
abstract  PreferredSelectionNature<Element> clone()
          Clones the selection nature.
abstract  double getValueFor(Element e)
          Computes the value associated with a particular element.
 Element performSelection(java.util.List<Element> elements)
          Performs the selection of an element among a list of elements according to the provided nature.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PreferredSelectionNature

public PreferredSelectionNature()
Constructor of a preferred selection nature.

Method Detail

performSelection

public Element performSelection(java.util.List<Element> elements)
Description copied from interface: ElementSelectionNature
Performs the selection of an element among a list of elements according to the provided nature.

Specified by:
performSelection in interface ElementSelectionNature<Element>
Parameters:
elements - The set of elements in which selection is made.
Returns:
The selected element, or null if no element was selected.
See Also:
ElementSelectionNature.performSelection(java.util.List)

getValueFor

public abstract double getValueFor(Element e)
Computes the value associated with a particular element.

Parameters:
e - The element for which the preference/utility value is computed.
Returns:
the value associated with the element.

clone

public abstract PreferredSelectionNature<Element> clone()
Description copied from interface: ElementSelectionNature
Clones the selection nature.

Specified by:
clone in interface ElementSelectionNature<Element>
Overrides:
clone in class java.lang.Object
Returns:
the new instance, which is a clone of this instance.
See Also:
Object.clone()