<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def run_opt(self, pop_size, generations, cores=1, plot=False, log=False, log_path=None, run_id=None, store_params=True, **kwargs):
 """Runs the optimizer. Parameters pop_size: int Size of the population each generation. generation: int Number of generations in optimisation. cores: int, optional Number of CPU cores used to run the optimisation. If the 'mp_disabled' keyword is passed to the optimizer, this will be ignored and one core will be used. plot: bool, optional If true, matplotlib will be used to plot information about the minimisation. log: bool, optional If true, a log file describing the optimisation will be created. By default it will be written to the current directory and named according to the time the minimisation finished. This can be manually specified by passing the 'output_path' and 'run_id' keyword arguments. log_path : str Path to write output file. run_id : str An identifier used as the name of your log file. store_params: bool, optional If true, the parameters for each model created during the optimisation will be stored. This can be used to create funnel data later on. """

        self._cores = cores
        self._store_params = store_params
        self.parameter_log = []
        self._model_count = 0
        self.halloffame = tools.HallOfFame(1)
        self.stats = tools.Statistics(lambda thing: thing.fitness.values)
        self.stats.register("avg", numpy.mean)
        self.stats.register("std", numpy.std)
        self.stats.register("min", numpy.min)
        self.stats.register("max", numpy.max)
        self.logbook = tools.Logbook()
        self.logbook.header = ["gen", "evals"] + self.stats.fields
        start_time = datetime.datetime.now()
        self._initialize_pop(pop_size)
        for g in range(generations):
            self._update_pop(pop_size)
            self.halloffame.update(self.population)
            self.logbook.record(gen=g, evals=self._evals,
                                **self.stats.compile(self.population))
            print(self.logbook.stream)
        end_time = datetime.datetime.now()
        time_taken = end_time - start_time
        print("Evaluated {} models in total in {}".format(
            self._model_count, time_taken))
        print("Best fitness is {0}".format(self.halloffame[0].fitness))
        print("Best parameters are {0}".format(self.parse_individual(
            self.halloffame[0])))
        for i, entry in enumerate(self.halloffame[0]):
            if entry > 0.95:
                print(
                    "Warning! Parameter {0} is at or near maximum allowed "
                    "value\n".format(i + 1))
            elif entry < -0.95:
                print(
                    "Warning! Parameter {0} is at or near minimum allowed "
                    "value\n".format(i + 1))
        if log:
            self.log_results(output_path=output_path, run_id=run_id)
        if plot:
            print('----Minimisation plot:')
            plt.figure(figsize=(5, 5))
            plt.plot(range(len(self.logbook.select('min'))),
                     self.logbook.select('min'))
            plt.xlabel('Iteration', fontsize=20)
            plt.ylabel('Score', fontsize=20)
        return