Class ParameterSweeperBuilder


  • public class ParameterSweeperBuilder
    extends Object
    Builder for creating parameter sweepers and Parameters for all the parameters in the created sweeper.
    Version:
    $Revision$ $Date$
    Author:
    Nick Collier
    • Constructor Detail

      • ParameterSweeperBuilder

        public ParameterSweeperBuilder()
        Creates a ParametertSweeperBuilder
      • ParameterSweeperBuilder

        public ParameterSweeperBuilder​(ParameterTreeSweeper sweeper)
        Creates ParameterSweeperBuilder with the specified ParameterTreeSweeper.
        Parameters:
        sweeper - the sweeper to use
    • Method Detail

      • getRootSetter

        public ParameterSetter getRootSetter()
        Gets the root parameter setter.
        Returns:
        the root parameter setter.
      • setRunCount

        public void setRunCount​(int runs)
        Sets the number of runs the sweeper should perform.
        Parameters:
        runs - the number of runs the sweeper should perform
      • addConstant

        public <T> ParameterSetter addConstant​(String name,
                                               T value)
        Adds the a constant parameter setter for the specified parameter and with the specified value to the sweeper.
        Parameters:
        name - the name of the parameter this setter will operate on
        value - the contant value of the parameter
        Returns:
        the created ConstantSetter.
      • addStepper

        public ParameterSetter addStepper​(String name,
                                          int start,
                                          int end,
                                          int step)
        Adds an int parameter stepper with the specified name and value. The stepper will be added to the sweeper as a child parameter setter of the most recently added parameter setter.
        Parameters:
        name - the name of the parameter that this stepper will operate on
        start - the starting value of the stepper
        end - the ending value of the stepper
        step - the amount to increment / decrement the stepper
        Returns:
        the created ParameterSetter.
      • addStepper

        public ParameterSetter addStepper​(ParameterSetter parent,
                                          String name,
                                          int start,
                                          int end,
                                          int step)
        Adds an int parameter stepper with the specified name and value. The stepper will be added to the sweeper tree as a child of the specified parent.
        Parameters:
        parent - the created parameter setter will be added as a child to this parent in the sweeper tree.
        name - the name of the parameter that this stepper will operate on
        start - the starting value of the stepper
        end - the ending value of the stepper
        step - the amount to increment / decrement the stepper
        Returns:
        the created ParameterSetter.
      • addStepper

        public ParameterSetter addStepper​(String name,
                                          double start,
                                          double end,
                                          double step)
        Adds a double parameter stepper with the specified name and value. The stepper will be added to the sweeper as a child parameter setter of the most recently added parameter setter.
        Parameters:
        name - the name of the parameter that this stepper will operate on
        start - the starting value of the stepper
        end - the ending value of the stepper
        step - the amount to increment / decrement the stepper
        Returns:
        the created ParameterSetter.
      • addStepper

        public ParameterSetter addStepper​(ParameterSetter parent,
                                          String name,
                                          double start,
                                          double end,
                                          double step)
        Adds a double parameter stepper with the specified name and value. The stepper will be added to the sweeper tree as a child of the specified parent.
        Parameters:
        parent - the created parameter setter will be added as a child to this parent in the sweeper tree.
        name - the name of the parameter that this stepper will operate on
        start - the starting value of the stepper
        end - the ending value of the stepper
        step - the amount to increment / decrement the stepper
        Returns:
        the created ParameterSetter.
      • addStepper

        public ParameterSetter addStepper​(String name,
                                          float start,
                                          float end,
                                          float step)
        Adds a float parameter stepper with the specified name and value. The stepper will be added to the sweeper as a child parameter setter of the most recently added parameter setter.
        Parameters:
        name - the name of the parameter that this stepper will operate on
        start - the starting value of the stepper
        end - the ending value of the stepper
        step - the amount to increment / decrement the stepper
        Returns:
        the created ParameterSetter.
      • addStepper

        public ParameterSetter addStepper​(ParameterSetter parent,
                                          String name,
                                          float start,
                                          float end,
                                          float step)
        Adds a float parameter stepper with the specified name and value. The stepper will be added to the sweeper tree as a child of the specified parent.
        Parameters:
        parent - the created parameter setter will be added as a child to this parent in the sweeper tree.
        name - the name of the parameter that this stepper will operate on
        start - the starting value of the stepper
        end - the ending value of the stepper
        step - the amount to increment / decrement the stepper
        Returns:
        the created ParameterSetter.
      • addStepper

        public ParameterSetter addStepper​(String name,
                                          long start,
                                          long end,
                                          long step)
        Adds a long parameter stepper with the specified name and value. The stepper will be added to the sweeper as a child parameter setter of the most recently added parameter setter.
        Parameters:
        name - the name of the parameter that this stepper will operate on
        start - the starting value of the stepper
        end - the ending value of the stepper
        step - the amount to increment / decrement the stepper
        Returns:
        the created ParameterSetter.
      • addStepper

        public ParameterSetter addStepper​(ParameterSetter parent,
                                          String name,
                                          long start,
                                          long end,
                                          long step)
        Adds a long parameter stepper with the specified name and value. The stepper will be added to the sweeper tree as a child of the specified parent.
        Parameters:
        parent - the created parameter setter will be added as a child to this parent in the sweeper tree.
        name - the name of the parameter that this stepper will operate on
        start - the starting value of the stepper
        end - the ending value of the stepper
        step - the amount to increment / decrement the stepper
        Returns:
        the created ParameterSetter.
      • addListSetter

        public <T> ParameterSetter addListSetter​(String name,
                                                 T[] list)
        Adds a list setter with the specified name and list elements. The setter will be added to the sweeper tree as a child of the most recently added parameter setter.
        Parameters:
        name - the name of the parameter this setter will operate on
        list - the list of values to set the parameter to
        Returns:
        the created ParameterSetter
      • addListSetter

        public <T> ParameterSetter addListSetter​(ParameterSetter parent,
                                                 String name,
                                                 T[] list)
        Adds a list setter with the specified name and list elements. The setter will be added to the sweeper tree as a child of the specified parent
        Parameters:
        parent - the created parameter setter will be added as a child of this parent setter
        name - the name of the parameter this setter will operate on
        list - the list of values to set the parameter to
        Returns:
        the created ParameterSetter
      • getSetter

        public ParameterSetter getSetter​(String name)
        Gets the added ParameterSetter for the named parameter
        Parameters:
        name - the name of the parameter whose setter we want to get
        Returns:
        the ParameterSetter for the named parameter or null if no such parameter setter can be found.
      • getSweeper

        public ParameterTreeSweeper getSweeper()
        Gets the ParameterTreeSweeper containing the added parameter setters.
        Returns:
        the ParameterTreeSweeper containing the added parameter setters.
      • getParameters

        public Parameters getParameters()
        Gets the Parameters built from the added setters.
        Returns:
        the Parameters built from the added setters.