def __init__(self, maze_env, archive, genome, population): # The record store for evaluated maze solver agents self.record_store = agent.AgentRecordStore() # The initial maze simulation environment self.orig_maze_environment = maze_env # The NoveltyItem archive self.archive = archive # The initial genome self.genome = genome # The current population of robot genomes self.population = population
def __init__(self, maze_env, population): """ Creates new instance and initialize fileds. Arguments: maze_env: The maze environment as loaded from configuration file. population: The population for this trial run """ # The initial maze simulation environment self.orig_maze_environment = maze_env # The record store for evaluated maze solver agents self.record_store = agent.AgentRecordStore() # The NEAT population object self.population = population
help='The height of the plot figure') parser.add_argument('--show_axes', type=bool, default=False, help='The flag to indicate whether to show plot axes.') args = parser.parse_args() local_dir = os.path.dirname(__file__) if not (args.maze == 'medium' or args.maze == 'hard'): print('Unsupported maze configuration: %s' % args.maze) exit(1) # read maze environment maze_env_config = os.path.join(local_dir, '%s_maze.txt' % args.maze) maze_env = maze.read_environment(maze_env_config) # read agents records rs = agent.AgentRecordStore() rs.load(args.records) # render visualization random.seed(42) draw_maze_records(maze_env, rs.records, width=args.width, height=args.height, fig_height=args.fig_height, view=True, show_axes=args.show_axes, filename=args.output)