Class ParameterTreeSweeper

  • All Implemented Interfaces:
    ParameterSetter, ParameterSweeper
    Direct Known Subclasses:
    OptimizedParameterSweeper

    public class ParameterTreeSweeper
    extends Object
    implements ParameterSweeper
    The default implementation of a parameter sweeper. This will just next through all its ParameterSetters always performing the nexts in the same way.

    For a given parameter tree this sweeper will:
    First, execute a next on all of the elements in the tree generating a base set of parameters that will be executed.
    Second, execute the leaves of the tree until they are finished. After one finishes it will next the parent of that item, and then execute its subleaves again. In other words, the lowest levels are executed until they are finished, as they finish their parents are then called, followed by calling the lower levels again. Finish propagates upwards until everything has finished.

    Author:
    Jerry Vos
    • Constructor Detail

      • ParameterTreeSweeper

        public ParameterTreeSweeper()
        Default constructor.
    • Method Detail

      • next

        public void next​(Parameters params)
        Executes the ParameterSetters as specified in this class's description.
        Specified by:
        next in interface ParameterSetter
        Parameters:
        params - the parameters object to load settings into
      • childrenFinished

        protected boolean childrenFinished​(ParameterSetter parent)
      • add

        public void add​(ParameterSetter setter)
        Adds the given ParameterSetter to be executed as a direct descendent of previously added node. The last added setter will be the "innermost" setter executed during a sweep.

        All convenience methods use this method.

        (This supports the typical usage where we simply intend to create an n-D cube space to sweep through.

        Parameters:
        setter - a parameter setter that will be executed
      • addToRoot

        public void addToRoot​(ParameterSetter setter)
        Adds the specified parameter setter as a child of the root.
        Parameters:
        setter - the setter to add
      • addIntRange

        public void addIntRange​(String param,
                                int base,
                                int max,
                                int step)
        Adds a sweep dimension for the specifed integer parameter -- that is, for every run currently defined for this sweeper, runs will now be made for each step from base to max. (Conveience method.)
        Parameters:
        param - parameter name
        base - starting value
        max - ending value
        step - added to current value to get next
      • addDoubleRange

        public void addDoubleRange​(String param,
                                   double base,
                                   double max,
                                   double step)
        Adds a sweep dimension for the specifed double parameter -- that is, for every run currently defined for this sweeper, runs will now be made for each step from base to max. (Conveience method.)
        Parameters:
        param - parameter name
        base - starting value
        max - ending value
        step - added to current value to get next
      • setRunCount

        public void setRunCount​(int count)
        Sets the number of time that the sweeper should execute a run for each unique parameter combination. Note: this method only manages the default run initialzer that will be placed just below root. If a RunParameterSetter is also added elsewhere, that intializer will also create new runs. Also, if new runs are added directly to root (e.g., not using conveinience methods) those runs may not be subject to this count.
        Parameters:
        count - number of runs to execute for each combination of paramaters
      • getRunCount

        public int getRunCount()