Exemplo n.º 1
0
    def launch_queue(self, jobs, plot_all):
        "Launches a queue of jobs and returns the best run."
        self.store.runs.remove({})
        self.store.jobs.remove({})

        for job in jobs:
            self.store.jobs.insert(job)

        # 3.
        gaproject.run.main(self.data)

        # 4.
        results = Results()
        results.print_()
        if plot_all:
            results.plotDifferentRuns()

        best = results.find_one()
        best_avg = average(best["fitness"])
        for run in results.find():
            run_avg = average(run["fitness"])
            if run_avg < best_avg:
                best = run
                best_avg = run_avg

        print "Best run so far:"
        table = RunTable()
        table.add_run(best)
        print table

        return best
Exemplo n.º 2
0
    def launch_queue(self, jobs, plot_all):
        'Launches a queue of jobs and returns the best run.'
        self.store.runs.remove({})
        self.store.jobs.remove({})

        for job in jobs:
            self.store.jobs.insert(job)

        # 3.
        gaproject.run.main(self.data)

        # 4.
        results = Results()
        results.print_()
        if plot_all:
            results.plotDifferentRuns()

        best = results.find_one()
        best_avg = average(best['fitness'])
        for run in results.find():
            run_avg = average(run['fitness'])
            if run_avg < best_avg:
                best = run
                best_avg = run_avg

        print 'Best run so far:'
        table = RunTable()
        table.add_run(best)
        print table

        return best
Exemplo n.º 3
0
 def print_job(self, job, data):
     print 'Best run so far:'
     table = RunTable()
     table.add_run(job, data)
     print table
Exemplo n.º 4
0
 def print_job(self, job, data):
     print 'Best run so far:'
     table = RunTable()
     table.add_run(job, data)
     print table