aima/agents.py
def execute_action(self, agent, action):
        """Change agent's location and/or location's status; track performance.
        Score 10 for each dirt cleaned; -1 for each move."""
        if action == 'Right':
            agent.location = loc_B
            agent.performance -= 1
        elif action == 'Left':
            agent.location = loc_A
            agent.performance -= 1
        elif action == 'Suck':
            if self.status[agent.location] == 'Dirty':
                agent.performance += 10
            self.status[agent.location] = 'Clean'
def execute_action(self, agent, action):
        """Change agent's location and/or location's status; track performance.
        Score 10 for each dirt cleaned; -1 for each move."""
        if action == 'Right':
            agent.location = loc_B
            agent.performance -= 1
        elif action == 'Left':
            agent.location = loc_A
            agent.performance -= 1
        elif action == 'Suck':
            if self.status[agent.location] == 'Dirty':
                agent.performance += 10
            self.status[agent.location] = 'Clean'
def execute_action ( self , agent , action ) : if action == 'Right' : agent . location = loc_B agent . performance -= 1 elif action == 'Left' : agent . location = loc_A agent . performance -= 1 elif action == 'Suck' : if self . status [ agent . location ] == 'Dirty' : agent . performance += 10 self . status [ agent . location ] = 'Clean'
Change agent's location and/or location's status; track performance.
        Score 10 for each dirt cleaned; -1 for each move.
Change agent s location and / or location s status ; track performance . Score 10 for each dirt cleaned ; - 1 for each move .