source: src/main/java/negotiator/onetomany/Main.java@ 226

Last change on this file since 226 was 226, checked in by Faria Nassiri Mofakham, 6 years ago

GUI updated (using Jpanel). DemandPlanDrawing updated. PutImaged renamed to DrawImage. DemandPlan is updating for the Utility, Bid, and Preference classes. Protocol and Agents packages (and some classes) added.

File size: 1.3 KB
Line 
1package negotiator.onetomany;
2
3import java.awt.Color;
4import java.awt.List;
5import java.util.Iterator;
6
7public class Main
8{
9 private Portfolio portfolio;
10 private DemandPlan demandPlan;
11
12 private int numType = 7; // this could later be gained from Domain
13
14 public Main()
15 {
16 Product redProduct = new Product("Red");
17 Product pinkProduct = new Product("Pink");
18 Product blueProduct = new Product("Blue");
19 Product orangeProduct = new Product("Orange");
20
21
22 portfolio = new Portfolio();
23
24 portfolio.addProduct(redProduct);
25 portfolio.addProduct(pinkProduct);
26 portfolio.addProduct(blueProduct);
27 portfolio.addProduct(orangeProduct);
28
29
30 demandPlan = new DemandPlan();
31 for (Product product : portfolio.getPortfolio())
32 demandPlan.setQuantity(product, (int)(Math.random()*numType+1));
33// demandPlan.setQuantity(redProduct, 2);
34
35// System.out.println(demandPlan);
36
37
38
39// Agent sam = new Sam();
40// Agent sally = new Sally();
41//
42// Agent bob = new Bob();
43//
44// OneToManyProtocol p = new OneToManyProtocol(bob, sam, sally);
45//===> BilateralThread(bob, sam) and BilateralThread(bob, sally)`
46// p.start();
47
48
49
50
51 }
52
53
54 public Portfolio getPortfolio()
55 {
56 return portfolio;
57 }
58
59 public DemandPlan getDemandPlan()
60 {
61 return demandPlan;
62 }
63
64}
65
Note: See TracBrowser for help on using the repository browser.