source: src/main/java/bargainingchips/players/BoulwareAgent.java@ 340

Last change on this file since 340 was 340, checked in by Tim Baarslag, 4 years ago

Change BilateralProtocol loop to avoid busy wait; note that this fixes only a part of the busy wait problem.

Package structure now in line with latest Acumex discussions.

Pinpointed error avoidance in Agent.

File size: 1.3 KB
Line 
1package bargainingchips.players;
2
3import java.util.concurrent.BlockingQueue;
4import java.util.concurrent.LinkedBlockingQueue;
5
6import bargainingchips.NegotiationContext;
7import bargainingchips.actions.Offer;
8import bargainingchips.actions.OfferBy;
9import bargainingchips.messaging.coordination.CoordinationMessage;
10import bargainingchips.messaging.status.StatusMessage;
11import bargainingchips.utilityfunctions.UtilityFunction;
12
13public class BoulwareAgent extends TimeDependentNegotiationAgent
14{
15 public BoulwareAgent(String name, UtilityFunction u, NegotiationContext nc,
16 BlockingQueue<Offer> in, BlockingQueue<OfferBy> out,
17 BlockingQueue<CoordinationMessage> cin,
18 BlockingQueue<StatusMessage> cout)
19 {
20 super(name, u, nc, in, out, cin, cout);
21 }
22
23 /**
24 * For sellers dummy coordinator queues are created but are never linked up
25 */
26 public BoulwareAgent(String name, UtilityFunction u, NegotiationContext nc,
27 BlockingQueue<Offer> in, BlockingQueue<OfferBy> out)
28 {
29 super(name, u, nc, in, out,
30 new LinkedBlockingQueue<CoordinationMessage>(),
31 new LinkedBlockingQueue<StatusMessage>());
32 }
33
34 @Override
35 public double getE() {
36 return 0.2;
37 }
38
39 @Override
40 public String toDescription()
41 {
42 return name + " with u = " + u + " using " + getClass().getSimpleName() + " e = " + getE() + " strategy ";
43 }
44}
Note: See TracBrowser for help on using the repository browser.