Package boofcv.struct

Class ConfigGenerator<Config extends Configuration>

java.lang.Object
boofcv.struct.ConfigGenerator<Config>
Direct Known Subclasses:
ConfigGeneratorPatternSearchBase, ConfigGeneratorRandom

public abstract class ConfigGenerator<Config extends Configuration> extends Object
Generates configuration. Intended for use in parameter tuning when you wish to sample a grid of values or randomly sample possible settings. Usage:
  1. Specify which parameters are to be sampled
  2. Call initialize()
  3. Check hasNext() to see if there are more configs to generate
  4. Call next() for a new instance of a config to test
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected Config
    The most recently generated configuration
    protected Config
    Base config that's modified when generating new configures
    protected List<boofcv.struct.ConfigGenerator.Parameter>
     
    protected Random
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    ConfigGenerator(long seed, Class<Config> type)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    assignValue(Object config, String path, Object value)
    Assigns a field in the config to the specified value.
    protected void
    checkPath(String parameter, Class<?> variableType)
    Ensures that the parameter path is valid and assignable to the specified parameter
    Returns the most recently generated configuration.
    protected int
    getNumberOfStates(boofcv.struct.ConfigGenerator.Parameter p)
    Returns the number of possible states a parameter has
    static Object
    getValue(Object config, String path)
     
    boolean
    True if there are remaining trails
    void
    After all the parameters have been set, call this function to finalize internal variables and begin the generator.
    abstract Config
    Generates the next config and returns it.
    void
    rangeOfFloats(String parameter, double min, double max)
    Assignment state is a finite set of floats with in the specified range of values.
    void
    rangeOfIntegers(String parameter, int min, int max)
    Assignment state is a finite set of integers with in the specified range of values.
    <E extends Enum<E>>
    void
    setOfEnums(String parameter, Enum<E>... values)
    Assignment state is the set of enum values passed in
    void
    setOfFloats(String parameter, double... values)
    Assignment state is the finite set of passed in floating point numbers.
    void
    setOfIntegers(String parameter, int... values)
    Assignment state is the finite set of passed in integers
    Creates a string which summarizes what settings are being configured
    Creates a config which summarizes the current selected state

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • rand

      protected Random rand
    • parameters

      protected List<boofcv.struct.ConfigGenerator.Parameter> parameters
    • configurationBase

      protected Config extends Configuration configurationBase
      Base config that's modified when generating new configures
    • configCurrent

      protected Config extends Configuration configCurrent
      The most recently generated configuration
  • Constructor Details

    • ConfigGenerator

      protected ConfigGenerator(long seed, Class<Config> type)
  • Method Details

    • initialize

      public void initialize()
      After all the parameters have been set, call this function to finalize internal variables and begin the generator. Up until this function is called, any changes in the baseline will be reflected in later calls
    • getNumberOfStates

      protected int getNumberOfStates(boofcv.struct.ConfigGenerator.Parameter p)
      Returns the number of possible states a parameter has
    • setOfEnums

      public <E extends Enum<E>> void setOfEnums(String parameter, Enum<E>... values)
      Assignment state is the set of enum values passed in
    • setOfIntegers

      public void setOfIntegers(String parameter, int... values)
      Assignment state is the finite set of passed in integers
    • setOfFloats

      public void setOfFloats(String parameter, double... values)
      Assignment state is the finite set of passed in floating point numbers. This works with 'float' and 'double'
    • rangeOfIntegers

      public void rangeOfIntegers(String parameter, int min, int max)
      Assignment state is a finite set of integers with in the specified range of values.
      Parameters:
      parameter - String path to the config parameter
      min - Lower extent. Inclusive.
      max - Upper extent. Inclusive.
    • rangeOfFloats

      public void rangeOfFloats(String parameter, double min, double max)
      Assignment state is a finite set of floats with in the specified range of values. Works with float and double valued parameters.
      Parameters:
      parameter - String path to the config parameter
      min - Lower extent. Inclusive.
      max - Upper extent. Inclusive..
    • hasNext

      public boolean hasNext()
      True if there are remaining trails
    • next

      public abstract Config next()
      Generates the next config and returns it. Each call will return a new instance of Config
      Returns:
      New instance of the next Config variant.
    • toStringSettings

      public String toStringSettings()
      Creates a string which summarizes what settings are being configured
    • toStringState

      public String toStringState()
      Creates a config which summarizes the current selected state
    • getConfiguration

      public Config getConfiguration()
      Returns the most recently generated configuration. This is the same instance as what next() returns.
    • assignValue

      public static void assignValue(Object config, String path, Object value)
      Assigns a field in the config to the specified value.
    • getValue

      public static Object getValue(Object config, String path)
    • checkPath

      protected void checkPath(String parameter, Class<?> variableType)
      Ensures that the parameter path is valid and assignable to the specified parameter