=Paper= {{Paper |id=None |storemode=property |title=Using Jason to Develop Declarative Prototypes of Automated Negotiations |pdfUrl=https://ceur-ws.org/Vol-920/p136-muscar.pdf |volume=Vol-920 |dblpUrl=https://dblp.org/rec/conf/bci/MuscarSB12 }} ==Using Jason to Develop Declarative Prototypes of Automated Negotiations== https://ceur-ws.org/Vol-920/p136-muscar.pdf
            Using Jason to Develop Declarative Prototypes of
                       Automated Negotiations

                       Alex Muscar                                     Laura Surcel                                Costin Bădică
                 University of Craiova                           University of Craiova                          University of Craiova
                Software Engineering                            Software Engineering                           Software Engineering
                     Department                                      Department                                     Department
              Bvd. Decebal 107, Craiova,                      Bvd. Decebal 107, Craiova,                     Bvd. Decebal 107, Craiova,
                  200440, Romania                                 200440, Romania                                200440, Romania
                silie@software.ucv.ro                       laura_surcel@yahoo.com                         cbadica@software.ucv.ro

ABSTRACT                                                                                we introduced a prototype MAS for English auctions based on Ja-
We propose a declarative approach for prototyping automated nego-                       son agent programming language [1]. Here we take a closer look at
tiations in multi-agent systems. Our approach is demonstrated by                        the implementation of this prototype and extend it to support Dutch
using Jason agent programming language to describe English and                          auctions.
Dutch auctions.

Categories and Subject Descriptors                                                      2. BACKGROUND
                                                                                           The system architecture is based on our work [4], which distin-
I.2.11 [Artificial Intelligence]: Distributed Artificial Intelligence
                                                                                        guished between several types of agents:1 (i) Auction Service (AS)
                                                                                        manages auction-related activities (e.g. creation, termination), co-
Keywords                                                                                ordinates the auction participants, and acts as a yellow page service
Artificial intelligence, computer programming                                           for ongoing auctions; (ii) Auction Host (AH) is an arbitrator agent
                                                                                        responsible with coordinating the agents participating in a single
1.    INTRODUCTION                                                                      auction instance (AI); and (iii) Auction Participant (AP) which par-
                                                                                        ticipates by bidding in an AI – out of all the participants one is
   Automated negotiations are common in multi-agent systems (MAS)                       distinguished as the Auction Initiator Participant (AIP).
– e.g. bargaining, auctions [8], multi-criteria negotiation [6], multi-                    Conceptually, the declarative specification of a negotiation is
commodity negotiations. Some of the practical applications of au-                       composed of three essential ingredients: (i) Generic Negotiation
tomated negotiations are: price negotiation for e-commerce ([2]),                       Protocol (GNP) which defines and governs the interaction between
cooperative design, and task allocation.                                                the agents that are part of the system and it is the same for all
   Although there are many methods of automated negotiations,                           of them, independently of their role in the negotiation (i.e. buyer,
they generally fail to properly address the reusability and the ex-                     seller); (ii) Declarative Negotiation Mechanism (DNM) is specific
tensibility of the proposed approaches. In most applications the                        to a given negotiation type and it serves to customize the GNP for
negotiation mechanism is very specific and hard coded, making the                       representing the specific conditions and events that enable the per-
reusability of research results difficult.                                              missible actions of specific AP agents; and (iii) Custom Negotiation
   In order to treat these issues we have set up a research project                     Strategy (CNS) is specific to a given AP and must be consistent with
aiming to develop a generic, reusable negotiation framework. One                        the DNM. It is used by the AP to select and configure a specific ne-
of the key insights of our approach is that an (automated) negotia-                     gotiation action that could be most useful in a given negotiation
tion has two main components: the protocol which governs agents’                        context.
interaction during negotiation and the strategy of participating agents.                   Based on the three features described above we can define the
While the analysis and design of specific negotiations mechanisms                       following metaphorical equations that more succinctly describe the
and the development of appropriate strategies with desired proper-                      agents present in our framework:
ties (e.g. stability, equilibrium, efficiency, a.o) has received a lot of
attention in the context of particular situations, they have not been
properly addressed with regard to reusability and extensibility.                                         AH = GNPhost + DN Mhost
   This paper is a follow-up of our initial proposal [5]. Our results                              AP = GNP participant + DN M participant + CNS
consisted in the identification of a minimal yet viable Generic Nego-
tiation Protocol (GNP) as well as of a declarative approach of repre-                      These ingredients can be consistently bound into descriptions of
senting rules and constraints specific to negotiation types. Our aim                    AH and respectively AP behaviors by making them to refer a com-
was to combine them for deriving the basis of a generic, reusable                       mon core vocabulary of terms that can be used for defining and
negotiation framework that would allow agents to specify and un-                        parameterizing the space of negotiation types [7]. This vocabulary
derstand customizable negotiation protocols and strategies. In [5]                      is called Core Negotiation Ontology (CNO). The development of a
                                                                                        more complete CNO is is part of our future research.
BCI’12, September 16–20, 2012, Novi Sad, Serbia.
Copyright c 2012 by the paper’s authors. Copying permitted only for private and
academic purposes. This volume is published and copyrighted by its editors.
                                                                                        1
Local Proceedings also appeared in ISBN 978-86-7031-200-5, Faculty of Sciences,           Note that the initial framework targeted auctions, so we have used
University of Novi Sad.                                                                 the term ‘auction’ interchangeably with ‘negotiation’.


                                                                                  136
                                                                           +bid(Offer,Items)[source(A)]
+register[source(A)]                                                           : check_protocol(A)
    : can_register(A)                                                          & check_proposal(Offer,Items)
    <- +registered(A);                                                         & not(terminate(Offer,Items))
       ?buy_it_out(Sum);                                                       <- -+state(processing);
       ?increment(Increment);                                                     !update_status(A,Offer,Items);
       ?items(Left_items);                                                        !inform_participants(A,Offer);
       ?last_offer(Offer);                                                        -+state(bidding).
       ?state(State);
       .send(A, tell,                                                      +!close
             registered(info(Sum,Increment),                                  : check_winner
       status(Offer, Left_items, State))).                                    <- ?initiator(I);
                                                                                 -+state(closed);
+fold[source(A)]                                                                 ?bidders(A);
    : registered(A)                                                              .send(I, tell, winner(A));
    <- -registered(A);                                                           .send(A, tell, winner).
        .send(A, tell, not_registered).


                                            Figure 1: The AH agent which implements the GNP.


3.    THE GENERIC NEGOTIATION PROTO-                                            DNM, which we will discuss next. While an AS conceptually im-
      COL                                                                       plements a type of auction, an AH is spawned for each new auction
                                                                                started by the AS. When initially started the AH loads the DNM
   The GNP describes the permissible conversations involving a set              specific to the auction implemented by the AS and a further mes-
of negotiation agents comprising the following generic roles: (i)               sage from the AIP is responsible for initializing the parameters of
role of AH; there is a single agent playing this role in a negotiation;
                                                                                the DNM with appropriate values.
and (ii) role of AP; there are one or more agents playing this role
                                                                                   We chose a rule-based representation for our DNM, which builds
in a negotiation. Thus the GNP is agnostic of any details that are              on our previous approach presented in [3]. Moreover, this represen-
specific to a particular negotiation type. Consequently, it must only           tation was mapped naturally to Jason.
expose the basic negotiation actions that are common to as many ne-                Listing 2 shows the rules used to customize the AH for our run-
gotiation types, leaving unspecified the specific details of a certain          ning example, an English auction. Note that these rules illustrate
negotiation type. Those details can be captured and declaratively
                                                                                the DNM from the AH perspective.
represented with the help of the DNM.
                                                                                   Besides their formal parameters, the rules are also implicitly pa-
   We have identified the following set of actions as sufficient for            rameterized by the current state of the negotiation process – here
the purpose of introducing our proof-of-concept implementation:                 we are using the annotations mechanism from Jason to achieve this,
(1) register used by an AP to register itself with a specific AH;               e.g. the [state(bidding)] annotation on the check_proposal
(2) bid used to place a bid; (3) tell/ask depending on the push/pull            rule makes it applicable only when the agent is in the bidding
semantics, the protocol can expose information to the participants
                                                                                state.
either automatically or on request; (4) fold used by an AP to get
out of an auction; (5) close used by the AH to notify the APs about
the auction termination; and (6) winner used by the AH to notify                5. CONCLUSION AND FUTURE WORK
the winner participants.                                                           We have presented our approach on developing a generic nego-
                                                                                tiation mechanism (as part of a generic negotiation framework) us-
                                                                                ing the Jason programming language. We believe the solution is
4.    IMPLEMENTATION DETAILS                                                    elegant and promising, due to its declarative nature and modular
    Jason is probably the best known example of agent programming               nature. Basically the GNP is independent of the negotiation type,
language that follows the Belief-Desire-Intention (BDI) model. It               negotiation rules are used to customize it.
supports a declarative programming style, closer to logic program-                 One of the necessary next steps is to find a suitable serialization
ming. We chose Jason as we believe that the mix of declarative,                 format for the rules used to customize the GNP, such as RuleML.2
goal-oriented and knowledge representation features of Jason make               Another direction, as mentioned earlier, is to define a suitable CNO
it a good candidate implementation language for our prototype. Fur-             for the negotiation framework. Yet a third research direction is to
thermore its meta-programming features (e.g. representing pro-                  factor out the GNP so that it can be used in multiple platforms–e.g.
grams as code) has helped with our implementation.                              Jason, Java+JADE.
    Our implementation provides an internal action that loads the
rules for a specific negotiation type. This has to be called by agents
before they start the negotiation in order to customize their GNP.              6. ACKNOWLEDGMENTS
Once loaded, the rules can be used like any other rule defined in                  The work of Alex Muscar was supported by the strategic grant
the Jason agent source file.                                                    POSDRU / CPP107 / DMI1.5 / S / 78421, Project ID 78421 (2010),
    The Jason implementation of the AH role of the GNP, presented               co-financed by the European Social Fund Investing in People, within
in listing 1, closely follows the definition of the GNP outlined                the Sectoral Operational Programme Human Resources Develop-
above. Very briefly, the plan for +register registers a participant             ment 2007 - 2013. The work of Costin Bădică was supported by the
and sends it the current quote (i.e. the value of the outstanding bid)          multilateral agreement on academic cooperation in 2012 between
– this presumes push semantics; the +bid plan updates the quote                 Serbia (Novi Sad), Romania (Craiova), and Poland (Warsaw and
and pushes messages with the new value to all the participants; the             Gdansk) on “Agent Technologies, Tools, Environments, Applica-
+close plan ends the auction and notifies any winner if there is one.           tions”.
All the plans keep track of the current state the agent is in.
                                                                                2
    Note that the plans make use of rules that are defined by the                   RuleML – http://ruleml.org/


                                                                          137
// Dutch auction                                                           // English auction
check_proposal(Offer,Items)                                                check_proposal(Offer,Items)
    [state(bidding)] :-                                                    [state(bidding)] :-
    asked_price(AskedPrice) &                                                  increment(Increment) &
    items(Left_items) &                                                        last_offer(Quote) &
    Left_items>=Items &                                                        items(Left_items) &
    Offer <= AskedPrice.                                                       Left_items>=Items &
                                                                               Offer >= Quote + Increment.
+!update_status(A,Offer,Items)
    <- .time(H,M,Sec2);                                                    +!update_status(A,Offer,Items)
       ?items(I);                                                              <- -+last_offer(Offer);
       ?increment(Increment);                                                     -+bidders([A]).
       ?asked_price(AskedPrice);
       ?bidders(B);
        -+last_offer(Offer);
        -+items(I-Items);
        -+bidders([A|B]);
        -+asked_price(AskedPrice+Increment);
        -+last_update(Sec2).


                                           Figure 2: DNM for English and Dutch auctions.


7.   REFERENCES
[1] R. H. Bordini, J. F. Hübner, and M. Wooldridge.
    Programming Multi-Agent Systems in AgentSpeak using Jason.
    Wiley Series in Agent Technology. Wiley, 2007.
[2] C. Bădică, M. Ganzha, and M. Paprzycki. Implementing
    rule-based automated price negotiation in an agent system.
    Journal of Universal Computer Science, 13(2):244–266, feb
    2007.
[3] C. Bădică, A. Giurca, and G. Wagner. Using rules and r2ml
    for modeling negotiation mechanisms in e-commerce agent
    systems. In Trends in Enterprise Application Architecture, 2nd
    International Conference, TEAA 2006, volume 4473 of
    Lecture Notes in Computer Science, pages 84–99, Berlin,
    Heidelberg, 2007. Springer.
[4] A. Dobriceanu, L. Biscu, A. Bădică, and C. Bădică. The
    design and implementation of an agent-based auction service.
    IJAOSE, 3(2/3):116–134, 2009.
[5] A. Muscar and C. Bădică. Exploring the design space of a
    declarative framework for automated negotiation: initial
    considerations (in press). In Proc.Artificial Intelligence
    Applications and Innovations 2012 – AIAI 2012. Springer,
    2012.
[6] M. Scafeş and C. Bădică. Computing equilibria for
    constraint-based negotiation games with interdependent issues.
    In Proceedings of Federated Conference on Computer Science
    and Information Systems – FedCSIS 2011, pages 597–603,
    2011.
[7] V. Tamma, S. Phelps, I. Dickinson, and M. Wooldridge.
    Ontologies for supporting negotiation in e-commerce.
    Engineering Applications of Artificial Intelligence,
    18(2):223–236, 2005.
[8] P. R. Wurman, M. P. Wellman, and W. E. Walsh. A
    parametrization of the auction design space. Games and
    Economic Behavior, 35(2):304–338, 2001.




                                                                     138