Skip to content

update doc-string of Agent class #1187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,17 @@ def display(self, canvas, x, y, width, height):


class Agent(Thing):
"""An Agent is a subclass of Thing with one required slot,
.program, which should hold a function that takes one argument, the
percept, and returns an action. (What counts as a percept or action
"""An Agent is a subclass of Thing with one required instance attribute
(aka slot), .program, which should hold a function that takes one argument,
the percept, and returns an action. (What counts as a percept or action
will depend on the specific environment in which the agent exists.)
Note that 'program' is a slot, not a method. If it were a method,
then the program could 'cheat' and look at aspects of the agent.
It's not supposed to do that: the program can only look at the
percepts. An agent program that needs a model of the world (and of
the agent itself) will have to build and maintain its own model.
There is an optional slot, .performance, which is a number giving
the performance measure of the agent in its environment."""
Note that 'program' is a slot, not a method. If it were a method, then the
program could 'cheat' and look at aspects of the agent. It's not supposed
to do that: the program can only look at the percepts. An agent program
that needs a model of the world (and of the agent itself) will have to
build and maintain its own model. There is an optional slot, .performance,
which is a number giving the performance measure of the agent in its
environment."""

def __init__(self, program=None):
self.alive = True
Expand Down