As each algorithm needs various parameter as input, we developed generic objects to declare these parameters. Each algorithm factory declares a list of SMCParameter objects. This list is then used by PLASMA Lab to retrieve correct values from the user.
First we present each type of parameters. Then we describes the way a list of parameter is used and values retrieved by PLASMA Lab.
The SMCParameter class is the parent class of all other parameters. Its basic attributes are a name, a tip and boolean defining if the parameter represents a boolean value or not.
Used as is, a SMCParameter represents a simple text, double or boolean value.
A SMCOption is a boolean parameter containing a list of other SMCParameters. If the SMCOption is set to true, its children parameters are enabled and can be filled by the user.
The SMCOption behaves like a check box object, and is represented by one in the PLASMA Lab GUI.
A SMCAlternatives is a boolean parameter containing a list of other SMCParameters and pointing to another SMCAlternatives (linked list mechanism). If the SMCAlternatives is set to true, its children parameters are enabled and can be filled while every other SMCAlternatives in the linked list are set to false.
The SMCAlternatives behaves like a radio button object, and is represented by one in the PLASMA Lab GUI.
A SMCObjectParameter defines a parameter as an AbstractModel. It is specifically used in the CUSUM algorithm which needs to be executed on two different models (the basic GUI can only select one model).
The SMCObjectParameter is interpreted by the PLASMA Lab GUI as a ComboBox containing models from the currently selected projet.
AlgorithmFactory object define a list of SMCParameter corresponding to their algorithm. This list is accessed by the ParametersPanel class using the getParametersList method. A widget (CheckBox, RadioButton, TextField, ...) is created for each parameter, including children parameters. Some widget depends on their parent widget to be enabled.
When launching a new experiment, the ExperimentPanel access to the ParametersPanel corresponding to the selected algorithm and retrieves a Map of String -> Object pairs. For each pair, a String corresponds to the name of the parameter (as provided by the AlgorithmFactory and displayed on the widget) and the Object is the value of the parameter. As said previously, the value could be of type Boolean, String, or even AbstractModel.
Additional parameters may be added to the map such as distributed which informs the system if a distributed version of an algorithm should be used.
The Map and the selected AlgorithmFactory is then transmitted to the ExperimentationManager. The ExperimentationManager calls the createScheduler function on the factory and passes the Map as an argument. This function returns an InterfaceAlgorithmScheduler set and ready to be executed.
The previous method to retrieve parameters values requires the use of widget which may be unavailable in some use case (Terminal, interface with another tool, ...). To solve this issue, the InterfaceAlgorithmFactory provides the fillParametersMap method. This method takes a Map of String -> Object pairs and a String array as parameters. This method will then fill the Map with informations of the array. The content and order of information in the String array is entirely dependant of the InterfaceAlgorithmFactory implementation.
When setting an experiment, the user will fill the String array by entering Strings separated by whitespace.