Package repast.simphony.parameter
Class ParameterSweeperBuilder
java.lang.Object
repast.simphony.parameter.ParameterSweeperBuilder
Builder for creating parameter sweepers and Parameters for all the
parameters in the created sweeper.
- Version:
- $Revision$ $Date$
- Author:
- Nick Collier
-
Constructor Summary
ConstructorDescriptionCreates a ParametertSweeperBuilderCreates ParameterSweeperBuilder with the specified ParameterTreeSweeper. -
Method Summary
Modifier and TypeMethodDescription<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.<T> ParameterSetter
addListSetter
(String name, T[] list) Adds a list setter with the specified name and list elements.<T> ParameterSetter
addListSetter
(ParameterSetter parent, String name, T[] list) Adds a list setter with the specified name and list elements.addStepper
(String name, double start, double end, double step) Adds a double parameter stepper with the specified name and value.addStepper
(String name, float start, float end, float step) Adds a float parameter stepper with the specified name and value.addStepper
(String name, int start, int end, int step) Adds an int parameter stepper with the specified name and value.addStepper
(String name, long start, long end, long step) Adds a long parameter stepper with the specified name and value.addStepper
(ParameterSetter parent, String name, double start, double end, double step) Adds a double parameter stepper with the specified name and value.addStepper
(ParameterSetter parent, String name, float start, float end, float step) Adds a float parameter stepper with the specified name and value.addStepper
(ParameterSetter parent, String name, int start, int end, int step) Adds an int parameter stepper with the specified name and value.addStepper
(ParameterSetter parent, String name, long start, long end, long step) Adds a long parameter stepper with the specified name and value.Gets the Parameters built from the added setters.Gets the root parameter setter.Gets the added ParameterSetter for the named parameterGets the ParameterTreeSweeper containing the added parameter setters.void
setRunCount
(int runs) Sets the number of runs the sweeper should perform.
-
Constructor Details
-
ParameterSweeperBuilder
public ParameterSweeperBuilder()Creates a ParametertSweeperBuilder -
ParameterSweeperBuilder
Creates ParameterSweeperBuilder with the specified ParameterTreeSweeper.- Parameters:
sweeper
- the sweeper to use
-
-
Method Details
-
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
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 onvalue
- the contant value of the parameter- Returns:
- the created ConstantSetter.
-
addStepper
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 onstart
- the starting value of the stepperend
- the ending value of the stepperstep
- 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 onstart
- the starting value of the stepperend
- the ending value of the stepperstep
- the amount to increment / decrement the stepper- Returns:
- the created ParameterSetter.
-
addStepper
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 onstart
- the starting value of the stepperend
- the ending value of the stepperstep
- 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 onstart
- the starting value of the stepperend
- the ending value of the stepperstep
- the amount to increment / decrement the stepper- Returns:
- the created ParameterSetter.
-
addStepper
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 onstart
- the starting value of the stepperend
- the ending value of the stepperstep
- 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 onstart
- the starting value of the stepperend
- the ending value of the stepperstep
- the amount to increment / decrement the stepper- Returns:
- the created ParameterSetter.
-
addStepper
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 onstart
- the starting value of the stepperend
- the ending value of the stepperstep
- 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 onstart
- the starting value of the stepperend
- the ending value of the stepperstep
- the amount to increment / decrement the stepper- Returns:
- the created ParameterSetter.
-
addListSetter
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 onlist
- the list of values to set the parameter to- Returns:
- the created ParameterSetter
-
addListSetter
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 settername
- the name of the parameter this setter will operate onlist
- the list of values to set the parameter to- Returns:
- the created ParameterSetter
-
getSetter
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
Gets the ParameterTreeSweeper containing the added parameter setters.- Returns:
- the ParameterTreeSweeper containing the added parameter setters.
-
getParameters
Gets the Parameters built from the added setters.- Returns:
- the Parameters built from the added setters.
-