code: def addMonitor(self, monitor):
      
  
      token = self.nextMonitorToken
      self.nextMonitorToken += 1
  
      self.monitors[token] = monitor
  
      return token
docs: Subscribe to SingleLayer2DExperiment events.
  
      @param monitor (SingleLayer2DExperimentMonitor)
      An object that implements a set of monitor methods
  
      @return (object)
      An opaque object that can be used to refer to this monitor.