What is agent-oriented programming?

Asked

Viewed 1,853 times

32

We have some well-known programming paradigms, but I faced this paradigm and I had some doubts:

  • Where it is applied?
  • Is there any example of where it has been used successfully?
  • What is the difference between the orientation to X objects and agent orientation?
  • 2

    This is an interesting question. Here is a framework for developing agent-based simulations: http://repast.sourceforge.net/

  • @Wallacemaxters, in the meeting exchanging figurines with Luiz Vieira he quoted and I was very interested.

  • @Cantoni, I’ll take a look at this framework

  • It’s pretty cool @Wellingtonavelino. I’ve done some things on it, but it’s been a while.

  • Good question +1

2 answers

28


Agent orientation is the term used to describe the way of thinking in the software architecture in which the most interesting computational entities are called "agents" (and not "objects" or "services"). Like The colleague @Franciscomariacalisto already put well in his reply, this paradigm was initiated in Distributed Artificial Intelligence, a sub-area of AI that aims to solve problems whose complexity stems from a functional or physical distribution character.

Just out of curiosity, some argue that Orientation itself Objects also started with AI (a long time ago, between the decades 60 and 70) when there was great concern about representation of acquaintance. The frames (stereotypes of world situations real) are essentially objects with their attributes (in this concept then called slots).

The main characteristic of this paradigm is the fact that agents are autonomous entities that have their own goal. This goal, of course, is given by a designer, but the agent will seek to achieve it in the best possible way (something that in AI is called rationality). The name "agent" comes from this autonomy, in the sense that this entity acts on behalf of someone else (similar to when an artist speaks that he has an agent).

This agency model changes some things in the way a system implemented with this paradigm works. In all guidelines (i.e., object orientation, services and agents), the problem is solved by the exchange of messages (invoking methods by any means). However:

  • In Object Orientation, all entities (objects) are developed essentially by the same designer. Even if an external library is used, the designer has full knowledge of the functioning of the objects contained in it, needing to worry for example about the state of a transaction (initialize the library, "commit" after changing something, etc.). When objects exchange messages with each other, possible responses involve the return of something or an error indication, but an invocation is always performed (executed) by the target object.

  • In Service Orientation, entities (services) are not necessarily developed by the same designer. A designer can use the services created and published by others, focusing their interest on the content of the response, and (generally) need not worry about any status that arises from this request (there is no outstanding "It" - one service calls for something to be done by the other who simply does it). When services exchange messages with each other, possible responses also involve the return of something or an error indication, and the call is also always performed by the destination service.

  • In Agent Orientation, entities (agents) are not necessarily developed by the same designer. But the focus of interest is not on the answer, but rather on achieving the agent’s local goal (carrying out task X). But there is no obligation to reply to a message sent. For example, agent A may send a message to agent B ("invoke" a method or request a service), and its response may also be either a result or an error return. But the message can simply be ignored by Agent B in case he thinks it would not be appropriate for him at that time to spend time answering to her.

This distinction is subtle, but allows the emergence (in the sense of emergence) of behaviors not planned by the designer, which is very useful in solving complex problems.

The general architecture of an agent is also the result of the unification of various areas of AI, and so considers that agents are entities that perceive the environment where they are immersed (they have sensors - something equivalent to dynamic attributes, that is, they self-update) and act in this environment to get closer to their individual goals (they have actuators - something equivalent to methods, but which they perform themselves). Some actuators are related to communication with other agents (computational or human). The graphic below, from the book Artificial Intelligence: A Modern Approach, illustrates this general architecture:

inserir a descrição da imagem aqui

This paradigm is not yet so popular in the professional market, although it is used by large companies (Google is the most notable) to solve problems of distributed complexity. It is also widely used in digital games to implement NPC AI (Non-playable Characters).

Two examples of systems using this paradigm:

  • I once saw a lecture by a German researcher who mentioned that the Berlin air control system has an agent-based experimental system (unfortunately I no longer have the reference). There are agents for each element of interest of the system: the planes, the airport escalators, the baggage belts, the fuel trucks, etc. Such agents communicate trying to achieve their objectives with the help of others (The plane requires the trucks to be supplied, and they negotiate with the planes according to proximity, departure time, etc.). The system runs together with the official system (made in object orientation) because there is still no confidence in the emerging behavior of this paradigm (and if the agent on a plane decides to take off because he thought it was the best thing to do to achieve his goal, but ignored other important external objectives, such as the safety of other planes on the runway?).

  • There’s a system which has been constructed to use agents to identify and validate fish otolith images (otoliths are calcium carbonate concretions present in the vertebrate inner ear vestibular apparatus and which contain rings indicative of the estimated age of an animal) concentric rings alternating in light and dark intensities, of varying shape and width. The rings are used to estimate the age of the fish. Agents specialize in light and dark rings, and observe the intensity of the angular area ahead and the proximity to other agents to move and follow the rings. A ring is validated if an agent can return to its starting point.

Despite being used more in the academic area, this paradigm is already much more popular today than a few years ago (when I did my master’s degree in it). At the time, there were already some development methodologies under this paradigm. The most notable are the Commonkads and the GAIA.

There are also numerous frameworks (frameworks) and languages to assist in the development of agent-oriented systems. Notable examples are the JADE, the Jadex, and the Jason in Java, and the CAF in C++. But there are many others.

  • 1

    I only remembered the example of Berlin airport, but I had not understood how it worked, very good!

  • 2

    Beautiful answer Luiz Vieira! The part that fascinates me in this paradigm are the emerging behaviors and that arise in an (often) unexpected way.

  • 2

    For those who want to start playing with this paradigm, I suggest heavily download JADE. It’s open-source, in Java, and has a very easy-to-use architecture (you program agents' behaviors/behaviours directly). In addition, it already has a whole infrastructure ready for many cool things (among them, mobile agents: you run the service on multiple machines, and agents can "migrate" between these nodes as their plans require).

17

When we talk about Agents we are usually talking about Artificial Intelligence, which in this case, more properly Distributed Artificial Intelligence.

Distributed Artificial Intelligence (IAD), with a different approach of traditional Artificial Intelligence (AI), tries to divide a problem in small and simpler problems. These systems developed, using the technique of Distributed Artificial Intelligence, they can solve physically distributed problems, which may seem complex, such as a transport network where there are several transport elements as well as distribution points. It is more intuitive to analyze this problem in a distributed way.

In the Paradigm of Agent-Oriented Programming, where a Program is designed and developed using several Agents that is called Multi-agent Systems (SMA). For this reason the development of Software in this range required the creation and research of the new Paradigm where the software would be produced with rigor, quality, performance and optimization, thus this requires the use of methodologies, models and architectures, as well as others, to facilitate development within the.

I leave a Article interesting to read.

Answering to your questions:

  • Agent-Oriented Programming is applied in Artificial Intelligence;

  • There are several examples where the methodology is being used with enormous success:

    • Control and automation;
    • Telecommunications;
    • Sistemas de Transporte;
    • Games;
  • In relation to Object-Oriented Programming concept It has nothing to do with Agent-Oriented Programming, although POA can be implemented using the Object-Oriented paradigm, we talk about things, which even if complementing, are in different Theory. I mean, POA can use POO but they are different concepts.

  • 1

    Very good Francisco, I liked the explanation +1.

  • Thank you @Wellingtonavelino

  • 1

    By your answer and Luiz, are being very enlightening.

  • 1

    I just don’t agree with the last paragraph. : ) Agent Orientation is just a different way of thinking about the problem. But the basic mechanism of agents can be implemented with Object Orientation. The programming languages are very different, but in the background is the same argument between structured and object oriented orientation: if someone wants, you can program OO with pure C. It’s just not very efficient, because C++ already has a lot of stuff ready for the OO paradigm. :)

  • 1

    You are right @Luizvieira I did not express myself correctly. I just wanted to point out that they are different concepts and I ended up saying that they had nothing to do, which is not true. I already edited the answer. Thank you!

  • 1

    @Franciscomariacalisto I understood, and I agree. Thank you for having bothered to edit. :)

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.