Giter Club home page Giter Club logo

svsintel / multiagent-fipa_acl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rock-multiagent/multiagent-fipa_acl

0.0 0.0 0.0 20.33 MB

Library for FIPA compliant communication. Includes a message parser and a message generator for bit-efficient FIPA ACL messages. Also contains a conversation monitor library to validate the message flow of a communication

License: GNU Lesser General Public License v3.0

CMake 1.15% C++ 96.70% Ruby 1.70% C 0.12% Shell 0.19% Gnuplot 0.15%

multiagent-fipa_acl's Introduction

FIPA ACL Library

This library provides an implementation for the representation of messages conforming to the FIPA specifications hosted at http://www.fipa.org

This library implements the fipa acl message in different encodings: bitefficient, XML and string encoding. In addition it provides the implementation of the bitefficient message envelope. No implementation exists for a string representation of the message envelope, since according to http://www.fipa.org/specs/fipa00073/DC00073D.html this standard has been deprecated.

Next to the standard implementation of message and envelope types, this library provides a statemachine to monitor a message flow based on performatives. The conversation monitor is capable of monitoring the conversation based on the protocol specified in the messages. There are scxml documents specifying how these protocols are defined. Protocols may contain subprotocols, which is partially supported. For constraints and examples see the documentation of fipa::acl::ConversationMonitor Examples

The following list typical application examples when using this library.

Creating messages

#include <fipa_acl/fipa_acl.h>

using namespace fipa::acl;

ACLMessage message;
message.setPerformative(ACLMessage::REQUEST_WHEN);
message.setContent("actual payload data");
message.setSender(AgentID("sender-agent"));
message.addReceiver(AgentID("receiver-agent-0"));
message.addReceiver(AgentID("receiver-agent-1"));
message.addReplyTo(AgentID("sender-agent"));
message.setInReplyTo("in-reply-to-nothing");
message.setReplyBy(base::Time::now());
message.setConversationID("identifier-of-the-conservation");
message.setProtocol("protocol-of-message-flow");
message.setLanguage("a-content-language");
message.setEncoding("encoding-of-content");
message.setOntology("an-ontology");

Generate messages in a specific representation type

#include <fipa_acl/fipa_acl.h>
using namespace fipa::acl;

ACLMessage message;
message.setPerformative(ACLMessage::REQUEST_WHEN);
...
std::string encodedMsgData = MessageGenerator::create(message, fipa::acl::representation::STRING_REP);

...

ACLMessage decodedMsg;
MessageParser::parseData(encodedMsgData, decodedMsg, fipa::acl::representation::STRING_REP);

Generation and parsing of an envelope

#include <fipa_acl/fipa_acl.h>

using namespace fipa::acl;

ACLMessage message;
message.setPerformative(ACLMessage::REQUEST_WHEN);
...

ACLEnvelope envelope(message, representation::BITEFFICIENT);

std::string envelopeAndMsgData = EnvelopeGenerator::create(envelope, representation::BITEFFICIENT);

...
ACLEnvelope decodedEnvelope;
// either access the message directly
ACLMessage msg = decodedEnvelope.getACLMessage();

// or decode more explicitely to access further envelope information
EnvelopeParser::parseData(envelopeAndMsgData, decodedEnvelope, representation::BITEFFICIENT);

// Changes to an envelope are added as overlay while being transported across message
// transport services which add further information or update the receiver fields.
//
// Getting the base envelope and initial value
ACLBaseEnvelope outBaseEnvelope = decodedEnvelope.getBaseEnvelope();
// Getting the very last values, i.e. when all overlays have been applied in the right
// order
ACLBaseEnvelope outFlattenedEnvelope = decodedEnvelope.flattened();

Available bindings

Ruby bindings exist for using fipa acl

require 'fipa-message'
include FIPA
msg = ACLMessage.new
msg.setPerformative :request_whenever
msg.setProtocol "test"

sender = AgentID.new 'sender'
msg.setSender(sender)

multiagent-fipa_acl's People

Contributors

2maz avatar doudou avatar goldhoorn avatar si3792 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.