Jump to content

Agent-oriented programming: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
 
(45 intermediate revisions by 27 users not shown)
Line 1: Line 1:
{{Programming paradigms}}
{{short description|Programming paradigm}}
{{Multi-agent system}}

'''Agent-oriented programming''' ('''AOP''') is a [[programming paradigm]] where the construction of the software is centered on the concept of [[software agent]]s. In contrast to [[object-oriented programming]] which has objects (providing methods with variable parameters) at its core, AOP has externally specified agents (with interfaces and messaging capabilities) at its core. They can be thought of as abstractions of objects. Exchanged messages are interpreted by receiving "agents", in a way specific to its class of agents.
'''Agent-oriented programming''' ('''AOP''') is a [[programming paradigm]] where the construction of the software is centered on the concept of [[software agent]]s. In contrast to [[object-oriented programming]] which has objects (providing methods with variable parameters) at its core, AOP has externally specified agents (with interfaces and messaging capabilities) at its core. They can be thought of as abstractions of objects. Exchanged messages are interpreted by receiving "agents", in a way specific to its class of agents.


== History ==
== History ==
Historically, the concept of agent-oriented programming and the idea of centering software around the concept of an Agent was introduced by [[Yoav Shoham]] within his [[Artificial Intelligence]] studies in 1990.<ref>
Historically, the concept of agent-oriented programming and the idea of centering software around the concept of an Agent was introduced by [[Yoav Shoham]] within his [[artificial intelligence]] studies in 1990.<ref>
{{cite book | first=Y. | last=Shoham | year=1990 | title=Agent-Oriented Programming | publisher = Computer Science Department | location = Stanford University | type = Technical Report STAN-CS-90-1335}}</ref><ref>
{{cite book |first=Y. |last=Shoham |year=1990 |title=Agent-Oriented Programming |publisher=Computer Science Department |location=Stanford University |type=Technical Report STAN-CS-90-1335}}</ref><ref>
{{cite book | first=Y. | last=Shoham | year=1993 | title=Agent-Oriented Programming | publisher = Artificial Intelligence | citeseerx =10.1.1.123.5119 | pages = 51–92}}
{{cite journal |last=Shoham |first=Y. |year=1993 |title=Agent-Oriented Programming |journal=Artificial Intelligence |citeseerx =10.1.1.123.5119 |pages=51–92 |volume=60 |issue=1 |doi=10.1016/0004-3702(93)90034-9}}
</ref> His agents are specific to his own paradigm as they have just one method, with a single parameter. To quote Yoav Shoham from his paper in 1990 for a basic difference between of AOP against OOP:
</ref> His agents are specific to his own paradigm as they have only one method, with one parameter. To quote Yoav Shoham from his paper in 1990 for a basic difference between AOP and OOP:
:...agent-oriented programming (AOP), which can be viewed as a specialization of object-oriented programming. ...
{{Blockquote|... agent-oriented programming (AOP), which can be viewed as a specialization of object-oriented programming.}}


{| class="wikitable"
{| class="wikitable plainrowheaders"
|-
|-
! !! OOP !! AOP
! !! OOP !! AOP
|-
|-
| Basic unit || object || agent
! scope="row" | Basic unit
| object || agent
|-
|-
| Parameters defining state of basic unit || unconstrained || beliefs, commitments, capabilities, choices, ...
! scope="row" | Parameters defining state of basic unit
| unconstrained || beliefs, commitments, capabilities, choices, ...
|-
|-
| Process of computation || message passing and response methods || message passing and response methods
! scope="row" |Process of computation
| [[message passing]] and response methods || message passing and response methods
|-
|-
| Types of message || unconstrained || inform, request, offer, promise, decline, ...
! scope="row" | Types of message
| unconstrained || inform, request, offer, promise, decline, ...
|-
|-
| Constraints on methods || none || honesty, consistency, ...
! scope="row" | Constraints on methods
| none || honesty, consistency, ...
|}
|}


== Frameworks ==
== Frameworks ==
There are multiple AOP 'frameworks' also called Agent Platforms that implement Shoham's programming paradigm. The following examples illustrate how a basic agent is programmed as a Hello World Program.
There are multiple AOP 'frameworks', also called agent platforms, that implement Shoham's programming paradigm. The following examples illustrate how a basic agent is programmed as a hello-world program.


=== JADE ===
=== JADE ===
For the Java-platform one of the frameworks is JADE <ref>{{cite conference|last=Bellifeminee|first=Fabio|author2=Agostino Poggi |author3=Giovanni Rimassa|title=JADE: a FIPA2000 compliant agent development environment|year=2001|conference=Proceedings of the fifth international conference on Autonomous agents|pages=216–217}}</ref> (http://jade.tilab.com/).
For the Java-platform one of the frameworks is [https://web.archive.org/web/20100621141053/http://jade.tilab.com/ JADE].<ref>{{cite conference|last=Bellifeminee|first=Fabio|author2=Agostino Poggi |author3=Giovanni Rimassa|title=JADE: a FIPA2000 compliant agent development environment|year=2024|conference=Proceedings of the fifth international conference on Autonomous agents|pages=216–217|doi=10.1145/375735.376120}}</ref>
Here is a very basic example [https://web.archive.org/web/20110702083510/http://rootdev.nl/blog/article/aop_jade_configure_in_eclipse_and_netbeans] of an Agent that runs code
Here is a very basic example<ref>{{cite web |url=http://rootdev.nl/blog/article/aop_jade_configure_in_eclipse_and_netbeans |title=Rootdev |website=rootdev.nl |access-date=18 September 2022 |archive-url=https://web.archive.org/web/20110702083510/http://rootdev.nl/blog/article/aop_jade_configure_in_eclipse_and_netbeans |archive-date=2 July 2011 |url-status=dead}}</ref> of an agent that runs code.
<syntaxhighlight lang="java">
<syntaxhighlight lang="java">
package helloworld;
package helloworld;
Line 48: Line 53:
}
}
</syntaxhighlight>
</syntaxhighlight>
At the core of JADE's AOP model is that its [[API]] supports the standard [[FIPA]] [[Agent Communication Language]]
At the core of JADE's AOP model is that its [[API]] supports the standard [[Foundation for Intelligent Physical Agents|FIPA]] [[Agent Communication Language]]


=== Agent Speak (Jason) ===
=== Agent Speak (Jason) ===
[[AgentSpeak]] is an agent-oriented programming language based on logic programming and the [[Belief–desire–intention_software_model|belief–desire–intention]] (BDI) architecture.
For a literal translation of agent-oriented concepts into a scheme unobfuscated as is JADE, behind Java and Object Orientedness, Agent Speak <ref>Anand S. Rao, 1996. AgentSpeak(L): BDI Agents Speak Out in a Logical Computable Language. Proceedings of Seventh European Workshop on Modelling Autonomous Agents in a Multi-Agent World (MAAMAW-96).</ref> ([[Jason (multi-agent systems development platform)|Jason]]) provides a "natural" language for agents.

<syntaxhighlight lang="java">
For a literal translation of agent-oriented concepts into a scheme unobfuscated as is JADE, behind Java and Object Orientedness, Agent Speak<ref>Anand S. Rao, 1996. AgentSpeak(L): BDI Agents Speak Out in a Logical Computable Language. Proceedings of Seventh European Workshop on Modelling Autonomous Agents in a Multi-Agent World (MAAMAW-96).</ref> (Jason) provides a "natural" language for agents.
<syntaxhighlight lang="jade">
started.
started.


+started <- .print("Hello World. ").
+started <- .print("Hello World. ").
</syntaxhighlight>
</syntaxhighlight>


Line 64: Line 69:


=== SARL Language ===
=== SARL Language ===
[[SARL language|SARL]]<ref>Sebastian Rodriguez, Nicolas Gaud, Stéphane Galland, 2014. SARL: a general-purpose agent-oriented programming language. In the 2014 IEEE/WIC/ACM International Conference on Intelligent Agent Technology. Warsaw, Poland: IEEE Computer Society Press.</ref> ([http://www.sarl.io SARL website]) provides the fundamental abstractions for coding multiagent systems. It uses a script-like syntax (inspired by Scala and Ruby).
[[SARL (programming language)|SARL]]<ref>{{cite book |last1=Rodriguez |first1=Sebastian |last2=Gaud |first2=Nicolas |last3=Galland |first3=Stéphane |year=2014 |chapter=SARL: A General-Purpose Agent-Oriented Programming Language |title=2014 IEEE/WIC/ACM International Joint Conferences on Web Intelligence (WI) and Intelligent Agent Technologies (IAT) |pages=103–110 |doi=10.1109/wi-iat.2014.156 |isbn=978-1-4799-4143-8 |s2cid=15508257}}</ref> provides the fundamental abstractions for coding multiagent systems.<ref>[http://www.sarl.io SARL website]</ref> It uses a script-like syntax (inspired by Scala and Ruby).
<syntaxhighlight lang="java">
<syntaxhighlight lang="sarl">
package helloworld
package helloworld
import io.sarl.core.Initialize
import io.sarl.core.Initialize
Line 73: Line 78:
}
}
}
}
</syntaxhighlight>

=== PADE (Python Agent DEvelopment framework) ===
PADE<ref>{{cite web |url=https://pade.readthedocs.io/en/latest/index.html |title=Python Agent DEvelopment framework — Pade 1.0 documentation}}</ref> is a python package to develop intelligent agents in python language. This framework complies to FIPA and ACL standards.
<syntaxhighlight lang="python">
class AgenteHelloWorld(Agent):
def __init__(self, aid):
super(AgenteHelloWorld, self).__init__(aid=aid)
display_message(self.aid.localname, "Hello World!")
</syntaxhighlight>
</syntaxhighlight>


== Middleware ==
== Middleware ==
One way to implement modular or extensible AOP support is to define standard AOP [[API]]s to [[middleware]] functions that are themselves implemented as [[software agent]]s. For example, a directory service can be implemented as a [[FIPA]] directory facilitator or DF software agent; life-cycle management to start, stop, suspend and resume agents can be implemented as a FIPA Agent Management Service or AMS agent.<ref>{{cite journal|last=Poslad|first=S|title=Specifying Protocols for Multi-agent System Interaction|year=2007|journal=ACM Transactions on Autonomous and Adaptive Systems|volume=4|issue=4|doi=10.1145/1293731.1293735}}</ref> A benefit of the AOP approach is that it support more dynamic roles between different users and providers of applications, services and networks. For example, traditionally, networks and services were usually managed by the network and service provider on behalf of the customer and offered as a single virtual network service but customers themselves are becoming more empowered to integrate and manage their own services. This can be achieved via AOP and APIs to middleware agents that can flexibly and dynamically manage communication.<ref>{{cite book|last=Poslad|first=S|author2=J. Pitt |author3=A. Mamdani |author4=R. Hadingham |author5=P. Buckle |title = Agent-oriented middleware for integrating customer network services. In: Software Agents for Future Communication Systems, Hayzelden A, Bigham J Eds.| year = 1999|pages=221–242}}</ref>
One way to implement modular or extensible AOP support is to define standard AOP [[API]]s to [[middleware]] functions that are themselves implemented as [[software agent]]s. For example, a directory service can be implemented as a [[Foundation for Intelligent Physical Agents|FIPA]] directory facilitator or DF software agent; life-cycle management to start, stop, suspend and resume agents can be implemented as a FIPA Agent Management Service or AMS agent.<ref>{{cite journal|last=Poslad|first=S|title=Specifying Protocols for Multi-agent System Interaction|year=2007|journal=ACM Transactions on Autonomous and Adaptive Systems|volume=2|issue=4|pages=15–es|doi=10.1145/1293731.1293735|s2cid=9477595}}</ref> A benefit of the AOP approach is that it supports more dynamic roles between different users and providers of applications, services and networks. For example, traditionally, networks and services were usually managed by the network and service provider on behalf of the customer and offered as a single virtual network service but customers themselves are becoming more empowered to integrate and manage their own services. This can be achieved via AOP and APIs to middleware agents that can flexibly and dynamically manage communication.<ref>{{cite book |last1=Poslad |first1=S. |last2=Pitt |first2=J. |last3=Mamdani |first3=A. |last4=Hadingham |first4=R. |last5=Buckle |first5=P. |title=Agent-oriented middleware for integrating customer network services. In: Software Agents for Future Communication Systems |editor1-last=Hayzelden |editor1-first=A. |editor2-last=Bigham |editor2-first=J. |year=1999 |pages=221–242 |doi=10.1007/978-3-642-58418-3_9}}</ref>


== See also ==
== See also ==
* [[Software agent]]
* {{Annotated link |Software agent}}
* [[NetLogo]]
* {{Annotated link |NetLogo}}
* [[Actor model]]
* {{Annotated link |Actor model}}
* {{Annotated link |GOAL agent programming language|GOAL}}
* [[Jason (multi-agent systems development platform)|Jason]]
* [[GOAL agent programming language|GOAL]]


== References ==
== References ==
{{Reflist}}
{{Reflist}}

{{Programming paradigms navbox}}


{{DEFAULTSORT:Agent-Oriented Programming}}
{{DEFAULTSORT:Agent-Oriented Programming}}
[[Category:Agent-based programming languages]]
[[Category:Agent-based software| ]]

Latest revision as of 13:21, 10 February 2025

Agent-oriented programming (AOP) is a programming paradigm where the construction of the software is centered on the concept of software agents. In contrast to object-oriented programming which has objects (providing methods with variable parameters) at its core, AOP has externally specified agents (with interfaces and messaging capabilities) at its core. They can be thought of as abstractions of objects. Exchanged messages are interpreted by receiving "agents", in a way specific to its class of agents.

History

[edit]

Historically, the concept of agent-oriented programming and the idea of centering software around the concept of an Agent was introduced by Yoav Shoham within his artificial intelligence studies in 1990.[1][2] His agents are specific to his own paradigm as they have only one method, with one parameter. To quote Yoav Shoham from his paper in 1990 for a basic difference between AOP and OOP:

... agent-oriented programming (AOP), which can be viewed as a specialization of object-oriented programming.

OOP AOP
Basic unit object agent
Parameters defining state of basic unit unconstrained beliefs, commitments, capabilities, choices, ...
Process of computation message passing and response methods message passing and response methods
Types of message unconstrained inform, request, offer, promise, decline, ...
Constraints on methods none honesty, consistency, ...

Frameworks

[edit]

There are multiple AOP 'frameworks', also called agent platforms, that implement Shoham's programming paradigm. The following examples illustrate how a basic agent is programmed as a hello-world program.

JADE

[edit]

For the Java-platform one of the frameworks is JADE.[3] Here is a very basic example[4] of an agent that runs code.

package helloworld;
import jade.core.Agent;

public class Hello extends Agent {
	
	protected void setup() { 
		System.out.println("Hello World. ");
		System.out.println("My name is "+ getLocalName()); 
	}
	
	public Hello() {
		System.out.println("Constructor called");
	}

}

At the core of JADE's AOP model is that its API supports the standard FIPA Agent Communication Language

Agent Speak (Jason)

[edit]

AgentSpeak is an agent-oriented programming language based on logic programming and the belief–desire–intention (BDI) architecture.

For a literal translation of agent-oriented concepts into a scheme unobfuscated as is JADE, behind Java and Object Orientedness, Agent Speak[5] (Jason) provides a "natural" language for agents.

	started.

	+started <- .print("Hello World. ").

GOAL

[edit]

GOAL is an agent programming language for programming cognitive agents. GOAL agents derive their choice of action from their beliefs and goals. The language provides the basic building blocks to design and implement cognitive agents by programming constructs that allow and facilitate the manipulation of an agent's beliefs and goals and to structure its decision-making. The language provides an intuitive programming framework based on common sense or practical reasoning.

SARL Language

[edit]

SARL[6] provides the fundamental abstractions for coding multiagent systems.[7] It uses a script-like syntax (inspired by Scala and Ruby).

package helloworld
import io.sarl.core.Initialize
agent HelloWorldAgent {
        on Initialize {	
             println("Hello World.")
        }
}

PADE (Python Agent DEvelopment framework)

[edit]

PADE[8] is a python package to develop intelligent agents in python language. This framework complies to FIPA and ACL standards.

class AgenteHelloWorld(Agent):
    def __init__(self, aid):
        super(AgenteHelloWorld, self).__init__(aid=aid)
        display_message(self.aid.localname, "Hello World!")

Middleware

[edit]

One way to implement modular or extensible AOP support is to define standard AOP APIs to middleware functions that are themselves implemented as software agents. For example, a directory service can be implemented as a FIPA directory facilitator or DF software agent; life-cycle management to start, stop, suspend and resume agents can be implemented as a FIPA Agent Management Service or AMS agent.[9] A benefit of the AOP approach is that it supports more dynamic roles between different users and providers of applications, services and networks. For example, traditionally, networks and services were usually managed by the network and service provider on behalf of the customer and offered as a single virtual network service but customers themselves are becoming more empowered to integrate and manage their own services. This can be achieved via AOP and APIs to middleware agents that can flexibly and dynamically manage communication.[10]

See also

[edit]
  • Software agent – Computer program acting for a user
  • NetLogo – Programming language
  • Actor model – Model of concurrent computation
  • GOAL – agent programming language for programming cognitive agents

References

[edit]
  1. ^ Shoham, Y. (1990). Agent-Oriented Programming (Technical Report STAN-CS-90-1335). Stanford University: Computer Science Department.
  2. ^ Shoham, Y. (1993). "Agent-Oriented Programming". Artificial Intelligence. 60 (1): 51–92. CiteSeerX 10.1.1.123.5119. doi:10.1016/0004-3702(93)90034-9.
  3. ^ Bellifeminee, Fabio; Agostino Poggi; Giovanni Rimassa (2024). JADE: a FIPA2000 compliant agent development environment. Proceedings of the fifth international conference on Autonomous agents. pp. 216–217. doi:10.1145/375735.376120.
  4. ^ "Rootdev". rootdev.nl. Archived from the original on 2 July 2011. Retrieved 18 September 2022.
  5. ^ Anand S. Rao, 1996. AgentSpeak(L): BDI Agents Speak Out in a Logical Computable Language. Proceedings of Seventh European Workshop on Modelling Autonomous Agents in a Multi-Agent World (MAAMAW-96).
  6. ^ Rodriguez, Sebastian; Gaud, Nicolas; Galland, Stéphane (2014). "SARL: A General-Purpose Agent-Oriented Programming Language". 2014 IEEE/WIC/ACM International Joint Conferences on Web Intelligence (WI) and Intelligent Agent Technologies (IAT). pp. 103–110. doi:10.1109/wi-iat.2014.156. ISBN 978-1-4799-4143-8. S2CID 15508257.
  7. ^ SARL website
  8. ^ "Python Agent DEvelopment framework — Pade 1.0 documentation".
  9. ^ Poslad, S (2007). "Specifying Protocols for Multi-agent System Interaction". ACM Transactions on Autonomous and Adaptive Systems. 2 (4): 15–es. doi:10.1145/1293731.1293735. S2CID 9477595.
  10. ^ Poslad, S.; Pitt, J.; Mamdani, A.; Hadingham, R.; Buckle, P. (1999). Hayzelden, A.; Bigham, J. (eds.). Agent-oriented middleware for integrating customer network services. In: Software Agents for Future Communication Systems. pp. 221–242. doi:10.1007/978-3-642-58418-3_9.