def simulate
      if waiting?
        simulable = @namespace::Simulable
        start_time = begin_simulation
        initialize_simulation
        while self.time < self.duration
          debug "* Tick at: #{self.time}, #{Time.now - start_time} secs elapsed" if DEVS.logger && DEVS.logger.debug?
          self.time = simulable.step(@processor, self.time)
        end
        end_simulation
      elsif DEVS.logger
        if running?
          error "The simulation already started at #{self.start_time} and is currently running."
        else
          error "The simulation is already done. Started at #{self.start_time} and finished at #{self.final_time} in #{elapsed_secs} secs."
        end
      end
      self
    end
def simulate
      if waiting?
        simulable = @namespace::Simulable
        start_time = begin_simulation
        initialize_simulation
        while self.time < self.duration
          debug "* Tick at: #{self.time}, #{Time.now - start_time} secs elapsed" if DEVS.logger && DEVS.logger.debug?
          self.time = simulable.step(@processor, self.time)
        end
        end_simulation
      elsif DEVS.logger
        if running?
          error "The simulation already started at #{self.start_time} and is currently running."
        else
          error "The simulation is already done. Started at #{self.start_time} and finished at #{self.final_time} in #{elapsed_secs} secs."
        end
      end
      self
    end
TODO error hook
 Run the simulation in a new thread