def __init__(self, interactive=False, delay=100): World.__init__(self) self.delay = delay self.title('AmoebaWorld') self.running = False self.make_canvas() if interactive: self.make_control_panel()
def __init__(self, parentFSM, doneEvent): World.__init__(self, doneEvent) self.fsm.setName(CIGlobals.OToontown) self.fsm.addState(State('MGHood', self.enterMGHood, self.exitMGHood, ['quietZone'])) self.fsm.addState(State('CTHood', self.enterCTHood, self.exitCTHood, ['quietZone'])) self.fsm.getStateNamed('quietZone').addTransition('MGHood') self.fsm.getStateNamed('quietZone').addTransition('CTHood') self.parentFSM = parentFSM self.parentFSM.getStateNamed(CIGlobals.OToontown).addChild(self.fsm)
def __init__(self,r=1.0,s=1.0,v=1.0,cloudsize=1.0) : World.__init__(self,r,s,v,cloudsize) Tk.__init__(self) self.title("World") self.iconname("World") self.frame = Frame(self) self.frame.pack(side=TOP,expand=YES,fill=BOTH) self.setupMenu() self.setupWindow() self.setupOptionsEntry()
def __init__(self, canvas_size=500, cell_size=10, interactive=False): World.__init__(self) self.title('GIS Modling and Problem Solving Final Project') self.canvas_size = canvas_size self.cell_size = cell_size self.cells = {} if interactive: self.make_canvas() self.make_control()
def __init__(self, interactive=False): World.__init__(self) self.title("TurtleWorld") # the interpreter executes user-provided code self.make_interpreter(globals()) # make the GUI self.setup() if interactive: self.setup_interactive()
def __init__(self, canvas_size=500, cell_size=5, interactive=False): World.__init__(self) self.title('CellWorld') self.canvas_size = canvas_size self.cell_size = cell_size # cells is a map from index tuples to Cell objects self.cells = {} if interactive: self.make_canvas() self.make_control()
def __init__(self, interactive=False): World.__init__(self) self.title('TurtleWorld') # the interpreter executes user-provided code g = globals() g['world'] = self self.make_interpreter(g) # make the GUI self.setup() if interactive: self.setup_interactive()
def __init__(self, world_space, **kwargs): World.__init__(self, world_space) # creates a [0,0,..,0] array, len of dims in state self._no_move = np.array( [0 for _ in self.world_space.GetSDims()] ) # Stores the start and goal states if specified, otherwise use zero/last self.start_state = kwargs.get( 'start_state', self.world_space.ZeroState() ) self.goal_state = kwargs.get( 'goal_state', self.world_space.LastState() ) # Stores func handles if specified, otherwise store default lambdas self.hazard_func = kwargs.get( 'hazard_func', lambda *_: False ) self.dynamics_func = kwargs.get( 'dynamics_func', lambda *_: self._no_move ) self.noise_func = kwargs.get( 'noise_func', lambda *_: self._no_move ) self.out_of_bounds = False self.hit_hazard = False # Make sure specified star and goal is valid if not self.world_space.IsValidState(self.start_state) or \ not self.world_space.IsValidState(self.goal_state): raise ValueError(f"start, start and goal must all be within world_space.\nS: {self.world_space.GetSDims()}\nGot the following...\nstart: {self.start_state}\ngoal: {self.goal_state}")
def __init__(self, parentFSM, doneEvent): World.__init__(self, doneEvent) self.fsm.setName(CIGlobals.CogTropolis) self.parentFSM = parentFSM self.parentFSM.getStateNamed(CIGlobals.CogTropolis).addChild(self.fsm)
def __init__(self): World.__init__(self) self.entities = []