Class AbstractOptimiser

    • Field Detail

      • m_bestf

        protected Double m_bestf
        curr best fitness.
      • m_bestv

        protected OptData m_bestv
        curr best vars .
    • Constructor Detail

      • AbstractOptimiser

        public AbstractOptimiser()
    • Method Detail

      • optimise

        public abstract OptData optimise​(OptData datadef,
                                         FitnessFunction fitness)
        Do the optimisation.
        Parameters:
        datadef - data initialisations.
        fitness - fitness function.
        Returns:
        best vars
      • cleanUp

        public void cleanUp()
        Default implementation does nothing.
        Specified by:
        cleanUp in interface CleanUpHandler
      • compareTo

        public int compareTo​(Object o)
        Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

        Only compares the commandlines of the two objects.
        Specified by:
        compareTo in interface Comparable
        Parameters:
        o - the object to be compared.
        Returns:
        a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
        Throws:
        ClassCastException - if the specified object's type prevents it from being compared to this object.
      • equals

        public boolean equals​(Object o)
        Returns whether the two objects are the same.

        Only compares the commandlines of the two objects.
        Overrides:
        equals in class Object
        Parameters:
        o - the object to be compared
        Returns:
        true if the object is the same as this one
      • shallowCopy

        public AbstractOptimiser shallowCopy()
        Returns a shallow copy of itself, i.e., based on the commandline options.
        Returns:
        the shallow copy
      • shallowCopy

        public AbstractOptimiser shallowCopy​(boolean expand)
        Returns a shallow copy of itself, i.e., based on the commandline options.
        Parameters:
        expand - whether to expand variables to their current values
        Returns:
        the shallow copy
      • getOptimisers

        public static String[] getOptimisers()
        Returns a list with classnames of optimiser.
        Returns:
        the optimiser classnames
      • forName

        public static AbstractOptimiser forName​(String classname,
                                                String[] options)
        Instantiates the optimiser with the given options.
        Parameters:
        classname - the classname of the optimiser to instantiate
        options - the options for the optimiser
        Returns:
        the instantiated optimiser or null if an error occurred
      • forCommandLine

        public static AbstractOptimiser forCommandLine​(String cmdline)
        Instantiates the optimiser from the given commandline (i.e., classname and optional options).
        Parameters:
        cmdline - the classname (and optional options) of the generator to instantiate
        Returns:
        the instantiated optimiser or null if an error occurred