code: def run(self, duration, obs=None):
          
          from ecell4_base.core import TimeoutObserver
  
          timeout = TimeoutObserver(self.__timeout)
          if obs is None:
              obs = (timeout, )
          elif isinstance(obs, collections.Iterable):
              obs = tuple(obs) + (timeout, )
          else:
              obs = (obs, timeout)
  
          from ipywidgets import FloatProgress, HBox, HTML
          from IPython.display import display
          from time import sleep
  
          fp = FloatProgress(min=0, max=100)
          ptext = HTML()
          display(HBox(children=[fp, ptext]))
  
          tstart = self.__sim.t()
          upto = tstart + duration
          while self.__sim.t() < upto:
              self.__sim.run(upto - self.__sim.t(), obs)
              value = (self.__sim.t() - tstart) / duration
              fp.value = value * 100
              ptext.value = self.get_text(value, timeout.accumulation())
              sleep(self.__wait)
  
          fp.value = 100
          ptext.value = self.get_text(1, timeout.accumulation())
docs: Run the simulation.
  
          Parameters
          ----------
          duration : Real
              a duration for running a simulation.
                  A simulation is expected to be stopped at t() + duration.
          obs : list of Obeservers, optional
              observers