Package boofcv.struct
Class ConfigGenerator<Config extends Configuration>
java.lang.Object
boofcv.struct.ConfigGenerator<Config>
- Direct Known Subclasses:
ConfigGeneratorPatternSearchBase
,ConfigGeneratorRandom
Generates configuration. Intended for use in parameter tuning when you wish to sample a grid of values or randomly
sample possible settings.
Usage:
- Specify which parameters are to be sampled
- Call
initialize()
- Check
hasNext()
to see if there are more configs to generate - Call
next()
for a new instance of a config to test
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
assignValue
(Object config, String path, Object value) Assigns a field in the config to the specified value.protected void
Ensures that the parameter path is valid and assignable to the specified parameterReturns the most recently generated configuration.protected int
getNumberOfStates
(boofcv.struct.ConfigGenerator.Parameter p) Returns the number of possible states a parameter hasstatic Object
boolean
hasNext()
True if there are remaining trailsvoid
After all the parameters have been set, call this function to finalize internal variables and begin the generator.abstract Config
next()
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>>
voidsetOfEnums
(String parameter, Enum<E>... values) Assignment state is the set of enum values passed invoid
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 integersCreates a string which summarizes what settings are being configuredCreates a config which summarizes the current selected state
-
Field Details
-
rand
-
parameters
-
configurationBase
Base config that's modified when generating new configures -
configCurrent
The most recently generated configuration
-
-
Constructor Details
-
ConfigGenerator
-
-
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
Assignment state is the set of enum values passed in -
setOfIntegers
Assignment state is the finite set of passed in integers -
setOfFloats
Assignment state is the finite set of passed in floating point numbers. This works with 'float' and 'double' -
rangeOfIntegers
Assignment state is a finite set of integers with in the specified range of values.- Parameters:
parameter
- String path to the config parametermin
- Lower extent. Inclusive.max
- Upper extent. Inclusive.
-
rangeOfFloats
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 parametermin
- Lower extent. Inclusive.max
- Upper extent. Inclusive..
-
hasNext
public boolean hasNext()True if there are remaining trails -
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
Creates a string which summarizes what settings are being configured -
toStringState
Creates a config which summarizes the current selected state -
getConfiguration
Returns the most recently generated configuration. This is the same instance as whatnext()
returns. -
assignValue
Assigns a field in the config to the specified value. -
getValue
-
checkPath
Ensures that the parameter path is valid and assignable to the specified parameter
-