Documentation of 'org.encog.util.obj.ChooseObject' Java class
ChooseObject
org.encog.util.obj

Class ChooseObject<T>

  • Type Parameters:
    T - The type of object to choose from.
    All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    OperationList


    public class ChooseObject<T>
    extends java.lang.Object
    implements java.io.Serializable
    This class is used to choose between several objects with a specified probability.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      ChooseObject() 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void add(double probability, T opp)
      Add an object.
      void clear()
      CLear all objects from the collection.
      void finalizeStructure()
      Finalize the structure and set the probabilities.
      java.util.List<ObjectHolder<T>> getList() 
      T pick(java.util.Random theGenerator)
      Choose a random object.
      T pickFirst() 
      int size() 
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ChooseObject

        public ChooseObject()
    • Method Detail

      • finalizeStructure

        public void finalizeStructure()
        Finalize the structure and set the probabilities.
      • add

        public void add(double probability,
                        T opp)
        Add an object.
        Parameters:
        probability - The probability to choose this object.
        opp - The object to add.
      • size

        public int size()
        Returns:
        The number of objects added.
      • pick

        public T pick(java.util.Random theGenerator)
        Choose a random object.
        Parameters:
        theGenerator - Random number generator.
        Returns:
        The random choice.
      • getList

        public java.util.List<ObjectHolder<T>> getList()
        Returns:
        The object to choose from.
      • clear

        public void clear()
        CLear all objects from the collection.
      • pickFirst

        public T pickFirst()
        Returns:
        The first object in the list.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.