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

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

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

The random selection nature.

This provides a tool to select an element at random among a list of elements.

This class has 3 static values, corresponding to the 3 possible random selections (random selection on RealizableTuples, on AbstractInteraction or on Target Agent).

Random numbers are provided by the SimulationProperties class.

Version:
JEDI V 2.2
Created the 7th nov. 2008
Modified 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
See Also:
SimulationProperties

Field Summary
static RandomSelectionNature<Agent> RANDOM_AGENT
          Instance of random selection nature that selects agents at random.
static RandomSelectionNature<AbstractInteraction<?>> RANDOM_INTERACTION
          Instance of random selection nature that selects interactions at random.
static RandomSelectionNature<AbstractRealizableTuple<?>> RANDOM_REALIZABLE_TUPLE
          Instance of random selection nature that selects agents at random.
 
Method Summary
 RandomSelectionNature<Element> clone()
          Clones the selection nature.
 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
 

Field Detail

RANDOM_INTERACTION

public static final RandomSelectionNature<AbstractInteraction<?>> RANDOM_INTERACTION
Instance of random selection nature that selects interactions at random.


RANDOM_AGENT

public static final RandomSelectionNature<Agent> RANDOM_AGENT
Instance of random selection nature that selects agents at random.


RANDOM_REALIZABLE_TUPLE

public static final RandomSelectionNature<AbstractRealizableTuple<?>> RANDOM_REALIZABLE_TUPLE
Instance of random selection nature that selects agents at random.

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(List)

clone

public RandomSelectionNature<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()