From 8189116ea4b5db4675e31dfd04a5687d55e29262 Mon Sep 17 00:00:00 2001 From: Eduardo Pedroni Date: Tue, 6 May 2014 14:29:37 +0100 Subject: Added javadocs, made minor changes to the comments --- doc/jcgp/backend/function/FunctionSet.html | 452 +++++++++++++++++++++++++++++ 1 file changed, 452 insertions(+) create mode 100644 doc/jcgp/backend/function/FunctionSet.html (limited to 'doc/jcgp/backend/function/FunctionSet.html') diff --git a/doc/jcgp/backend/function/FunctionSet.html b/doc/jcgp/backend/function/FunctionSet.html new file mode 100644 index 0000000..cca036d --- /dev/null +++ b/doc/jcgp/backend/function/FunctionSet.html @@ -0,0 +1,452 @@ + + + + + +FunctionSet + + + + + + + + +
+ + + + + + + +
+ + + +
+
jcgp.backend.function
+

Class FunctionSet

+
+
+ +
+
    +
  • +
    +
    Direct Known Subclasses:
    +
    DigitalCircuitFunctions, SymbolicRegressionFunctions, TravellingSalesmanFunctions
    +
    +
    +
    +
    public abstract class FunctionSet
    +extends java.lang.Object
    +
    FunctionSet encapsulates a group of functions. This is done to + simplify the implementation of problem types. +

    + FunctionSet contains a variety of useful methods for acquiring general + information, such as the maximum arity across all functions and the total + number of functions. +

    + In addition, FunctionSet offers the ability to enable and disable functions. + Accessing the functions through getAllowedFunction() will return + allowed functions only, providing an easy way to control which functions + can be used in mutations. +

    + An implementation of FunctionSet must simply use its constructor to set + the name field and use registerFunctions() to add the required + functions.
    +
    +
    Author:
    +
    Eduardo Pedroni
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        FunctionSet

        +
        public FunctionSet()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getAllowedFunctionCount

        +
        public int getAllowedFunctionCount()
        +
        +
        Returns:
        +
        the number of currently allowed functions.
        +
        +
      • +
      + + + +
        +
      • +

        getTotalFunctionCount

        +
        public int getTotalFunctionCount()
        +
        +
        Returns:
        +
        the total number of functions, including disabled ones.
        +
        +
      • +
      + + + +
        +
      • +

        getAllowedFunction

        +
        public Function getAllowedFunction(int index)
        +
        Returns an allowed function. This throws an + ArrayIndexOutOfBoundsException if the supplied + index is beyond the count of allowed functions.
        +
        +
        Parameters:
        +
        index - the allowed function index.
        +
        Returns:
        +
        the allowed function object.
        +
        +
      • +
      + + + +
        +
      • +

        getFunction

        +
        public Function getFunction(int index)
        +
        Returns a function from the complete collection, + enabled or disabled alike. This throws an + ArrayIndexOutOfBoundsException if the supplied + index is beyond the count of allowed functions.
        +
        +
        Parameters:
        +
        index - the function index.
        +
        Returns:
        +
        the function object.
        +
        +
      • +
      + + + +
        +
      • +

        getMaxArity

        +
        public int getMaxArity()
        +
        Computes and returns the maximum arity out of + all enabled functions.
        +
        +
        Returns:
        +
        the problem's current maximum arity.
        +
        +
      • +
      + + + +
        +
      • +

        disableFunction

        +
        public void disableFunction(int index)
        +
        Disables the indexed function. If the function + is already disabled, this does nothing.
        +
        +
        Parameters:
        +
        index - the function to disable.
        +
        +
      • +
      + + + +
        +
      • +

        enableFunction

        +
        public void enableFunction(int index)
        +
        Disables the indexed function. If the function is + already enabled, this does nothing.
        +
        +
        Parameters:
        +
        index - the function to disable.
        +
        +
      • +
      + + + +
        +
      • +

        isEnabled

        +
        public boolean isEnabled(Function function)
        +
        Checks if a specified function is enabled. If the function + does not belong in the FunctionSet, this returns false.
        +
        +
        Parameters:
        +
        function - the function to check.
        +
        Returns:
        +
        true if the function is enabled.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + -- cgit v1.2.3