Package moa.options
Class DependentOptionsUpdater
- java.lang.Object
-
- moa.options.DependentOptionsUpdater
-
- All Implemented Interfaces:
Serializable
,EventListener
,ChangeListener
public class DependentOptionsUpdater extends Object implements ChangeListener, Serializable
This class handles the dependency between two options by updating the dependent option whenever the option it is depending on changes.- Version:
- $Revision: 1 $
- Author:
- Cornelius Styp von Rekowski (cornelius.styp@ovgu.de)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ClassOptionWithListenerOption
evalTaskOption
protected String
lastEvalTaskCLIString
protected EditableMultiChoiceOption
variedParamNameOption
-
Constructor Summary
Constructors Constructor Description DependentOptionsUpdater(ClassOptionWithListenerOption learnerOption, EditableMultiChoiceOption variedParamNameOption)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Option
getVariedOption(OptionHandler learner, String variedParamName)
Resolve the name of the varied parameter and return the corresponding option.void
refreshVariedParamNameOption()
Refresh the provided choices of an EditableMultiChoiceOption every time a ClassOption (the prequential evaluation task) is changed.void
stateChanged(ChangeEvent e)
-
-
-
Field Detail
-
lastEvalTaskCLIString
protected String lastEvalTaskCLIString
-
evalTaskOption
protected ClassOptionWithListenerOption evalTaskOption
-
variedParamNameOption
protected EditableMultiChoiceOption variedParamNameOption
-
-
Constructor Detail
-
DependentOptionsUpdater
public DependentOptionsUpdater(ClassOptionWithListenerOption learnerOption, EditableMultiChoiceOption variedParamNameOption)
-
-
Method Detail
-
stateChanged
public void stateChanged(ChangeEvent e)
- Specified by:
stateChanged
in interfaceChangeListener
-
refreshVariedParamNameOption
public void refreshVariedParamNameOption()
Refresh the provided choices of an EditableMultiChoiceOption every time a ClassOption (the prequential evaluation task) is changed. This method checks if the chosen task actually changed, before updating the MultiChoiceOption.
The method looks for available options in the learner option of the prequential evaluation task and recursively in all of its ClassOptions.
Only Int and Float options are shown in the MultiChoiceOption, because only numeric parameters should be variable.
If one of the options is named "budget" or its name contains the word "budget", it is selected as the default option.
-
getVariedOption
public static Option getVariedOption(OptionHandler learner, String variedParamName)
Resolve the name of the varied parameter and return the corresponding option. The varied parameter name has the format "learner/suboptions.../numberOption". If no matching parameter can be found,null
is returned.- Parameters:
learner
- the learner object that has the varied optionvariedParamName
- name of the (nested) varied parameter- Returns:
- varied option
-
-