Class FullFactorialExperiment

    • Constructor Detail

      • FullFactorialExperiment

        public FullFactorialExperiment()
      • FullFactorialExperiment

        public FullFactorialExperiment​(@Nullable
                                       Experiment baseExperiment)
    • Method Detail

      • clearFactors

        public void clearFactors()
        Clears all configurations previously added using {@link #addFactorValue(...)}.
      • addFactorValue

        public void addFactorValue​(String name,
                                   Object value)
        Adds a configuration to test.
        Parameters:
        name - The factor name. This should be the name of a Java Beans Property of the base experiment, otherwise execution of the experiment will fail. In case value is a AbstractMultiConfExperiment.ComplexFactorSetter, name can be arbitrary.
        value - The value to test for factor name.
      • addFactor

        public <E extends Enum<?>> void addFactor​(String factorName,
                                                  Class<E> enumClass)

        Convenience method to set a factor "factorName" for all possible values of an enumeration.

        Say an experiment has a property "color" of type ColorEnum

         enum ColorEnum {
                RED, GREEN, BLUE
         }
         
        than calling addFactors("color",ColorEnum.class) would be equivalent to manually adding three configurations:
         addFactor("color", ColorEnum.RED);
         addFactor("color", ColorEnum.GREEN);
         addFactor("color", ColorEnum.BLUE);
         
        Type Parameters:
        E - Any enumeration type.
        Parameters:
        factorName - name of the factor.
        enumClass - The enumeration, of which all members will be used as a value.
        See Also:
        addFactorValue(String, Object)
      • addFactor

        public void addFactor​(String factorName,
                              Object... values)
        Convenience method to add all elements in values as a possible value for a factor/property factorName. This method is equivalent to repeatedly calling addFactorValue(String, Object) for each element in values.
        Parameters:
        factorName - Name of the factor.
        values - Values to use for this factor.
        See Also:
        addFactorValue(String, Object)
      • addFactor

        public void addFactor​(String factorName,
                              Collection<?> values)
        Convenience method to add all elements in values as a possible value for a factor/property factorName. This method is equivalent to repeatedly calling addFactorValue(String, Object) for each element in values.
        Parameters:
        factorName - Name of the factor.
        values - A collection of values to use for this factor.
        See Also:
        addFactorValue(String, Object)
      • getFactorNames

        public Collection<String> getFactorNames()
        Returns a read-only collection of all factor names that are currently defined.
        Returns:
        A collection of all factor names.
      • getFactorValues

        public List<?> getFactorValues​(String name)
        Returns a list with all values of a certain factor.
        Parameters:
        name - A factor name.
        Returns:
        A list with all values for the given factor name.
      • addExperimentForConf

        protected void addExperimentForConf​(int[] conf)
      • setCommonRandomNumbers

        public void setCommonRandomNumbers​(boolean commonRandomNumbers)
        Description copied from class: AbstractMultiExperiment
        Whether to use the variance reduction technique of common random numbers. If set to true, all sub-experiments are executed using the same random seed, so random influences will be the same for all sub-experiments. If set to false, all sub-experiments will be assigned a different initialSeed, depending only on this experiment's initialSeed.
        Overrides:
        setCommonRandomNumbers in class AbstractMultiExperiment
        Parameters:
        commonRandomNumbers - Whether or not all sub-experiments are assigned the same initialSeed.
      • getMaxConfigurations

        public int getMaxConfigurations()
        Returns the current setting for the maximum number of configurations to run.
        Returns:
        The maximum number of configurations.
      • setMaxConfigurations

        public void setMaxConfigurations​(int maxConfigurations)
        Sets the maximum number of configurations (i.e., sub-experiments) that are allowed to execute. The default value is 1,000,000. If there are more valid configurations/factor combinations, then the FullFactorialExperiment will abort in the initialization phase.
        Parameters:
        maxConfigurations - The maximum number of configurations to allow.