SlideShare a Scribd company logo
JADE PROJECT
Caso di studio: ASTA ALL’INGLESE (1)
AGENTE BANDITORE
(Auctioneer):
vuole vendere un bene;
AGENTI OFFERENTI (Bidder):
vogliono acquistare il bene
messo all’asta dal banditore.
Gli offerenti sono interessati ad
acquistare il bene al minor
prezzo possibile.
Caso di studio: ASTA ALL’INGLESE (2)
1. Il banditore mette all’asta un bene ad un prezzo base (es. 100$);
2. I partecipanti possono:
o fare la propria offerta, superiore al prezzo base di partenza (primo rilancio);
o rilanciare con una nuova offerta nel caso in cui un altro abbia fatto un offerta
più alta (rilancio successivo);
3. L’asta termina quando nessun partecipante rilancia con una nuova offerta;
4. Il bene viene venduto a chi ha fatto l’offerta più alta;
Nota: nel caso in cui nessun partecipante faccia un’offerta, il bene rimane al venditore;
Caso di studio: ASTA ALL’INGLESE (3)
Strategia degli agenti partecipanti (Bidder):
- rilanciano le offerte di una piccola somma, in quanto sono interessati ad acquistare
il bene al minor prezzo possibile;
- rilanciano (propose) le offerta fino a quando il prezzo del bene non raggiunge o
supera il budget dell’offerente stesso (refuse)
LANGUAGE
Messages exchange
JADE – AGENT
AuctioneerAgent BidderAgent
AuctioneerAgent (1)
■ Input: auctioneer:AuctioneerAgent(jewel,100)
– asset = auction’s subject (etc. jewel)
– initialPrice = initial price (etc.. 100$)
■ addBehaviour → WakerBehaviour(this, 20000)
→ after 20 seconds → start Auction
→ add Behaviour → RequestPerformed (switch-case)
AuctioneerAgent (2) - RequestPerformed
■ Variables
– AID maxOfferBidder = null; → to store the "winner" bidder
– private int maxOffer; → to store the best offer
– private int step = 0; → «switch-case" step
– private int repliesCnt = 0; → count the answers (Propose/Refuse)
– private int proposeNumber = 0; → count Propose
– private MessageTemplate mt; → template for the message queue
AuctioneerAgent (3) – case 0/case 1
case 0: send CFP
■ send(CFP) with «initialPrice» to interested Bidders
case 1: wait propose + update values
■ wait responses from Bidders
■ IF PROPOSE > maxOffer → UPDATE (maxOffer, maxOfferBidder)
➢ repliesCnt >= bidderAgents.length && bidderAgents.length > 1 → step = 2
➢ bidderAgents.length == 1 && proposeNumber (>)= 1 → step = 3 → ONE PROPOSE
➢ bidderAgents.length == 0 → REFUSE FROM ALL BIDDERS
AuctioneerAgent (4) – case 2/case3/case4
■ case 2: send msg(INFORM) with maxOffer to interested Bibber (for increment)
(step = 1)
■ case 3: send msg(ACCEPT_PROPOSAL) to maxOfferBidder
■ case 4: wait msg(INFORM/REFUSE) → print “sale or not”
BidderAgent (1)
■ Variables
– public int budget; → random: min: 100 – max: 200 (simplification)
– public int actualValue → current offer value
– public boolean interested = false; → input
■ Behaviour
– OfferOrRefuse → wait CFP and first offer
– OfferRaise → increment offer value
– PaymentInform
bidder1:BidderAgent(true);
bidder2:BidderAgent(true),
…
bidderN:BidderAgent(BOOLEAN)
BidderAgent (2) – OfferOrRefuse
■ wait(CFP) from AuctioneerAgent
■ Intereseted? (input)
– yes → propose offer (initialPrice + incrementRandom (1-10))
– no → refuse
BidderAgent (3) – OfferRaise
■ wait(INFORM) maxOffer from AuctioneerAgent
■ offer < budget?
– yes → propose new offer
– no → refuse
BidderAgent (4) – PaymentInform
■ wait(ACCEPT_PROPOSAL) maxOffer from AuctioneerAgent
■ send msg(INFORM) → payment ok → case 4 (AuctioeerAgent)
EXAMPLE
2020/06/01:11:16 43/44
AUTIONEER(JEWEL,100)
BIDDER1(TRUE)
BIDDER2(TRUE)
Bidder1
Budget = 192
Bidder2
Budget = 150
101 107
113 115
120 120
125 126
135 135
144 143
145 151 > 150
2020/06/01:11:16 56
AUCTIONEER(JEWEL,100)
BIDDER1(TRUE)
BIDDER2(FALSE)
2020/06/01:11:17 00
AUCTIONEER(JEWEL,100)
BIDDER1(FALSE)
BIDDER2(FALSE)
END

More Related Content

Featured

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
 

Featured (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

Jade - Programming of intelligent agents

  • 2. Caso di studio: ASTA ALL’INGLESE (1) AGENTE BANDITORE (Auctioneer): vuole vendere un bene; AGENTI OFFERENTI (Bidder): vogliono acquistare il bene messo all’asta dal banditore. Gli offerenti sono interessati ad acquistare il bene al minor prezzo possibile.
  • 3. Caso di studio: ASTA ALL’INGLESE (2) 1. Il banditore mette all’asta un bene ad un prezzo base (es. 100$); 2. I partecipanti possono: o fare la propria offerta, superiore al prezzo base di partenza (primo rilancio); o rilanciare con una nuova offerta nel caso in cui un altro abbia fatto un offerta più alta (rilancio successivo); 3. L’asta termina quando nessun partecipante rilancia con una nuova offerta; 4. Il bene viene venduto a chi ha fatto l’offerta più alta; Nota: nel caso in cui nessun partecipante faccia un’offerta, il bene rimane al venditore;
  • 4. Caso di studio: ASTA ALL’INGLESE (3) Strategia degli agenti partecipanti (Bidder): - rilanciano le offerte di una piccola somma, in quanto sono interessati ad acquistare il bene al minor prezzo possibile; - rilanciano (propose) le offerta fino a quando il prezzo del bene non raggiunge o supera il budget dell’offerente stesso (refuse)
  • 8. AuctioneerAgent (1) ■ Input: auctioneer:AuctioneerAgent(jewel,100) – asset = auction’s subject (etc. jewel) – initialPrice = initial price (etc.. 100$) ■ addBehaviour → WakerBehaviour(this, 20000) → after 20 seconds → start Auction → add Behaviour → RequestPerformed (switch-case)
  • 9. AuctioneerAgent (2) - RequestPerformed ■ Variables – AID maxOfferBidder = null; → to store the "winner" bidder – private int maxOffer; → to store the best offer – private int step = 0; → «switch-case" step – private int repliesCnt = 0; → count the answers (Propose/Refuse) – private int proposeNumber = 0; → count Propose – private MessageTemplate mt; → template for the message queue
  • 10. AuctioneerAgent (3) – case 0/case 1 case 0: send CFP ■ send(CFP) with «initialPrice» to interested Bidders case 1: wait propose + update values ■ wait responses from Bidders ■ IF PROPOSE > maxOffer → UPDATE (maxOffer, maxOfferBidder) ➢ repliesCnt >= bidderAgents.length && bidderAgents.length > 1 → step = 2 ➢ bidderAgents.length == 1 && proposeNumber (>)= 1 → step = 3 → ONE PROPOSE ➢ bidderAgents.length == 0 → REFUSE FROM ALL BIDDERS
  • 11. AuctioneerAgent (4) – case 2/case3/case4 ■ case 2: send msg(INFORM) with maxOffer to interested Bibber (for increment) (step = 1) ■ case 3: send msg(ACCEPT_PROPOSAL) to maxOfferBidder ■ case 4: wait msg(INFORM/REFUSE) → print “sale or not”
  • 12. BidderAgent (1) ■ Variables – public int budget; → random: min: 100 – max: 200 (simplification) – public int actualValue → current offer value – public boolean interested = false; → input ■ Behaviour – OfferOrRefuse → wait CFP and first offer – OfferRaise → increment offer value – PaymentInform bidder1:BidderAgent(true); bidder2:BidderAgent(true), … bidderN:BidderAgent(BOOLEAN)
  • 13. BidderAgent (2) – OfferOrRefuse ■ wait(CFP) from AuctioneerAgent ■ Intereseted? (input) – yes → propose offer (initialPrice + incrementRandom (1-10)) – no → refuse
  • 14. BidderAgent (3) – OfferRaise ■ wait(INFORM) maxOffer from AuctioneerAgent ■ offer < budget? – yes → propose new offer – no → refuse
  • 15. BidderAgent (4) – PaymentInform ■ wait(ACCEPT_PROPOSAL) maxOffer from AuctioneerAgent ■ send msg(INFORM) → payment ok → case 4 (AuctioeerAgent)
  • 17. 2020/06/01:11:16 43/44 AUTIONEER(JEWEL,100) BIDDER1(TRUE) BIDDER2(TRUE) Bidder1 Budget = 192 Bidder2 Budget = 150 101 107 113 115 120 120 125 126 135 135 144 143 145 151 > 150
  • 20. END