def initialise_simulation(self, simulation): self.simulation = simulation Cache.get_cache().flush() self.configurations.load_configuration_for_simulation(simulation) self.configurations.configurations_dict = deepcopy( self.configurations.configurations_dict) segment_table_fixture_path = join(segment_table_dir_path, simulation.segment_table_file_name) SegmentTable.load(segment_table_fixture_path)
def initialise_segment_table(self, segment_table_file_name): segment_table_fixture_path = join(segment_table_dir_path, segment_table_file_name) SegmentTable.load(segment_table_fixture_path)
def initialise_simulation(self, simulation): configurations = Configuration() configurations.load_configuration_for_simulation(simulation) segment_table_fixture_path = join(segment_table_dir_path, simulation.segment_table_file_name) SegmentTable.load(segment_table_fixture_path)
configurations = Configuration() configurations.load_configuration_for_simulation(current_simulation) seed = 100 random.seed(seed) logger.info('Simulation: {}'.format(options.simulation_name)) logger.info("Seed: {}".format(seed)) logger.info(str(configurations)) with open('ga_config.py') as f: for line in f.readlines(): logger.info(line) segment_table_fixture_path = join(segment_table_dir_path, current_simulation.segment_table_file_name) SegmentTable.load(segment_table_fixture_path) dummy_queue = Queue(maxsize=10) MAX_GENERATIONS = 10 genetic_algorithm = GeneticAlgorithm(current_simulation, migration_coordinator=None, result_queue=dummy_queue, island_number=1, simulation_total_islands=1, max_generations=MAX_GENERATIONS, simulation_total_generations=100, initial_generation=1) genetic_algorithm.run()