@@ -381,7 +381,7 @@ class XYEnvironment(Environment):
381
381
that are held."""
382
382
383
383
def __init__ (self , width = 10 , height = 10 ):
384
- super (XYEnvironment , self ).__init__ ()
384
+ super ().__init__ ()
385
385
386
386
self .width = width
387
387
self .height = height
@@ -452,7 +452,7 @@ def add_thing(self, thing, location=(1, 1), exclude_duplicate_class_items=False)
452
452
if (exclude_duplicate_class_items and
453
453
any (isinstance (t , thing .__class__ ) for t in self .list_things_at (location ))):
454
454
return
455
- super (XYEnvironment , self ).add_thing (thing , location )
455
+ super ().add_thing (thing , location )
456
456
457
457
def is_inbounds (self , location ):
458
458
"""Checks to make sure that the location is inbounds (within walls if we have walls)"""
@@ -471,11 +471,11 @@ def delete_thing(self, thing):
471
471
"""Deletes thing, and everything it is holding (if thing is an agent)"""
472
472
if isinstance (thing , Agent ):
473
473
for obj in thing .holding :
474
- super (XYEnvironment , self ).delete_thing (obj )
474
+ super ().delete_thing (obj )
475
475
for obs in self .observers :
476
476
obs .thing_deleted (obj )
477
477
478
- super (XYEnvironment , self ).delete_thing (thing )
478
+ super ().delete_thing (thing )
479
479
for obs in self .observers :
480
480
obs .thing_deleted (thing )
481
481
@@ -525,7 +525,7 @@ class ContinuousWorld(Environment):
525
525
"""Model for Continuous World."""
526
526
527
527
def __init__ (self , width = 10 , height = 10 ):
528
- super (ContinuousWorld , self ).__init__ ()
528
+ super ().__init__ ()
529
529
self .width = width
530
530
self .height = height
531
531
@@ -536,8 +536,8 @@ def add_obstacle(self, coordinates):
536
536
class PolygonObstacle (Obstacle ):
537
537
538
538
def __init__ (self , coordinates ):
539
- """Coordinates is a list of tuples."""
540
- super (PolygonObstacle , self ).__init__ ()
539
+ """ Coordinates is a list of tuples."""
540
+ super ().__init__ ()
541
541
self .coordinates = coordinates
542
542
543
543
# ______________________________________________________________________________
@@ -556,7 +556,7 @@ class VacuumEnvironment(XYEnvironment):
556
556
each turn taken."""
557
557
558
558
def __init__ (self , width = 10 , height = 10 ):
559
- super (VacuumEnvironment , self ).__init__ (width , height )
559
+ super ().__init__ (width , height )
560
560
self .add_walls ()
561
561
562
562
def thing_classes (self ):
@@ -579,7 +579,7 @@ def execute_action(self, agent, action):
579
579
agent .performance += 100
580
580
self .delete_thing (dirt )
581
581
else :
582
- super (VacuumEnvironment , self ).execute_action (agent , action )
582
+ super ().execute_action (agent , action )
583
583
584
584
if action != 'NoOp' :
585
585
agent .performance -= 1
@@ -593,7 +593,7 @@ class TrivialVacuumEnvironment(Environment):
593
593
Environment."""
594
594
595
595
def __init__ (self ):
596
- super (TrivialVacuumEnvironment , self ).__init__ ()
596
+ super ().__init__ ()
597
597
self .status = {loc_A : random .choice (['Clean' , 'Dirty' ]),
598
598
loc_B : random .choice (['Clean' , 'Dirty' ])}
599
599
@@ -677,7 +677,7 @@ class WumpusEnvironment(XYEnvironment):
677
677
# Room should be 4x4 grid of rooms. The extra 2 for walls
678
678
679
679
def __init__ (self , agent_program , width = 6 , height = 6 ):
680
- super (WumpusEnvironment , self ).__init__ (width , height )
680
+ super ().__init__ (width , height )
681
681
self .init_world (agent_program )
682
682
683
683
def init_world (self , program ):
0 commit comments