Agent architectures and hierarchical controlAgent architectures and hierarchical control Overview:...

21
Agent architectures and hierarchical control Overview: Agents and Robots Agent systems and architectures Agent controllers Hierarchical controllers c D. Poole and A. Mackworth 2019 Artificial Intelligence, Lecture 2.1 1 / 12

Transcript of Agent architectures and hierarchical controlAgent architectures and hierarchical control Overview:...

Page 1: Agent architectures and hierarchical controlAgent architectures and hierarchical control Overview: Agents and Robots Agent systems and architectures Agent controllers Hierarchical

Agent architectures and hierarchical control

Overview:

Agents and Robots

Agent systems and architectures

Agent controllers

Hierarchical controllers

c©D. Poole and A. Mackworth 2019 Artificial Intelligence, Lecture 2.1 1 / 12

Page 2: Agent architectures and hierarchical controlAgent architectures and hierarchical control Overview: Agents and Robots Agent systems and architectures Agent controllers Hierarchical

Example: smart house

A smart house will monitor your use of essentials, and buythem before you run out.Example: snack buying agent that ensures you have asupply of chips:I abilities: buy chips (and have them delivered)I goals:I stimuli:I prior knowledge:

c©D. Poole and A. Mackworth 2019 Artificial Intelligence, Lecture 2.1 2 / 12

Page 3: Agent architectures and hierarchical controlAgent architectures and hierarchical control Overview: Agents and Robots Agent systems and architectures Agent controllers Hierarchical

Agent Systems

Body

Agent

Environment

actionsstimuli

A agent system is madeup of a agent and anenvironment.

An agent receivesstimuli from theenvironment

An agent carries outactions in theenvironment.

c©D. Poole and A. Mackworth 2019 Artificial Intelligence, Lecture 2.1 3 / 12

Page 4: Agent architectures and hierarchical controlAgent architectures and hierarchical control Overview: Agents and Robots Agent systems and architectures Agent controllers Hierarchical

Agent System Architecture

An agent is made up of a bodyand a controller.

commands

Agent

percepts

Controller

Body

Environment

actionsstimuli

An agent interacts withthe environment throughits body.

The body is made up of:I sensors that interpret

stimuliI actuators that carry

out actions

The controller receivespercepts from the body.

The controller sendscommands to the body.

The body can also havereactions that are notcontrolled.

c©D. Poole and A. Mackworth 2019 Artificial Intelligence, Lecture 2.1 4 / 12

Page 5: Agent architectures and hierarchical controlAgent architectures and hierarchical control Overview: Agents and Robots Agent systems and architectures Agent controllers Hierarchical

Implementing a controller

A controller is the brains of the agent.

Agents are situated in time, they receive sensory data intime, and do actions in time.

Controllers have (limited) memory and (limited)computational capabilities.

The controller specifies the command at every time.

The command at any time can depend on the current andprevious percepts.

c©D. Poole and A. Mackworth 2019 Artificial Intelligence, Lecture 2.1 5 / 12

Page 6: Agent architectures and hierarchical controlAgent architectures and hierarchical control Overview: Agents and Robots Agent systems and architectures Agent controllers Hierarchical

The Agent Functions

A percept trace is a sequence of all past, present, andfuture percepts received by the controller.

0 20 40 60 80Time

0

50

100

150

200

250

300

Num

ber i

n st

ock.

P

rice.

A command trace is a sequence of all past, present, andfuture commands output by the controller.

c©D. Poole and A. Mackworth 2019 Artificial Intelligence, Lecture 2.1 6 / 12

Page 7: Agent architectures and hierarchical controlAgent architectures and hierarchical control Overview: Agents and Robots Agent systems and architectures Agent controllers Hierarchical

The Agent Functions

A percept trace is a sequence of all past, present, andfuture percepts received by the controller.

A command trace is a sequence of all past, present, andfuture commands output by the controller.

A transduction is a function from percept traces intocommand traces.

A transduction is causal if the command trace up to timet depends only on percepts up to t.

A controller is an implementation of a causaltransduction.

An agent’s history at time t is sequence of past andpresent percepts and past commands.

A causal transduction specifies a function from an agent’shistory at time t into its action at time t.

c©D. Poole and A. Mackworth 2019 Artificial Intelligence, Lecture 2.1 7 / 12

Page 8: Agent architectures and hierarchical controlAgent architectures and hierarchical control Overview: Agents and Robots Agent systems and architectures Agent controllers Hierarchical

The Agent Functions

A percept trace is a sequence of all past, present, andfuture percepts received by the controller.

A command trace is a sequence of all past, present, andfuture commands output by the controller.

A transduction is a function from percept traces intocommand traces.

A transduction is causal if the command trace up to timet depends only on percepts up to t.

A controller is an implementation of a causaltransduction.

An agent’s history at time t is sequence of past andpresent percepts and past commands.

A causal transduction specifies a function from an agent’shistory at time t into its action at time t.

c©D. Poole and A. Mackworth 2019 Artificial Intelligence, Lecture 2.1 7 / 12

Page 9: Agent architectures and hierarchical controlAgent architectures and hierarchical control Overview: Agents and Robots Agent systems and architectures Agent controllers Hierarchical

The Agent Functions

A percept trace is a sequence of all past, present, andfuture percepts received by the controller.

A command trace is a sequence of all past, present, andfuture commands output by the controller.

A transduction is a function from percept traces intocommand traces.

A transduction is causal if the command trace up to timet depends only on percepts up to t.

A controller is an implementation of a causaltransduction.

An agent’s history at time t is sequence of past andpresent percepts and past commands.

A causal transduction specifies a function from an agent’shistory at time t into its action at time t.

c©D. Poole and A. Mackworth 2019 Artificial Intelligence, Lecture 2.1 7 / 12

Page 10: Agent architectures and hierarchical controlAgent architectures and hierarchical control Overview: Agents and Robots Agent systems and architectures Agent controllers Hierarchical

The Agent Functions

A percept trace is a sequence of all past, present, andfuture percepts received by the controller.

A command trace is a sequence of all past, present, andfuture commands output by the controller.

A transduction is a function from percept traces intocommand traces.

A transduction is causal if the command trace up to timet depends only on percepts up to t.

A controller is an implementation of a causaltransduction.

An agent’s history at time t is sequence of past andpresent percepts and past commands.

A causal transduction specifies a function from an agent’shistory at time t into its action at time t.

c©D. Poole and A. Mackworth 2019 Artificial Intelligence, Lecture 2.1 7 / 12

Page 11: Agent architectures and hierarchical controlAgent architectures and hierarchical control Overview: Agents and Robots Agent systems and architectures Agent controllers Hierarchical

The Agent Functions

A percept trace is a sequence of all past, present, andfuture percepts received by the controller.

A command trace is a sequence of all past, present, andfuture commands output by the controller.

A transduction is a function from percept traces intocommand traces.

A transduction is causal if the command trace up to timet depends only on percepts up to t.

A controller is an implementation of a causaltransduction.

An agent’s history at time t is sequence of past andpresent percepts and past commands.

A causal transduction specifies a function from an agent’shistory at time t into its action at time t.

c©D. Poole and A. Mackworth 2019 Artificial Intelligence, Lecture 2.1 7 / 12

Page 12: Agent architectures and hierarchical controlAgent architectures and hierarchical control Overview: Agents and Robots Agent systems and architectures Agent controllers Hierarchical

The Agent Functions

A percept trace is a sequence of all past, present, andfuture percepts received by the controller.

A command trace is a sequence of all past, present, andfuture commands output by the controller.

A transduction is a function from percept traces intocommand traces.

A transduction is causal if the command trace up to timet depends only on percepts up to t.

A controller is an implementation of a causaltransduction.

An agent’s history at time t is sequence of past andpresent percepts and past commands.

A causal transduction specifies a function from an agent’shistory at time t into its action at time t.

c©D. Poole and A. Mackworth 2019 Artificial Intelligence, Lecture 2.1 7 / 12

Page 13: Agent architectures and hierarchical controlAgent architectures and hierarchical control Overview: Agents and Robots Agent systems and architectures Agent controllers Hierarchical

Belief States

An agent doesn’t have access to its entire history. It onlyhas access to what it has remembered.

The memory or belief state of an agent at time t encodesall of the agent’s history that it has access to.

The belief state of an agent encapsulates the informationabout its past that it can use for current and futureactions.

At every time a controller has to decide on:I What should it do?I What should it remember?

(How should it update its memory?)

— as a function of its percepts and its memory.

c©D. Poole and A. Mackworth 2019 Artificial Intelligence, Lecture 2.1 8 / 12

Page 14: Agent architectures and hierarchical controlAgent architectures and hierarchical control Overview: Agents and Robots Agent systems and architectures Agent controllers Hierarchical

Belief States

An agent doesn’t have access to its entire history. It onlyhas access to what it has remembered.

The memory or belief state of an agent at time t encodesall of the agent’s history that it has access to.

The belief state of an agent encapsulates the informationabout its past that it can use for current and futureactions.

At every time a controller has to decide on:I What should it do?I What should it remember?

(How should it update its memory?)

— as a function of its percepts and its memory.

c©D. Poole and A. Mackworth 2019 Artificial Intelligence, Lecture 2.1 8 / 12

Page 15: Agent architectures and hierarchical controlAgent architectures and hierarchical control Overview: Agents and Robots Agent systems and architectures Agent controllers Hierarchical

Belief States

An agent doesn’t have access to its entire history. It onlyhas access to what it has remembered.

The memory or belief state of an agent at time t encodesall of the agent’s history that it has access to.

The belief state of an agent encapsulates the informationabout its past that it can use for current and futureactions.

At every time a controller has to decide on:I What should it do?I What should it remember?

(How should it update its memory?)

— as a function of its percepts and its memory.

c©D. Poole and A. Mackworth 2019 Artificial Intelligence, Lecture 2.1 8 / 12

Page 16: Agent architectures and hierarchical controlAgent architectures and hierarchical control Overview: Agents and Robots Agent systems and architectures Agent controllers Hierarchical

Controller

memories Controller

percepts commands

Body

memories

Environment

stimuli actionsAgent

c©D. Poole and A. Mackworth 2019 Artificial Intelligence, Lecture 2.1 9 / 12

Page 17: Agent architectures and hierarchical controlAgent architectures and hierarchical control Overview: Agents and Robots Agent systems and architectures Agent controllers Hierarchical

Functions implemented in a controller

memories

percepts commands

memories

For discrete time, a controller implements:

belief state function remember(belief state, percept),returns the next belief state.

command function command(memory , percept) returnsthe command for the agent.

c©D. Poole and A. Mackworth 2019 Artificial Intelligence, Lecture 2.1 10 / 12

Page 18: Agent architectures and hierarchical controlAgent architectures and hierarchical control Overview: Agents and Robots Agent systems and architectures Agent controllers Hierarchical

Example: smart house

A smart house will monitor your use of essentials, and buythem before you run out.Example: snack buying agent:I abilities: buy chips (and have them delivered)I goals: mimimize price, don’t run out of chipsI stimuli: price, number in stockI prior knowledge: ??

Percept trace:

Control trace:

Transduction:

Belief state:

Belief state transition function:

Control Function:

c©D. Poole and A. Mackworth 2019 Artificial Intelligence, Lecture 2.1 11 / 12

Page 19: Agent architectures and hierarchical controlAgent architectures and hierarchical control Overview: Agents and Robots Agent systems and architectures Agent controllers Hierarchical

Implemented Example

Percepts: price, number in stock

Action: number to buy

Belief state: (approximate) running average

controller:I if price < 0.9 ∗ average and instock < 60 buy 48I else if instock < 12 buy 12I else buy 0

Belief state transition function:

average := average + (price − average) ∗ 0.05

This maintains a discouning rolling avergage that(eventually) weights more recent prices more.

(see agents.py in AIPython distribution http://aipython.org)

c©D. Poole and A. Mackworth 2019 Artificial Intelligence, Lecture 2.1 12 / 12

Page 20: Agent architectures and hierarchical controlAgent architectures and hierarchical control Overview: Agents and Robots Agent systems and architectures Agent controllers Hierarchical

Implemented Example

Percepts: price, number in stock

Action: number to buy

Belief state: (approximate) running average

controller:I if price < 0.9 ∗ average and instock < 60 buy 48I else if instock < 12 buy 12I else buy 0

Belief state transition function:

average := average + (price − average) ∗ 0.05

This maintains a discouning rolling avergage that(eventually) weights more recent prices more.

(see agents.py in AIPython distribution http://aipython.org)

c©D. Poole and A. Mackworth 2019 Artificial Intelligence, Lecture 2.1 12 / 12

Page 21: Agent architectures and hierarchical controlAgent architectures and hierarchical control Overview: Agents and Robots Agent systems and architectures Agent controllers Hierarchical

Implemented Example

Percepts: price, number in stock

Action: number to buy

Belief state: (approximate) running average

controller:I if price < 0.9 ∗ average and instock < 60 buy 48I else if instock < 12 buy 12I else buy 0

Belief state transition function:

average := average + (price − average) ∗ 0.05

This maintains a discouning rolling avergage that(eventually) weights more recent prices more.

(see agents.py in AIPython distribution http://aipython.org)

c©D. Poole and A. Mackworth 2019 Artificial Intelligence, Lecture 2.1 12 / 12