4.5 Complex ObjectsComplex objects are needed to encode messages containing objects derived fromontologies such as concepts and their relations. It is also needed to encode subobjectssuch as attributes. Aside from certain special cases which are discussedin the following subsections, complex objects generally have a type or class andcontain a number <strong>of</strong> fields that can either be primitives or other complex objects.For this reason they can be traversed recursively, encoding each sub-object itcontains as a complex object. The encoder only needs to keep track <strong>of</strong> objectsthat have already been encountered in order to avoid reference loops (Object Acontaining Object B containing Object A) and encode object references instead.Complex ObjectClass NameNumber <strong>of</strong>Sub-ObjectsSub-ObjectField NameSub-Object ...Fig. 7. A complex object is encoded using its class name, the number <strong>of</strong> sub-objectsand pairs <strong>of</strong> field names and encoded sub-objectsAs a result, the format for complex objects can be straightforward (cf. Fig 7).It starts with the fully-qualified class name, defining the type <strong>of</strong> the object. Thisis written to the message data using the string writing technique described inSection 4.3. Since some sub-objects may not be defined (i.e. reference null), notall <strong>of</strong> the sub-objects need to be encoded. Therefore, the class name is followed bythe number <strong>of</strong> encoded sub-objects. This number is written to the message dataas a variable integer as described in Section 4.1. Then the sub-objects are writtenby first writing the name <strong>of</strong> the field in the object containing the sub-object,then recursively encoding the sub-object itself. During decoding, the decoderfirst reads the class name and instantiates an object <strong>of</strong> that class. It then readsthe number <strong>of</strong> sub-objects and finishes by decoding the sub-objects themselves,adding them to the object fields using the appropriate accessor methods.Generally, it is expected that the objects <strong>of</strong>fer accessor methods as describedin the Java Bean specification and the encoder will only encode fields for whichsuch accessor methods are available. However, using annotations, a class maydeclare that the encoder should encode the field regardless <strong>of</strong> the existence <strong>of</strong>accessor methods. In this case the fields are accessed directly using the Javareflection API.4.6 ArraysArrays are encoded in a manner similar to complex objects, starting with thearray type and concatenating the number <strong>of</strong> array components and the compo-109
nents themselves. However, since the array type already provides type informationabout the array components, this information can be used to reduce theamount <strong>of</strong> information that needs to be stored in the message. The array encodingtherefore supports two modes, a raw mode which is used for primitivetype values and a complex mode for objects. In raw mode, the components arejust written without additional information about the type <strong>of</strong> each component.This can only be done in case <strong>of</strong> primitive types for two reasons: First, primitivetypes cannot be subclassed, thus the array type is always sufficient to derive thecomponent type. Second, primitive values are passed by value and do not havea null reference that requires special encoding.This is not the case for objects. The array type may only refer to a superclass<strong>of</strong> the component object and the component object may simply be a nullreference. This means that type information about each array component needsto be included. However, in most cases it is safe to assume that the array typedescribes the type <strong>of</strong> the component. Therefore, each component is precededby a boolean value indicating whether further component type information isstored or if the type information can be derived from the array type. Only if thisflag indicates that type information is stored, for example when dealing withsubclasses or null values, the flag is followed by the type information. Otherwise,the component object is directly appended after the boolean flag.In the next section we will evaluate Jadex Binary in terms <strong>of</strong> the performanceand compactness features and compare it to three other message formats. Thiswas done with a number <strong>of</strong> tests in which the message formats were measuredand evaluated.5 EvaluationIn order to evaluate the performance and compactness feature <strong>of</strong> Jadex Binary,we conducted a series <strong>of</strong> tests. The experiments were conducted using an Inteli5 750 processor with four cores clocked at 2.67 GHz. The machine was suppliedwith 8 GiB <strong>of</strong> memory; however, the Java heap size was limited to 2 GiB. TheJava environment used was the Oracle Java SE 6 Update 31 which was runningon a current version <strong>of</strong> Gentoo Linux compiled for the x86-64 instruction setwith an unpatched Linux 3.2.2 kernel.The content formats used were FIPA SL, the built-in Java serialization, JadexXML and Jadex Binary. The Jade agent platform 4.1.1 using the BeanOntologywas used as a representative <strong>of</strong> Java SL encoding. A test class representingan agent action was used as data set to be encoded. The agent action samplecontained a 514 byte string literal, a second string containing a randomized longvalue encoded as string, a single integer value, an array <strong>of</strong> 20 integer literals,an array <strong>of</strong> boolean values and finally an array <strong>of</strong> objects <strong>of</strong> the class itself torepresent recursively contained sub-objects.For the compactness tests, this array contained 100 further instances <strong>of</strong> theclass, which itself had the field set to null. For the performance tests, the number<strong>of</strong> objects in that array was varied, starting at 10000 objects and increasing in110
- Page 2 and 3:
Proceedings of the Tenth Internatio
- Page 4 and 5:
OrganisationOrganising CommitteeMeh
- Page 6:
Table of ContentseJason: an impleme
- Page 10 and 11:
in Sect. 3 the translation of the J
- Page 12 and 13:
init_count(0).max_count(2000).(a)(b
- Page 14 and 15:
For instance, a failure in the ERES
- Page 16 and 17:
{plan, fun start_count_trigger/1,fu
- Page 18 and 19:
single parameter, an Erlang record
- Page 20 and 21:
1. Belief annotations. Even though
- Page 22 and 23:
decisions taken during the design a
- Page 24 and 25:
Conceptual Integration of Agents wi
- Page 26 and 27:
Fig. 2. Active component structurep
- Page 28 and 29:
the service provider component. As
- Page 30 and 31:
Fig. 4. Web Service Invocationretri
- Page 32 and 33:
01: public interface IBankingServic
- Page 34 and 35:
tate them in the same way as in the
- Page 36 and 37:
01: public interface IChartService
- Page 38 and 39:
implementations being available for
- Page 41:
deliberative behavior in BDI archit
- Page 44 and 45:
layer modules (i.e. nodes) can be d
- Page 46 and 47:
different methods to choose the cur
- Page 48 and 49:
also a single scheduler module, imp
- Page 50 and 51:
andom choice (OR), conditional choi
- Page 52 and 53:
- Dealing with conflicts based on p
- Page 54 and 55:
5. Brooks, R. A. (1991) Intelligenc
- Page 56 and 57:
An Agent-Based Cognitive Robot Arch
- Page 58 and 59:
It has been argued that building ro
- Page 60 and 61: EnvironmentHardwareLocal SoftwareC+
- Page 62 and 63: a cognitive layer can connect as a
- Page 64 and 65: can reliably be differentiated and
- Page 66 and 67: 4 ExperimentTo evaluate the feasibi
- Page 68 and 69: learn or gain knowledge from experi
- Page 70 and 71: A Programming Framework for Multi-A
- Page 72 and 73: exchange and storage of tuples (key
- Page 74 and 75: Although some success [13] [14] hav
- Page 76 and 77: as well as important non-functional
- Page 78 and 79: component plans have been instantia
- Page 80 and 81: A in the example) can evaluate all
- Page 83 and 84: 1. robot-1 issues a Localization(ro
- Page 85 and 86: ACKNOWLEDGMENTThis work has been su
- Page 87 and 88: The code was analysed both objectiv
- Page 89 and 90: a conversation is following. Additi
- Page 91 and 92: the context of a communication-heav
- Page 93 and 94: Table 1. Core Agent ProtocolsAgent
- Page 95 and 96: statistically significant using an
- Page 97 and 98: to the conversation and has a perfo
- Page 99 and 100: principal reasons. Firstly, it is a
- Page 101 and 102: 2. Muldoon, C., O’Hare, G.M.P., C
- Page 103 and 104: In the following section we will at
- Page 105 and 106: DevelopmentProductionHuman Readabil
- Page 107 and 108: will then evaluate this new format
- Page 109: encoder, it is first checked if the
- Page 113 and 114: optimized for this format feature s
- Page 115 and 116: Java serialization and Jadex Binary
- Page 117 and 118: 10. P. Hoffman and F. Yergeau, “U
- Page 119 and 120: Caching the results of previous que
- Page 121 and 122: querying an agent’s beliefs and g
- Page 123 and 124: or relative performance of each pla
- Page 125 and 126: were run for 1.5 minutes; 1.5 minut
- Page 127 and 128: Size N K n p c qry U c upd Update c
- Page 129 and 130: epresentation. The cache simply act
- Page 131 and 132: 6 ConclusionWe presented an abstrac
- Page 133 and 134: Typing Multi-Agent Programs in simp
- Page 135 and 136: 1 // agent ag02 iterations (" zero
- Page 137 and 138: 3.1 simpAL OverviewThe main inspira
- Page 139 and 140: 3.2 Typing Agents with Tasks and Ro
- Page 141 and 142: Defining Agent Scripts in simpAL (F
- Page 143 and 144: that sends a message to the receive
- Page 145 and 146: * error: wrong type for the param v
- Page 147 and 148: Given an organization model, it is
- Page 149 and 150: Learning to Improve Agent Behaviour
- Page 151 and 152: 2.1 Agent Programming LanguagesAgen
- Page 153 and 154: choosing actions is to find a good
- Page 155 and 156: 1 init module {2 knowledge{3 block(
- Page 157 and 158: of a module. For example, to change
- Page 159 and 160: if bel(on(X,Y), clear(X)), a-goal(c
- Page 161 and 162:
mance. Figure 2d shows the same A f
- Page 163 and 164:
the current percepts of the agent.
- Page 165:
Author IndexAbdel-Naby, S., 69Alelc