Dev.to · 5 min read

What is an agent, really?

What is an agent, really?

In my previous post, I talked about starting to build a multi-agent system: a city. My goal is to understand and explain how multi-agent systems work (coordination, communication, etc.), so in this post I'll try to explain the basic concepts and how they work in the city. In future posts, I'll implement different features of the city. A bakery with no bread The city will have agents, and they will interact with each other. Let's start with a simple example. An agent wants to buy bread for breakfast. She leaves her house and walks to the bakery. When she gets there, there's no bread left, so she has to make a decision: a) go to another bakery nearby, or b) go to the supermarket and buy something else for breakfast. This small situation already shows most of the basic concepts. What is an agent? An agent is a system that perceives its environment and acts on it. It's autonomous: nobody controls it from outside, it decides what to do by itself. It's also reactive and proactive. Reactive, because it notices changes in the environment and responds to them (there's no bread). Proactive, because it doesn't forget its goal (having breakfast) and looks for another way to reach it. A good agent needs both. If it's only proactive, it follows its plan even when the plan doesn't work anymore: it waits at the empty bakery. If it's only reactive, it responds to everything around it and forgets its goal: it sees a friend, starts talking, smells coffee, goes into a café… and never has breakfast. The hard part is finding the balance. Sensors and actuators In the city, agents don't have real eyes or hands. Their sensors are the information they receive: what they see around them and the messages from other agents. Their actuators are the actions they can do, like walking, buying or talking. A good way to describe an agent is PEAS (Performance, Environment, Actuators, Sensors): PEAS The agent in the bakery example Performance Has breakfast, spends little time and money Environment The city: streets, bakery, supermarket, other agents Actuators Walk, buy, talk to other agents Sensors What it sees nearby, messages from other agents Each action has preconditions: it can only run if its preconditions are true. For example, the agent can only buy bread if there's bread and she has money. This set of actions is called the agent's effectoric capability. The agent doesn't control the world When an agent works on a goal, it doesn't know everything about the environment, only part of it. And it doesn't control the environment either: other agents are changing it at the same time. This means that the same action can have different results. Today there's bread at the bakery; tomorrow someone buys the last loaf five minutes before she arrives. Talking to other agents If an agent perceives something important, like rain or a car crash, it can tell other agents. Agents need to be able to communicate with each other. This is called social ability. Did the agent do a good job? Once an agent reaches its goal, we need to know if it did it in a good way. For that, we use a performance measure: a way to evaluate how well the agent is doing. Did she have breakfast? How much time and money did she spend? An agent can go to the bakery at the same time every day to buy bread, but one day there's no bread left. The agent's decision was still correct, because it acted in a rational way. Being rational doesn't mean knowing everything: an agent is rational when it makes the best decision with what it knows. What I found hard to understand I found it hard to understand the difference between reactivity and proactivity. At first I thought they were two different options: the agent is either reactive or proactive. I understood it when I realized they work together: the agent reacts to the change (no bread) and, at the same time, keeps its goal (having breakfast). I also mixed up two concepts. I thought effectoric capability was about measuring how well the agent did its job. It's actually the set of actions the agent can do. Measuring the result is the job of the performance measure. What's next These four properties (autonomy, reactivity, proactivity and social ability) are called the weak notion of agency. There's also a strong notion, where we describe agents with human ideas like beliefs, desires and intentions. I'll talk about that in a future post. If you're learning about agents too, or if I got something wrong, let me know in the comments. Sources Michael Wooldridge, An Introduction to MultiAgent Systems (2nd ed.) Stuart Russell and Peter Norvig, Artificial Intelligence: A Modern Approach (4th ed.) Michael Wooldridge and Nicholas Jennings, Intelligent Agents: Theory and Practice (1995)

This is a summary aggregated from Dev.to. Read the complete article on the original site:

Read full article at Dev.to

More AI & Machine Learning News