code: def add_model(self, metric_value, model_id):
          
          if self.verbose:
              logger.info("Saving model.")
  
          # Update best_model text file
          ret = {"model_id": model_id, "metric_value": metric_value}
          self.history.append(ret)
          if model_id == self.get_best_model_id():
              file = open(os.path.join(self.path, "best_model.txt"), "w")
              file.write("best model: " + str(model_id))
              file.close()
          return ret
docs: Add model to the history, x_queue and y_queue
  
          Parameters
          ----------
          metric_value : float
          graph : dict
          model_id : int
  
          Returns
          -------
          model : dict