Last change
on this file since 257 was 257, checked in by Faria Nassiri Mofakham, 5 years ago |
1) BilateralNegotiation which extends Thread added to onetomany. According to BCG protocol this creates two threads, one for a buyer and one for a seller (it now generates null agents). 2) An ActionListener added to close button in onetomany.etc.GUI.
|
File size:
981 bytes
|
Line | |
---|
1 | /**
|
---|
2 | *
|
---|
3 | */
|
---|
4 | package onetomany;
|
---|
5 |
|
---|
6 | import onetomany.bargainingchipsgame.Bundle;
|
---|
7 | import onetomany.bargainingchipsgame.Chip;
|
---|
8 | import onetomany.bargainingchipsgame.Stack;
|
---|
9 | import onetomany.bargainingchipsgame.players.Agent;
|
---|
10 | import onetomany.bargainingchipsgame.players.utilityfunction.UF_75pQtyOrNothing;
|
---|
11 | import onetomany.bargainingchipsgame.players.utilityfunction.Utility_Function;
|
---|
12 |
|
---|
13 | /**
|
---|
14 | * @author Faria Nassiri-Mofakham
|
---|
15 | *
|
---|
16 | */
|
---|
17 | public class Buyer extends Thread
|
---|
18 | {
|
---|
19 |
|
---|
20 | public Buyer(String name, Bundle wishlist, Utility_Function u, long deadline, String picture)
|
---|
21 | {
|
---|
22 | super(name);
|
---|
23 | super.run();
|
---|
24 | }
|
---|
25 |
|
---|
26 | public void run() {
|
---|
27 | // TODO Auto-generated method stub
|
---|
28 |
|
---|
29 | Bundle a=new Bundle();
|
---|
30 | a.addStack(new Stack(new Chip("Blue", 4), 30));
|
---|
31 | a.addStack(new Stack(new Chip("Orange", 6), 20));
|
---|
32 |
|
---|
33 | Runnable r = (Runnable) new Negotiator(new Agent("Bob",a, new UF_75pQtyOrNothing(a), 10, null));
|
---|
34 | new Thread(r).start();
|
---|
35 | System.out.println(r);
|
---|
36 | }
|
---|
37 |
|
---|
38 |
|
---|
39 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.