import random


def simulate_sensors(prev, stdev, min, max):
  """Gaussian distribution for simulated sensor readings."""
  delta = random.gauss(0, stdev)
  new = prev + delta
  if new < min or new > max:
    new = prev - delta
  return new