Пример #1
0
 def __init__(self, application_gui):
     self.application_gui = application_gui
     ConsoleLogger.set_output_stream(self.application_gui.consoleTextArea)
     self.consoleLogger = ConsoleLogger.get_instance()
     ResultLogger.set_output_stream(self.application_gui.resultTextArea)
     self.resultLogger = ResultLogger.get_instance()
     self.goal_function = GoalFunction()  # goal function of an algorithm
 def __init__(self):
     self.console_logger = ConsoleLogger.get_instance()
     self.console_logger.log("Base class properties initializing...", LoggerLevel.DEBUG)
     self.start_boundary = [-5., -5.]
     self.stop_boundary = [5., 5.]
     self.resolution = [0.1, 0.1]
     self.console_logger.log("Base class properties initialized", LoggerLevel.DEBUG)
Пример #3
0
 def __init__(self,
              expression,
              start,
              stop,
              resolution,
              tolerance=0.1,
              debug=False):
     """
     :param expression: expression of the goal function
     :param start: begin of the function range
     :param stop: end of the function range
     :param resolution: resolution of points
     :param tolerance: tolerance of calculations
     :param tau: length of step
     """
     GradientAlgorithm.__init__(self, expression, start, stop, resolution)
     self.console_logger = ConsoleLogger.get_instance()
     self.expression = expression
     self.start = start
     self.stop = stop
     self.tolerance = tolerance
     self.current_point = np.array([[0], [0]])
     self.next_point = np.array([[0], [0]])
     self.iteration = 0
     self.max_nr_of_iterations = 100
     self.minimum_found = False
     self.debug = debug
 def __init__(self):
     self.console_logger = ConsoleLogger.get_instance()
     self.console_logger.log("Base class properties initializing...",
                             LoggerLevel.DEBUG)
     self.start_boundary = [-5., -5.]
     self.stop_boundary = [5., 5.]
     self.resolution = [0.1, 0.1]
     self.console_logger.log("Base class properties initialized",
                             LoggerLevel.DEBUG)
Пример #5
0
 def __init__(self, initial_function=None):
     self.console_logger = ConsoleLogger.get_instance()  # get logger
     self.console_logger.log("Goal function initializing...", LoggerLevel.DEBUG)
     self.__expression = ""                              # function expression
     self.__function_name = ""                           # function simple name
     self.__variables = ['x', 'y']                       # variables in function
     self.__parser = Parser()                            # function parser
     self.__correctly_parsed = True                      # whether the function was correctly parsed
     self.set_goal_function("x ^ 4 * (y + 1) ^ 2 + y ^ 4 * (x + 1) ^ 2")     # set some default function
     if initial_function:                                                    # if to constructor was passed function
         self.set_goal_function(initial_function)                            # try to set it
     self.console_logger.log("Goal function initialized", LoggerLevel.DEBUG)
Пример #6
0
 def __init__(self, initial_function=None):
     self.console_logger = ConsoleLogger.get_instance()  # get logger
     self.console_logger.log("Goal function initializing...",
                             LoggerLevel.DEBUG)
     self.__expression = ""  # function expression
     self.__function_name = ""  # function simple name
     self.__variables = ['x', 'y']  # variables in function
     self.__parser = Parser()  # function parser
     self.__correctly_parsed = True  # whether the function was correctly parsed
     self.set_goal_function("x ^ 4 * (y + 1) ^ 2 + y ^ 4 * (x + 1) ^ 2"
                            )  # set some default function
     if initial_function:  # if to constructor was passed function
         self.set_goal_function(initial_function)  # try to set it
     self.console_logger.log("Goal function initialized", LoggerLevel.DEBUG)