23.08.2015 Views

Here - Agents Lab - University of Nottingham

Here - Agents Lab - University of Nottingham

Here - Agents Lab - University of Nottingham

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

will then evaluate this new format based on the performance and compactnessfeatures based on a comparison with other agent message formats.4 Format DescriptionSince the primary goal <strong>of</strong> the Jadex Binary format is to emphasize the compactnessand performance properties <strong>of</strong> the format, it uses binary instead <strong>of</strong>string-based encoding. The primary concern is the serialization <strong>of</strong> the objectsrepresenting the message, such as, but not exclusively, ontology objects. In addition,some techniques are employed to prefer the compact encoding <strong>of</strong> commoncases <strong>of</strong> data over rare cases, providing some simple compression based on themeta-information available from the objects and typical use cases. The format isbased on a set <strong>of</strong> techniques to encode primitive types which are then used to encodemore complex data. The following subsections will start with the primitivetypes and then proceed to more complex types.4.1 Variable-sized IntegersA key concept used in Jadex Binary are variable-sized integers. The goal is toencode unsigned integer values in a variable-sized format that encodes smallvalues with less space than larger ones. The technique is based on the encodingtechnique <strong>of</strong> element IDs in the Extensible Binary Meta-Language (EBML)[8],which again is based on variable encoding scheme used for UTF-8[9].Bytes Format Value Range1 1####### 0 to 1272 01###### ######## 128 to 165113 001##### ######## ######## 16512 to 21136634 0001#### ######## ######## ######## 2113664 to 270549120Fig. 4. Examples <strong>of</strong> variable-sized integers and their value rangesA variable-sized integer is byte-aligned and consists <strong>of</strong> at least one byte (cf.Fig. 4). The number <strong>of</strong> zero bits starting from the highest-order bits before thefirst one-valued bit denotes the number <strong>of</strong> additional bytes called extensions thatbelong to this variable integer. The rest <strong>of</strong> the byte is then used to encode thehighest-order bits <strong>of</strong> the integer value, the extensions then provide the lowerorder bits <strong>of</strong> the value. This value is then shifted by a constant equal to theend <strong>of</strong> the previous value range plus one. This technique <strong>of</strong> storing integer valueuses less space to encode small values at the expense <strong>of</strong> additional space <strong>of</strong> highvalues.The next part will describe how the format encodes boolean values which canbe used in to extend variable integers to support negative values. Furthermore,variable integers are also heavily used as identifiers during string encoding.106

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!