parameters: (self, energy_new, energy_old)
return_statement: return w >= rand
docstring: If new energy is lower than old, it will always be accepted.
          If new is higher than old, there is a chance it will be accepted,
          less likely for larger differences.
docstring_summary: If new energy is lower than old, it will always be accepted.
          If new is higher than old, there is a chance it will be accepted,
          less likely for larger differences.
docstring_tokens: If new energy is lower than old it will always be accepted . If new is higher than old there is a chance it will be accepted less likely for larger differences .
function: def accept_reject(self, energy_new, energy_old):
          """
          If new energy is lower than old, it will always be accepted.
          If new is higher than old, there is a chance it will be accepted,
          less likely for larger differences.
          """
          w = math.exp(min(0, -float(energy_new - energy_old) * self.beta))
          rand = self.random_state.rand()
          return w >= rand
function_tokens: def accept_reject ( self , energy_new , energy_old ) : w = math . exp ( min ( 0 , - float ( energy_new - energy_old ) * self . beta ) ) rand = self . random_state . rand ( ) return w >= rand