(self, function)
return result
Choose an action to take using the given function.

        Function will be called with the arguments (start state, current state,
        time of most recent update). It may return "reset" or "set_target" to
        call the corresponding method, or any other value to do nothing.  The
        function's return value is passed through this method, so can be used
        to take further actions elsewhere.
Choose an action to take using the given function.
Choose an action to take using the given function .
def choose_action_using(self, function):
        """
        Choose an action to take using the given function.

        Function will be called with the arguments (start state, current state,
        time of most recent update). It may return "reset" or "set_target" to
        call the corresponding method, or any other value to do nothing.  The
        function's return value is passed through this method, so can be used
        to take further actions elsewhere.
        """
        current_state = self._record_state()

        result = function(self.start_state, current_state, self.update_time)
        if result == "reset":
            self._reset(current_state)
        elif result == "set_target":
            self._set_target(current_state)

        return result
def choose_action_using ( self , function ) : current_state = self . _record_state ( ) result = function ( self . start_state , current_state , self . update_time ) if result == "reset" : self . _reset ( current_state ) elif result == "set_target" : self . _set_target ( current_state ) return result