面向代理的编程代码示例

标签 agent

我目前正在学习面向代理的编程, 而且我很难找到用任何语言编写的示例代码,这些代码是为了在实际编程模型中演示该想法而编写的。

任何人都可以提供一个链接,其中编写了一段简单的代码来演示 AOP 的思想吗?

最佳答案

首先,让我们试着对什么是AOP有个共同的认识。从 Yoav Shoham (1993) 撰写的“面向代理的编程”论文中,我们有:

Agent-oriented programming (AOP), can be viewed as a specialization of object-oriented programming. The state of an agent consists of components such as beliefs, decisions, capabilities, and obligations; for this reason the state of an agent is called its mental state. The mental state of agents is described formally in an extension of standard epistemic logics: beside temporalizing the knowledge and belief operators, AOP introduces operators for obligation, decision, and capability. Agents are controlled by agent programs, which include primitives for communicating with other agents. In the spirit of speech act theory, each communication primitive is of a certain type: informing, requesting, offering, and so on.

这个概念的一个很好的实现是 Jason,在 Rafael H. Bordini、Jomi Fred Hübner 和 Michael Wooldridge(2007 年)撰写的“使用 Jason 在 AgentSpeak 中编程多代理系统”一书中对此进行了详细的解释。

查看 AOP 的应用程序可能是这个小应用程序: https://github.com/cleberjamaral/beersponsor

在这个简单的应用程序中有 3 个代理,一个机器人,一个(机器人的)所有者和一个赞助商。这个想法是,主人想喝啤酒,而机器人会带来他想要的所有啤酒。但是在一些交付之后冰箱里的啤酒用完了,所以,一个 Java IDE 被启动,用户可以点击向这个懒惰的家伙赞助啤酒。

要运行它,您可以下载 Jason 并运行 JEdit (Java -jar JEdit.jar),它是 Jason 的编程 IDE。 https://sourceforge.net/projects/jason/

您可以在此处获得有关此简单实现的更多详细信息:http://jasonagents.blogspot.com.br/2015/09/exemplo-de-integracao-com-interface.html

关于面向代理的编程代码示例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48354916/

相关文章:

powershell - Azure DSC VM 扩展 : Why does $Home directory change?

clojure - var 或 ref/atom/agent 用于常量值?

java - Jade Library-容器之间的代理移动性

mysql - 在 mysql 中获取 SQL 代理

python - 如何将自定义 Openai 健身房环境与 Openai 稳定基线 RL 算法结合使用?

java - 如何使用 bytebuddy 更改方法签名?

macos - 关于“应用程序”框,是否已将代理(UIElement)设置为"is"?

java - JADE代理数据通信

eclipse - 在 Eclipse 中运行 Jason 应用程序

linux - 为什么 docker 中的拉取过程是这样的?