=Paper= {{Paper |id=Vol-1382/paper1 |storemode=property |title=MUSA: a Middleware for User-driven Service Adaptation |pdfUrl=https://ceur-ws.org/Vol-1382/paper1.pdf |volume=Vol-1382 |dblpUrl=https://dblp.org/rec/conf/woa/CossentinoLLS15 }} ==MUSA: a Middleware for User-driven Service Adaptation== https://ceur-ws.org/Vol-1382/paper1.pdf
       Proc. of the 16th Workshop “From Object to Agents” (WOA15)                                                                           June 17-19, Naples, Italy



                     MUSA: a Middleware for User-driven
                            Service Adaptation
                                     M. Cossentino, C. Lodato, S. Lopes, L. Sabatucci
                                                 ICAR-CNR, Palermo, Italy
                                   {cossentino, c.lodato, s.lopes, sabatucci}@pa.icar.cnr.it


   Abstract—One of the current challenges of Service                tem for the composition and the orchestration of services
Oriented Engineering is to provide instruments for dealing          in a distributed and open environment.
with dynamic and unpredictable environments and chang-                 MUSA aims at providing run-time modification of
ing user requirements. Traditional approaches based on              the flow of events, dynamic hierarchies of services and
static workflows provide little support for adapting at run-
                                                                    integration of user preferences together with a self-
time the flow of activities.
   MUSA (Middleware for User-driven Service Adapta-
                                                                    adaptive system for execution activities that is also able
tion) is a holonic multi-agent system for the self-adaptive         to monitor unexpected failures and to reschedule in order
composition and orchestration of services in a distributed          to optimize the flow.
environment.                                                           Self-adaptation is based on the intuition to break the
                                                                    static constraints of a classic workflow model by decou-
                         I. I NTRODUCTION                           pling the ‘what’ (the outcome the workflow requires to
   In the last decade web-services have gained industry-            be addressed) from the ‘how’ (the way this result can be
wide acceptance as the universal standard for enterprise            obtained) [4].
application integration [1]. Their strengths is to be easily
combined as building blocks of a large distributed and
                                                                                                ontology                     ontology
scalable software application [2]. On the other side,               user           analyst
                                                                                              commitment        POD        commitment
                                                                                                                                          dev team
                                                                                                                                                                  service
                                                                                                                                                                  provider
                                                                        goal injection
fostering user participation in business process is an                                               MUSA RUNNING SYSTEM
                                                                                                                                         capability
                                                                                                                                        deploy and     service
                                                                                                                                                                         service
enormous opportunity, where the value is direct and                                      WHAT                                 HOW
                                                                                                                                        maintenance    provider
                                                                                                                                                                         provider

proportional to the capability to customize service pa-                    GOALS
                                                                                                           bridge

rameters according to users’ needs [3].
                                                                                                                                        CAPABILITIES         REAL SERVICES
                                                                                          ACTIVE GOALS                TASKS


   To date, BPEL is one of the most used standards
for implementing the orchestration of services. Even
                                                                                                         Figure 1. The MUSA vision.
if workflow-based languages are greatly supported by
industry and research, their approach reveals being static
and not easy to extend for supporting some advanced                    Figure 1 illustrates the underlying idea. Services are
features as, for example, run-time modification of the              provided as usual by world-wide companies, according
flow of events, dynamic hierarchies of services, integra-           to their own business processes. MUSA provides a
tion of user preferences and, moreover, it is not easy to           platform in which 1) virtual enterprises can deploy some
provide a system for run-time execution, rescheduling               capabilities that wrap real services, completing them
and monitoring of activities that is also able to deal with         with a semantic layer for their smart use; 2) analysts
unexpected failures and optimization.                               and/or users can inject their goals for requesting a spe-
   Recently, the research community on services has                 cific outcome. Under the hypothesis that both goals and
been very active in defining techniques, methods and                capabilities refer to the same semantic layer (described
middleware for supporting dynamic execution model for               as an ontology), then agents of the system are able to
workflows.                                                          conduct a proactive means-end reasoning for composing
   This paper presents MUSA (Middleware for User-                   available capabilities into task for addressing the user
driven Service Adaptation) 1 , a holonic multi-agent sys-           request.
                                                                       Conceptually, this has required the following ingre-
  1
      Website: http://aose.pa.icar.cnr.it/MUSA/.                    dients: goal-orientation for making user-requirements




                                                                    1
Proc. of the 16th Workshop “From Object to Agents” (WOA15)                                         June 17-19, Naples, Italy

explicit in the system thus breaking the strict coupling            A user-goal is a desired change in the state of
among activities of the workflow; holonic system, for            the world an actor wants to achieve. In the proposed
implementing a dynamic and re-configurable architecture          approach a goal describes the starting state and the final
of autonomous and proactive agents.; self-adaptation, for        states in terms of states of the world. It is therefore
generating smart and dynamic plans as response to user-          necessary to make a sharp distinction between BDI
requests and to unpredictable events of the environment.         goals and user-goals. A user-goal is injected into the
   The whole system has been implemented by using                system at run-time (and therefore it not known a-priori
JASON [5] and CArtAgO [6], an agent facility based               by agents) On the other side a BDI goal is defined at
on the AgentSpeak language [7] and the BDI theory [8].           design-time and the plans for addressing it are hard-
   The running example used along the whole paper                coded into the agent. Another difference is that an agent
concerns the domain of Travel Services. The system               is automatically committed to fulfill all its BDI goals,
acts as a smart tour operator for composing simple               whereas it owns a higher level of autonomy with respect
services provided in a local area as, for example, flights,      to user-goals [12]. For example, an agent may check
trains, hotels and other tourist attractions. The objective      whether it is able to address the goal and then it may
is to provide users with a product, Travel, that is the          decide of committing to it (generally when the agent can
composition and orchestration of atomic services.                get some type of advantage from the situation).
   The papers is organized as follows: Section II dis-              A goal model is a directed graph where nodes are
cusses the languages for injecting goals and deploy-             goals and edges are AND/OR Refinement or Influence
ing capabilities into the system. Section III provides           relationships. In a goal model there is exactly one root
details about the dynamic and distributed architecture           goal, and there are no refinement cycles. A goal model
that emerges for addressing a user-request. Section IV           is an analysts instrument to create dependencies among
illustrates the core algorithm for allowing the agent to         goals.
reason on goals and capabilities and for creating plans.            A capability describes a concrete trajectory in terms
Finally, Section V reports some considerations about the         of states of the world the system may intentionally use to
approach.                                                        address a given result. Every agent knows its capabilities
                                                                 together with the way these can be employed. The effect
       II. D ECOUPLING G OALS AND S ERVICES                      of a capability is an endogenous evolution of the state
                                                                 of the world (a function that takes a state of world and
   MUSA exploits BDI reasoning since it offers the               produces a new state of world). The capability can be
required level of abstraction to build an autonomous             pursued only if a given pre-condition is true whereas the
and self-aware agent. In particular self-awareness is            post-condition must be true after the capability has been
intended as the ability of agents to recognize their own         successfully executed.
capabilities (getting knowledge of their preconditions
and effects), and to conduct some reasoning over them.           A. GoalSPEC
The Belief-Desire-Intention (BDI) model was developed               In order to decouple user-goals from web-services,
at the Stanford Research Institute during the activities of      MUSA provides GoalSPEC [13], a language designed
the Rational Agency project [9]. The BDI model assumes           for specifying user-goals and, at the same time, enabling
software agents had a mental state and a decision making         at the same time goal injection and software agent
model representing a promising base for implementing             reasoning. It takes inspiration from languages for speci-
autonomous and self-adaptive systems [10], [11].                 fying requirements for adaptation, such as RELAX [14],
   In order to make the system able to reason on user-           however GoalSPEC is in line with the definition of goal.
requests and available capabilities a solution is to elect       The language is based on structured English and it adopts
goals and capabilities as first-class entities as it will be     a core grammar with a basic set of keywords that must
described in this section.                                       be extended by plugging-in a domain ontology.
   A state of the world is informally described as a set            The core element of the metamodel is the Goal
of non-contradictory first order facts with the assumption       (desired by some subject). It is composed of a Trigger
that everything that is not explicitly declared is assumed       Condition and a Final State. The trigger condition is
to be false. This is dynamically maintained by the agents        an event that must occur in order to start acting for
of the system as the result of their perceptions and             addressing the goal. The final state is the desired state of
deductions.                                                      the world that must be addressed. The Subject describes




                                                             2
    Proc. of the 16th Workshop “From Object to Agents” (WOA15)                                                             June 17-19, Naples, Italy

                                                                                            agent_goal( %TO VISIT SICILY FOR 1 WEEK
                                                                                                params( [curr_date] , [
                               TO VISIT SICILY                                                     category(curr_date, datetime)]),
                                FOR 1 WEEK
                                                                                                tr_condition( in(curr_date,
                                                                                                   date(2015,7,16),
                                  AND                                                              date(2015,7,23))),
                                                                                                final_state( be_visiting(sicily) ),
                                                                                                herbert
                TO VISIT       TO VISIT
               PALERMO                                   TO VISIT                           )
                              AGRIGENTO
              AT LEAST 2                                SYRACUSE                            ...
                 DAYS                                                                       agent_goal( %TO VISIT SYRACUSE
                                                            AND                             params( [t] , [
                                                                                                   category(t, integer)]),
                                                 TO VISIT           TO ATTEND                   tr_condition( be_at(syracuse) ),
                                                  GREEK               GREEK                     final_state( and([visited(syracuse,t),
                                                 TEMPLE              TRAGEDY
                                                                                                                  t>1] ),
         a)                                                                                     herbert
                                                                                                                                     b)
                                                                                            )


Figure 2. On the left side, an example of goal-model the user can inject into the smart travel system. On the right side, an instance of the
same goal-model, but expressed in terms of agent’s beliefs.



the name of the involved person, role or group of persons                                                  Table I
that owns the responsibility to address the goal.                                     A BSTRACT S PECIFICATION OF THE F LIGHT B OOKING
                                                                                                         CAPABILITY.
   In the domain of the Travel Service, GoalSPEC allows
the user to describe the kind of travel she desires.                                Name               FLIGHT BOOKING
Examples of GoalSPEC productions are listed below:
                                                                                    Input              D PT P LACE : A IRPORT,
  1) WHEN date(16,2,15) THE user SHALL                                                                 D PT DATE : DATE ,
     visited(Palermo) OR visited(Catania)                                                              A RR P LACE : A IRPORT,
                                                                                                       PASS N UM : I NTEGER
  2) WHEN date(DD,MM,YY) AND (DD > 15 AND                                           Output             F LIGH I D : S TRING ,
     DD < 20) THE user SHALL enjoyed(beach)                                                            D PT S CHEDULE : DATE ,
                                                                                                       A RR S CHEDULE : DATE
  3) WHEN date(18,2,15) THE user SHALL
                                                                                    Constraints        DptP lace 6= ArrP lace
     visited(Syracuse) AND attended(greek tragedy)                                                     DptSchedule > DptDate
                                                                                                       ArrSchedule > DptSchedule
   Figure 2.a shows an example of goal-model where
                                                                                                       P assN umber > 1
each goal must be further refined with GoalSPEC. When
                                                                                    Pre-Condition      seat available(F lighId, DptSchedule,
injected into the system, the goal is converted into a
                                                                                                       P assN um)
set of agent’s beliefs (Figure 2.b) in which the Trigger
                                                                                    Post-Condition     f light booked(F lighId, DptSchedule,
Condition and the Final State are expressed as first-order                                             P assN um)
logical conditions to be tested over the current State of
                                                                                    Evolution          evo = {remove(being at(DptP lace)),
the World.                                                                                             add(being at(ArrP lace))}
   For a complete specification of the syntax of Goal-
SPEC see [13], whereas details of the conversion into
agent’s beliefs are provided in [12].
B. Capability                                                                   agent may use for addressing changes in the state of
   In AI, the need for representing software agent’s                            the world. A Capability is made of two components: an
actions in order to implement reasoning directed towards                        abstract description (a set of beliefs that makes an agent
action is a long-dated issue [15], [16], [17], [18]. An                         aware of owning the capability and able to reason on its
agent is able to achieve a goal by doing an action if either                    use), and a concrete implementation (a set of plans for
the agent knows what the action is or it knows that doing                       executing the job).
the action would result in the goal being satisfied [15].                          We defined a template for providing the abstract de-
   We use a ‘robotic-planning-like’ approach to address                         scription of a capability as a refinement of that presented
user-goals, in which the Capability is the internal rep-                        in [19] for LARKS (language for advertisement and
resentation of an atomic unit of work that a software                           request for knowledge sharing).




                                                                                3
Proc. of the 16th Workshop “From Object to Agents” (WOA15)                                                    June 17-19, Naples, Italy


           Calculate evolution                                                 By reasoning on the abstract side (input/output/pre-
                                                                            condition...) the agent may decide when to use the ca-
                  FLIGHT_BOOKING CAPABILITY
                                                                            pability. An example of abstract description is provided
                                                                            in Table I.
                   search_
                  availability
                                           get_flight
                                             _info
                                                                               On the other side, the concrete implementation en-
                                                            flight
                                 flight
                                    id                   departure,         capsulates the code for interacting with the real service
                                                         destination,
                                                          schedule
                                                                            by using SOAP and WSDL through the HTTP/HTTPS
                                                                            protocol. The implementation of a capability for dealing
                FLIGHT BOOKING SERVICE PARTY
                                                                            web-services is made of three parts: the calculate evolu-
           Dispose Service                                                  tion, the dispose service and the compensate service.
                                                                               The calculate evolution protocol is used when com-
                 FLIGHT_BOOKING CAPABILITY
                                                                            posing the whole plan to address a goal; at this stage
                                                                            the agent has to configure the capability for a specific
                         book_seat
                                                                            context. This means to establish input/output param-
                                          confirmation                      eters to generate a contract with other agents it is
                                                                            collaborating with. More details will be in Section IV-B
                    FLIGHT BOOKING SERVICE                                  when illustrating the algorithm for the Goal/Capability
                                                                            Deliberation. For instance, the calculate evolution for
           Compensate Service                                               the flight booking searches for flights (Figure 3) that
                 FLIGHT_BOOKING CAPABILITY                                  are compatible with a given goal, i.e those flights that
                                                                            match with a given DptPlace, DptDate, ArrPlace and
                      cancel_booking                                        PassNumber.
                                          confirmation
                                                                               The dispose service and the compensate service pro-
                                                                            tocols will be used for orchestration and self-adaptation
                                                                            purposes (see Section IV-C).
                    FLIGHT BOOKING SERVICE
                                                                               After that a plan has been established for the exe-
Figure 3. This figure reveals the business logic for the flight
                                                                            cution, the orchestration phase generates, through the
booking capability composed of three parts: the calculate evolution,        dispose service, the actual value for the user, i.e the user-
the dispose service and the compensate service.                             goal fulfillment. For instance, the dispose protocol for the
                                                                            flight booking service actually book the specified flight
                                                                            and produces a ticket for the user.
  The template is made of the following elements:                              However a plan may be subject to changes for sev-
                                                                            eral purposes. The Self-Adaptation Loop monitors for
  • Name is the unique label used to refer to the                           failures or new goals that may affect the running plan.
    capability                                                              When a plan changes at run-time, it could be the case
  • InputParams is the definition of the input variables
                                                                            that some services that have been disposed are no more
    necessary for the execution.                                            useful in the new plan. The proper way to proceed is to
  • OutputParams is the definition of the output vari-
                                                                            use the compensate service protocol in order to terminate
    ables produced by the execution.                                        the contract with a service. For instance, the compensate
  • Constraints is an optional (logical or structural)
                                                                            service for the flight booking tries to cancel the user
    constraints on input/output variables.                                  booking for a specified flight.
  • Pre-Condition is a condition that must hold in the
    current state of the world in order to execute the
                                                                            C. Problem Ontology Description
    capability.
  • Post-Condition is a condition that must hold in                            The previous sections have illustrated how goals and
    the final state of the world in order to assert the                     capabilities grounds on the state of the world and
    capability has been profitable.                                         therefore, under the surface, they employ first-order
  • Evolution is a function that describes how the                          predicates.
    capability will impact the state of the world as                           In MUSA the Problem Ontology Diagram (POD) [20]
    consequence of its execution.                                           is used to provide a denotation to significant states of




                                                                        4
    Proc. of the 16th Workshop “From Object to Agents” (WOA15)                                               June 17-19, Naples, Italy

the world thus giving a precise semantics to goals and           sub-holons). An example of concrete holon is an organ
capabilities                                                     that is a part of an organism, but a whole with regard
   An ontology is the specification of a conceptualization       to the cells of which it is comprised. The human mind
made for the purpose of enabling knowledge sharing and           uses holarchies for organizing abstract concepts too. An
reuse [21]. A POD is a conceptual model (and a set of            example is a word that is part of a sentence, but a whole
guidelines [22]) used to create an ontological commit-           with regard to the letters that compose it.
ment between developers of capabilities and users who               A holon has not necessarily the same properties of its
inject goals. An ontological commitment is an agreement          parts, as well as if a bird can fly, its cells can not. Holon
to use a thesaurus of words in a way that is consistent          is therefore a general term for indicating a concrete or
(even if not complete) with respect to the theory specified      abstract entity that has its own individuality, but at the
by an ontology [23].                                             same time, it is embedded in larger wholes.
   This artifact aims at producing a set of concepts,
predicates and actions and at creating a semantic network                          holon
in which these elements are related to one another.                                                                level N

The representation is mainly human-oriented but it is
particularly suitable for developing cognitive system
                                                                                                                  level N-1
that are able of storing, manipulating, reasoning on,
and transferring knowledge data directly in first-order
predicates [22].                                                                                                 level N-2
   Grounding goals and capability abstract description on
the same ontology is fundamental to allow the system                 Figure 4. Holarchy layered architecture (elaborated from [27]).
to adopt a proactive means-end reasoning to compose
plans. By committing to the same ontology, capabilities             However, each holon is influenced by, and influences
and goals can be implemented and delivered by different          its larger wholes. And since a holon also contains parts,
development teams and at the same time enabling a                it is similarly influenced by, and influences these parts:
semantic compatibility between them.                             information flows bidirectionally between smaller and
   More details on the POD are in [20], whereas the              larger systems.
link between goals and ontology is detailed in [22].                The problem of service composition may be observed
Finally we also provide GIMT (Goal Identification and            as a phenomenon of holon formation [28]. In MUSA
Modeling Tool) a tool for supporting ontology building           services of a choreography maintain their autonomy but
and goal modeling [24].                                          they all collaborate for providing an integrated func-
          III. H OLONIC A RCHITECTURE FOR                        tionality. A composed service is therefore a holon who
                  S ELF -A DAPTATION                             embeds other component services in a recursive fashion.
                                                                    A holonic multi agent system is a software system
   Holons provide an elegant and scalable method to
                                                                 made of autonomous holons where the holon is defined
guarantee knowledge sharing, distributed coordination
                                                                 recursively (see Figure 4). The holon at generic level N
and robustness.
                                                                 is made of holons a level N-1 kept together by a commit-
   Holon is a Greek term for indicating something that
                                                                 ment relationship. The resulting structure is a holarchy,
is simultaneously a whole and a part [25]. It has been
                                                                 i.e. a hierarchical structure generated by holons and sub-
used for introducing a new understanding of ecosystems,
                                                                 holons where the base case is the agent representing
and their hierarchical nature. A general definition may
                                                                 the atomic holon (it is not further decomposable in sub-
be the following:
                                                                 holons).
     A holon is a system (or phenomenon) which                      In MUSA the commitment function that glues together
     is an evolving self-organizing structure, con-              all the sub-holons to form a super-holon is given by
     sisting of other holons [26]. A holon has its               the injected GoalSPEC. The user-goals represent the
     own individuality, but at the same time, it                 common objective that the holons have to address.
     is embedded in larger wholes (principle of
     duality or Janus effect).                                   A. The Basic-Holon Schema
   Many concrete things in nature are organized as a               The holon formation is an emergent phenomenon. This
holarchy (the recursive structure generated by holons and        section provides details about the static structure of each




                                                                 5
Proc. of the 16th Workshop “From Object to Agents” (WOA15)                                                June 17-19, Naples, Italy

holon of the system whereas dynamic aspects of holon                2) it maintains the current state of the world, obtained
formation and execution are given in Section IV.                       through the perception of all the sub-holons and
   In MUSA all the agents are (atomic) holons, however                 it checks for the integrity of the holon structure
aggregations of holons (in super-holons) may emerge at                 (verifying all sub-holons are active);
run-time for managing composed services. A holarchy                 3) even if each worker maintains its autonomy, the
is formed as the recursive replication of the same basic               head influences their activity i) by guaranteeing
schema. This template defines that each holon of the                   their coordination and synchronization, or ii) by
system may contain sub-holons playing one of the three                 deciding for the re-organization of the holon struc-
roles: service-broker, state-monitor or goal-handler.                  ture as a consequence of failures or unexpected
   The service broker is the role in charge of establishing            events.
a relationship with one or more end points of a remote
service. The candidate service-broker owns the capability               IV. P ROACTIVE M EANS -E ND R EASONING
for managing the conversation with the party that pro-              This section illustrates dynamic aspects of the forma-
vides the service (for example the flight booking shown          tion of holons according to the structural rules specified
in Figure 3). The service broker must also be able to            in Section III-A. The key for dynamically generating
catch exceptions and failures and to raise the need for          holons is what we call Proactive Means-End Reason-
self-adaptation.                                                 ing [29], a distributed procedure that allows agents to
   The state monitor is the role responsible for monitor-        autonomously decide how to combine their available
ing the user environment (both physical and simulated,           capabilities and therefore how to generate holons.
including persons acting inside). The state of the world is
an abstraction for the operative context in which services       A. Goal Model Decomposition and Holon Formation
are going to be provided. The perception of the state               Section II-A has introduced the language for goal
of the world is often necessary for invoking services.           injection. However a goal is rarely injected into the
This role is in charge of providing the service broker           system as an isolated entity. More frequently the user
with the configuration of input/output parameters for            will use more goals to specify its request: a goal model,
properly invoking a service. It is also responsible of           i.e. a set of correlated goals to be injected at the same
analyzing inconsistencies in the state of the world, due         time.
to unfeasible beliefs that could generate service failures.         Given a goal model (G, R) where groot ∈ G is the top
   The goal handler is responsible for the interpretation        goal of the hierarchy, the Goal Model Decomposition
of the GoalSPEC and for the recruitment of the service-          algorithm explores the hierarchy, starting from groot
brokers and state monitors to form a valid holon. The            in a top-down fashion. The objective is to trigger the
recruitment is based on a procedure called Means-End             formation of one or more holons able to address the
Reasoning (detailed in Section IV) in which service-             root goal. The algorithm is recursive and it exploits
brokers and state monitors are selected on the base              AND/OR decomposition relationships to deduct a goal
of capabilities they offer for addressing a desired state        addressability by observing its sub-goals.
of the world. During service execution, this role is                We used δj and ∆k = h.i to respectively denote a
also responsible to check the goal life-cycle (active,           single capability and a task. A task is generally provided
addressed, failed).                                              by a holon. We also introduce {.} to indicate a (complete
   In terms of governance, the goal handler and each             or partial) solution for addressing a generic goal gi where
service broker and state monitor are simple workers, but         the ‘dot’ is a placeholder for a list of tasks that can be
at the moment of the holon formation the head of the             alternatively used for the fulfillment of gi .
holon is elected according to a mechanism of trust and              An example of solution for a goal has the follow-
reputation (that is out the scope of this paper). The head       ing form: {hδ1 , δ2 , . . . , δn i, hδ1 , δ2 , . . . , δm i} or the more
has three supplementary responsibilities:                        compact: {∆1 , ∆2 } where ∆1 = hδ1 , δ2 , . . . , δn i and
   1) it is responsible to represent the whole holon to          ∆2 = hδ1 , δ2 , . . . , δm i. To address the goal the system
       the outside (other holons), thus if service-brokers       can alternatively execute ∆1 or ∆2 .
       and state monitors have been selected for a set              Figure 5 illustrates how the three roles interact. Once
       of capabilities δ1 , δ2 , . . . then the head offers to   a goal gi is injected, the goal-handler checks whether the
       the outside the composition of these capabilities         goal is a leaf goal or not. If it is not then the goal-handler
       (namely a task) denoted as ∆ = hδ1 , δ2 , . . .i);        proceeds with a top-down recursive decomposition. For




                                                             6
      Proc. of the 16th Workshop “From Object to Agents” (WOA15)                                                                                     June 17-19, Naples, Italy



                                (goal handler)

                   goal published
                [goal IS NOT leaf]        DECOMPOSE goal

                   loop              [FOR EACH sub-goal]

                                                                                         (goal handler)
                                                  PUBLISH sub-goal
                                                                             goal published
                                                                               [goal IS leaf]

                                                                                  loop              [UNTIL len(sol)>NS OR depth>TH]

                                                                                                     PICK sequence FROM space

                                                                                         opt        [IF sequence addresses the goal]

                                                                                                     PUT sequence INTO solution


                                                                                         opt           [IF sequence is incomplete]     (state-managers
                                                                                                                                       /service-brokers)
                                                                                                      ASK for capabilities
                                                                                                                                                   CALCULATE
                                                                                                               REPLY with capability               EVOLUTION

                                                                                                     EXPAND space with new
                                                                                                     capabilities
                                                                                                     SCORE new sequences
                                                        REPLY with solution

                          opt            [WHEN solutions_for_all_subgoals]
                                           BUILD solution
                                           TRIGGER holon formation
                                                                                                                                                   PLAY worker
                                                                                                                                                   role


               Figure 5. Sequence diagrams for goal model decomposition, goal/capability deliberation and holon formation.



each sub-goal, the goal-handler injects again it, marking                                       B. Goal/Capability Deliberation
the relationship to its parent. After that, the goal-handler                                       The Goal/Capability Deliberation algorithm fronts the
waits for solutions for all the sub-goals, and then it                                          problem of combining more available capabilities from
organizes the composed solution for gi by triggering the                                        state-monitors and service-brokers for addressing a goal:
corresponding holon formation.                                                                  given a initial state of the world, a set of capabilities and
                                                                                                a goal, the problem is to discover a set of capabilities
  • If the relationship is an AND decomposition the                                             which composition may address the goal.
    result is the permutation of all the solutions found                                           MUSA currently adopts an approach based on a search
    for each child node. If gA is AND-decomposed in                                             algorithm that simulates the formation of a holon and
    two sub-goals gB and gC , where {∆1 , ∆2 } is the                                           therefore the execution of various combinations of agent
    solution of gB and {∆3 } is the solution of gC , then                                       capabilities (see Figure 6). In this phase the service-
    the solution of gA is {h∆1 , ∆3 i, h∆2 , ∆3 i}.                                             broker adopts the calculate evolution protocol of the
  • If the relationship is an OR decomposition the result
                                                                                                capabilities it owns. This protocol allows the agent to
    is the union of all the solutions found for each child                                      customize the capability in order to establish if it can
    node. If gA is OR-decomposed in two sub-goals gB                                            be used for the specific injected goal. For instance the
    and gC , where {∆1 , ∆2 } is the solution of gB and                                         flight booking capability is customized by searching
    {∆3 } is the solution of gC , then the solution of gA                                       a flight from a departure place to a destination in a
    is {∆1 , ∆2 , ∆3 }.                                                                         given date/time (see Section II-B). When a complete
                                                                                                solution is discovered the algorithm may still continue
                                                                                                to search other solutions. It stops after the number of
   Otherwise, if the goal is a leaf node of the goal model,                                     solutions is greater than NS (a system constant) or when
then the Goal/Capability Deliberation sub-procedure is                                          time exceeds a threshold and returns all the discovered
called.                                                                                         solutions.




                                                                                                7
Proc. of the 16th Workshop “From Object to Agents” (WOA15)                                                                  June 17-19, Naples, Italy

   Exploring all possible solutions for addressing a user-                     decentralized software, made of a number of autonomous
goal is a NP-complete problem. The complexity is re-                           agents, each able to perceive the environment and to
duced by putting some constraints during the exploration                       act as a broker for some web-services (of which it
of the space of solutions. Colored zones of Figure 6                           knows description, end points and business logic); and
represent invalid solutions that can be discarded. In                          iii) holons are agents or (temporary) group of agents:
addition, considering pre/post conditions, only a limited                      each with its own individuality.
number of capabilities can be exploited at each step of                           Self-adaptiveness is the ability of the whole multi-
the algorithm, making the execution more scalable and                          agent system to dynamically adapt its behavior to the
affordable.                                                                    execution context. This is done by each individual agent,
   The space exploration algorithm compares partial so-                        through the dynamical execution of its own capabilities,
lutions thus to explore firstly the most promising ones,                       according to a shared plan and to contingent perceptions.
according to the number of sub-goals that are already
fulfilled and to a set of domain metrics indicating the
                                                                                                                  holon-fomation
global quality of service. The user can specify which                                                    proactive
                                                                                                                               social
                                                                                                        means-end
domain metrics to consider, for instance the maximum                                                    reasoning
                                                                                                                             commitment

budget or the kind of transportation to use.                                                                      failure

                                                                                      monitor                        capability execution environment
                                                                                    goal injection                   execution    cycle    monitoring
                     W1.1
                                                                                                     unexpected
                        Forbidden Space                                                                 state
                c3
                       c2           W1.2
               W1
          c1                   c5               W2.1.1                          Figure 7. Graphical representation of the Self-Adaptation Cycle.
                                                                 goal
     WI              c3 W2.1               c6
                                                             fulfillment
                                                    W2.1.2 
          c2   W2
                                           c7                                     Orchestration. When a holon is selected for address-
                        c4     W2.2                 W2.1.3
                                           c6                                  ing groot , it becomes operative in order to orchestrate all
                                c7         W2.2.1
                                                                               the embedded services and producing the compounded
                                                                               result (see social commitment in Figure 7).
                                 W2.2.2                                           This corresponds to activate its monitoring capabilities
                         Forbidden Space                                       and to execute the dispose service protocols of service
                                                                               capabilities. State-monitors will be active for the whole
Figure 6. Abstract representation of the strategy used to explore a            real service execution.
space of solutions for building a plan.
                                                                                  In the domain of the Travel Services, the service
                                                                               execution has the duration of the user’s travel. Service
   For a formal description of the Proactive Means-End                         broker will book all necessary flights, hotels, ticket
Reasoning details are provided in [29].                                        included in the travel plan. The monitor agent, running
   Going back to Figure 5, when one (or more) solutions                        in the user’s mobile device, acquires the user’s position,
exist for the root goal of the injected goal model, then                       and it may also be used for changing the travel plan at
one or more holons have been formed for addressing the                         run-time.
goal model. One is selected for starting the activities and                       Self-Adaptation. Thanks to the work of state-
eventually addressing the goals. The selection of a plan                       monitors, the head of the holon is continuously updated
may follow many criteria. For instance in the domain of                        about the state of the services and it is able to discover
the travel, the criterion we adopted is the total cost of                      when something is going wrong by comparing percep-
the travel.                                                                    tions with expected states of the world. When a service
                                                                               fails, or when a goal can not be addressed then the head
C. The Self-Adaptation Loop                                                    role of the corresponding sub-holon raises an event of
   So far the following assumptions holds: i) services are                     failure, that is cause of an adaptation.
delivered over the internet by service providers; as usual,                       In the running example the adaptation is triggered
these are accessible through standards protocols (i.e.                         by the user who modified her goals (by informing the
WSDL and SOAP); ii) the system is a distributed and                            system to change the travel plan).




                                                                           8
      Proc. of the 16th Workshop “From Object to Agents” (WOA15)                                               June 17-19, Naples, Italy

   The adaptation is treated by the system as a reorga-                                      R EFERENCES
nization of the holonic architecture. The reorganization
                                                                     [1] M. Pistore, P. Traverso, M. Paolucci, and M. Wagner, “From
produces a temporary dis-assembly of the holon and                       software services to a future internet of services.” in Future
the re-execution of the Proactive Means-End Reasoning                    Internet Assembly, 2009, pp. 183–192.
procedures but considering the new situation (failures,              [2] S. Staab, W. Van der Aalst, V. R. Benjamins, A. Sheth, J. A.
service availability or new user goals) for generating a                 Miller, C. Bussler, A. Maedche, D. Fensel, and D. Gannon,
                                                                         “Web services: been there, done that?” Intelligent Systems,
new solution.                                                            IEEE, vol. 18, no. 1, pp. 72–85, 2003.
   Before starting the new solution, each holon executes             [3] J. L. Zhao, M. Tanniru, and L.-J. Zhang, “Services computing
the compensate protocols of the capabilities that are no                 as the foundation of enterprise agility: Overview of recent
                                                                         advances and introduction to the special issue,” Information
more in the new plan. After that the complete service                    Systems Frontiers, vol. 9, no. 1, pp. 1–8, 2007.
orchestration activity starts again.                                 [4] L. Sabatucci, C. Lodato, S. Lopes, and M. Cossentino, “Towards
                                                                         self-adaptation and evolution in business process.” in AIBP@
                                                                         AI* IA. Citeseer, 2013, pp. 1–10.
                      V. C ONCLUSIONS                                [5] R. Bordini, J. Hübner, and M. Wooldridge, Programming multi-
                                                                         agent systems in AgentSpeak using Jason. Wiley-Interscience,
   Holonic multi-agent systems provide a flexible and                    2007, vol. 8.
reconfigurable architecture to accommodate environment               [6] A. Ricci, M. Piunti, M. Viroli, and A. Omicini, “Environ-
changes and user customization. MUSA is a middleware                     ment programming in cartago,” in Multi-Agent Programming:.
                                                                         Springer, 2009, pp. 259–288.
where the autonomous and proactive collaboration of                  [7] A. S. Rao, “Agentspeak (l): Bdi agents speak out in a logical
autonomous agents allows a dynamic (re-)organization                     computable language,” in Agents Breaking Away. Springer,
of the behavior in order to address user-requests and/or                 1996, pp. 42–55.
unexpected events. The novelty is that the desired service           [8] M. E. Bratman, D. J. Israel, and M. E. Pollack, “Plans and
                                                                         resource-bounded practical reasoning,” Computational intelli-
composition is encapsulated in run-time goal-models                      gence, vol. 4, no. 3, pp. 349–355, 1988.
that, when injected into the system, trigger a spontaneous           [9] A. S. Rao, M. P. Georgeff et al., “Bdi agents: From theory to
emergence of new holarchies devoted to orchestrate the                   practice.” in ICMAS, vol. 95, 1995, pp. 312–319.
                                                                    [10] G. S. Blair, G. Coulson, L. Blair, H. Duran-Limon, P. Grace,
required services.
                                                                         R. Moreira, and N. Parlavantzas, “Reflection, self-awareness
   MUSA have been employed for i) executing dynamic                      and self-healing in openorb,” in Proceedings of the first work-
workflows in small/medium enterprises (IDS Project2 ),                   shop on Self-healing systems. ACM, 2002, pp. 9–14.
ii) automatic mash-up of cloud applications (OCCP                   [11] B. Schmerl and D. Garlan, “Exploiting architectural design
                                                                         knowledge to support self-repairing systems,” in Proceedings
Project3 , iii) merging protocols for emergency (SIGMA                   of the 14th international conference on Software engineering
Project4 ).                                                              and knowledge engineering. ACM, 2002, pp. 241–248.
   Authors are already working on 1) a more efficient               [12] L. Sabatucci, M. Cossentino, C. Lodato, S. Lopes, and V. Sei-
                                                                         dita, “A possible approach for implementing self-awareness in
algorithm for the means-end reasoning, 2) extending the                  jason.” in EUMAS. Citeseer, 2013, pp. 68–81.
goal language for including uncertainty and norms, 3) an            [13] L. Sabatucci, P. Ribino, C. Lodato, S. Lopes, and
automatic learning approach more robust to ontological                   M. Cossentino, “Goalspec: A goal specification language
discrepancies or language incoherence.                                   supporting adaptivity and evolution,” in Engineering Multi-
                                                                         Agent Systems. Springer, 2013, pp. 235–254.
                                                                    [14] J. Whittle, P. Sawyer, N. Bencomo, B. H. Cheng, and J.-M.
                  VI. ACKNOWLEDGMENT                                     Bruel, “Relax: Incorporating uncertainty into the specification
                                                                         of self-adaptive systems,” in Requirements Engineering Confer-
   The research was funded by the Autonomous Region                      ence, 2009. RE’09. 17th IEEE International. IEEE, 2009, pp.
                                                                         79–88.
of Sicily, Project OCCP (Open Cloud Computing Plat-                 [15] R. C. Moore, “Reasoning about knowledge and action,” Ph.D.
form), within the Regional Operative Plans (PO-FESR)                     dissertation, Massachusetts Institute of Technology, 1979.
of the EU Community.                                                [16] Y. Lesperance, “A formal account of self-knowledge and ac-
                                                                         tion.” in IJCAI. Citeseer, 1989, pp. 868–874.
                                                                    [17] M. J. Wooldridge, Reasoning about rational agents. MIT press,
  2
    Innovative Document Sharing: research project funded by the          2000.
Autonomous Region of Sicily within the Regional Operative Plans     [18] L. Padgham and P. Lambrix, “Formalisations of capabilities
(PO-FESR) of the EU Community; 2011-2014.                                for bdi-agents,” Autonomous Agents and Multi-Agent Systems,
  3
    Open Cloud Computing Platform: research project funded by the        vol. 10, no. 3, pp. 249–271, 2005.
Autonomous Region of Sicily within the PO-FESR initiative; 2014-    [19] K. Sycara, S. Widoff, M. Klusch, and J. Lu, “Larks: Dynamic
2015 - website: http://aose.pa.icar.cnr.it/OCCP.                         matchmaking among heterogeneous software agents in cy-
  4
    Research project for Integrated cloud system of sensors for          berspace,” Autonomous agents and multi-agent systems, vol. 5,
advanced multi-risk management; 2013-2015.                               no. 2, pp. 173–203, 2002.




                                                                    9
Proc. of the 16th Workshop “From Object to Agents” (WOA15)              June 17-19, Naples, Italy

[20] M. Cossentino, N. Gaud, V. Hilaire, S. Galland, and A. Koukam,
     “Aspecs: an agent-oriented software process for engineering
     complex systems,” Autonomous Agents and Multi-Agent Sys-
     tems, vol. 20, no. 2, pp. 260–304, 2010.
[21] M. Saeki, “Semantic requirements engineering,” in Intentional
     Perspectives on Information Systems Engineering. Springer,
     2010, pp. 67–82.
[22] P. Ribino, M. Cossentino, C. Lodato, S. Lopes, L. Sabatucci,
     and V. Seidita, “Ontology and goal model in designing bdi
     multi-agent systems.” WOA@ AI* IA, vol. 1099, pp. 66–72,
     2013.
[23] N. Guarino, M. Carrara, and P. Giaretta, “Formalizing ontolog-
     ical commitment,” in AAAI, vol. 94, 1994, pp. 560–567.
[24] M. Cossentino, D. Dalle Nogare, R. Giancarlo, C. Lodato,
     S. Lopes, P. Ribino, L. Sabatucci, and V. Seidita, “Gimt: A tool
     for ontology and goal modeling in bdi multi-agent design,” in
     Workshop” Dagli Oggetti agli Agenti”, 2014.
[25] A. Koestler, “The ghost in the machine. 1967,” London:
     Hutchinson, 1967.
[26] J. J. Kay and M. Boyle, Self-organizing, holarchic, open systems
     (SOHOs). Columbia University Press: New York, NY, USA,
     2008.
[27] J. Ferber, Multi-agent systems: an introduction to distributed
     artificial intelligence. Addison-Wesley Reading, 1999, vol. 1.
[28] C. Hahn and K. Fischer, “Service composition in holonic
     multiagent systems: Model-driven choreography and orchestra-
     tion,” in Holonic and Multi-Agent Systems for Manufacturing.
     Springer, 2007, pp. 47–58.
[29] L. Sabatucci and M. Cossentino, “From Means-End Analysis
     to Proactive Means-End Reasoning,” in Proceedings of 10th
     International Symposium on Software Engineering for Adaptive
     and Self-Managing Systems, May 18-19 2015, Florence, Italy.




                                                                   10