<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def integrate(self, function, lower_bound, upper_bound):
 """ Calculates the integral of the given one dimensional function in the interval from lower_bound to upper_bound, with the simplex integration method. """

        ret = 0.0
        n = self.nsteps
        xStep = (float(upper_bound) - float(lower_bound)) / float(n)
        self.log_info("xStep" + str(xStep))
        x = lower_bound
        val1 = function(x)
        self.log_info("val1: " + str(val1))
        for i in range(n):
            x = (i + 1) * xStep + lower_bound
            self.log_info("x: " + str(x))
            val2 = function(x)
            self.log_info("val2: " + str(val2))
            ret += 0.5 * xStep * (val1 + val2)
            val1 = val2
        return ret