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

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

'Line' problem (and in GUI) fixed. (There also have been several updates in other files before this commit!!)

File size: 1.2 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 public Main()
13 {
14 Product redProduct = new Product("Red");
15 Product pinkProduct = new Product("Pink");
16 Product blueProduct = new Product("Blue");
17
18
19 portfolio = new Portfolio();
20
21 portfolio.addProduct(redProduct);
22 portfolio.addProduct(pinkProduct);
23 portfolio.addProduct(pinkProduct);
24 portfolio.addProduct(blueProduct);
25
26
27// int s = portfolio.size();
28// for (int i=0; i<s; i++)
29// {
30// //demandPlan.setQuantity(portfolio.getProduct(i), (int)Math.random()*5+1 );
31//// System.out.println(portfolio.getProduct(i).getColor());
32// }
33//
34//// Iterator<Product> t = (Iterator<Product>) portfolio.iterator();
35//// for(List p:t)
36//// {
37//// System.out.println(p);
38//// }
39
40// demandPlan = new DemandPlan();
41//
42// for (Product product : portfolio.getPortfolio())
43// {
44// demandPlan.setQuantity(product, (int)(Math.random()*5+1));
45// }
46
47 }
48
49
50 public Portfolio getPortfolio()
51 {
52 return portfolio;
53 }
54
55 public DemandPlan getDemandPlan()
56 {
57 return demandPlan;
58 }
59
60}
61
Note: See TracBrowser for help on using the repository browser.