Exemple #1
0
def plot3d(db_config, tag, x_param, y_param, z_param, filter_list, numRows, numCols, title):
    persistence = PersistenceManager(db_config)
    persistence.initialise_database_client()

    datasets = []

    for filter in filter_list:
        dataset = create_dataset(persistence, "3d", tag, [x_param, y_param, z_param], filter)
        datasets.append(dataset)

    create_plot_matrix(datasets, "3d", numRows, numCols, title, [str(x_param.split(".")[1]), y_param.split(".")[1], z_param.split(".")[1]])
Exemple #2
0
    def __init__(self, simulations_file, config_file):

        self.config = yaml.load(open(config_file))

        self.generator = RangeGenerator(yaml.load(open(simulations_file)))
        self.automator = SimulationAutomator(
            self.config["SimulationAutomator"])

        self.persistence = PersistenceManager(
            self.config["Persistence"]["database"])
        self.plotter = Plotter(self.persistence)
Exemple #3
0
def plot2d(db_config, tag, x_param, y_param, filter_list, numRows, numCols,
           title):
    persistence = PersistenceManager(db_config)
    persistence.initialise_database_client()

    datasets = []

    for filter in filter_list:
        dataset = create_dataset(persistence, "2d", tag, [x_param, y_param],
                                 filter)
        datasets.append(dataset)

    create_plot_matrix(datasets, "2d", numRows, numCols, title,
                       [str(x_param.split(".")[1]),
                        y_param.split(".")[1]])
Exemple #4
0
    def __init__(self, simulations_file, config_file):

        self.config = yaml.load(open(config_file))

        self.generator = RangeGenerator(yaml.load(open(simulations_file)))
        self.automator = SimulationAutomator(self.config["SimulationAutomator"])

        self.persistence = PersistenceManager(self.config["Persistence"]["database"])
        self.plotter = Plotter(self.persistence)
Exemple #5
0
class QuickTest:

    def __init__(self, simulations_file, config_file):

        self.config = yaml.load(open(config_file))

        self.generator = RangeGenerator(yaml.load(open(simulations_file)))
        self.automator = SimulationAutomator(self.config["SimulationAutomator"])

        self.persistence = PersistenceManager(self.config["Persistence"]["database"])
        self.plotter = Plotter(self.persistence)

    def setup(self):
        self.persistence.start_db()

    def run_simulations(self, tag):
        simulation_scenarios = self.generator.generate_memory()
	#print len(simulation_scenarios)

        automator_input = []
        for scenario in simulation_scenarios:
            automator_entry = {}
            automator_entry["parameters"] = scenario
            automator_entry["strategies"] = None
            automator_input.append(automator_entry)

        results, fails = self.automator.run(automator_input, tag)
        self.persistence.initialise_database_client()
        sanitized_results = sanitize_results(results)
        #print sanitized_results
        self.persistence.persist_to_database(self.config["Persistence"]["database"]["collection_name"], sanitized_results)
        return results, fails

    def plot2d(self, tag, x_param, y_param, filter, output_filename, title="", x_label="", y_label=""):
        self.persistence.initialise_database_client()
        self.plotter.plot2d_from_database(tag, x_param, y_param, filter, output_filename, title, x_label, y_label)

    def plot3d(self, tag, x_param, y_param, z_param, filter, output_filename, title="", x_label="", y_label="", z_label=""):
        self.persistence.initialise_database_client()
        self.plotter.plot3d_from_database(tag, x_param, y_param, z_param, filter, output_filename, title, x_label, y_label, z_label)


    def teardown(self):
        self.persistence.shutdown_db()
Exemple #6
0
class QuickTest:
    def __init__(self, simulations_file, config_file):

        self.config = yaml.load(open(config_file))

        self.generator = RangeGenerator(yaml.load(open(simulations_file)))
        self.automator = SimulationAutomator(
            self.config["SimulationAutomator"])

        self.persistence = PersistenceManager(
            self.config["Persistence"]["database"])
        self.plotter = Plotter(self.persistence)

    def setup(self):
        self.persistence.start_db()

    def run_simulations(self, tag):
        simulation_scenarios = self.generator.generate_memory()
        #print len(simulation_scenarios)

        automator_input = []
        for scenario in simulation_scenarios:
            automator_entry = {}
            automator_entry["parameters"] = scenario
            automator_entry["strategies"] = None
            automator_input.append(automator_entry)

        results, fails = self.automator.run(automator_input, tag)
        self.persistence.initialise_database_client()
        sanitized_results = sanitize_results(results)
        #print sanitized_results
        self.persistence.persist_to_database(
            self.config["Persistence"]["database"]["collection_name"],
            sanitized_results)
        return results, fails

    def plot2d(self,
               tag,
               x_param,
               y_param,
               filter,
               output_filename,
               title="",
               x_label="",
               y_label=""):
        self.persistence.initialise_database_client()
        self.plotter.plot2d_from_database(tag, x_param, y_param, filter,
                                          output_filename, title, x_label,
                                          y_label)

    def plot3d(self,
               tag,
               x_param,
               y_param,
               z_param,
               filter,
               output_filename,
               title="",
               x_label="",
               y_label="",
               z_label=""):
        self.persistence.initialise_database_client()
        self.plotter.plot3d_from_database(tag, x_param, y_param, z_param,
                                          filter, output_filename, title,
                                          x_label, y_label, z_label)

    def teardown(self):
        self.persistence.shutdown_db()