Line | |
---|
1 | package negotiator.onetomany;
|
---|
2 |
|
---|
3 | import java.awt.Color;
|
---|
4 | import java.awt.List;
|
---|
5 | import java.util.Iterator;
|
---|
6 |
|
---|
7 | public 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 |
|
---|
20 |
|
---|
21 | portfolio = new Portfolio();
|
---|
22 |
|
---|
23 | portfolio.addProduct(redProduct);
|
---|
24 | portfolio.addProduct(pinkProduct);
|
---|
25 | portfolio.addProduct(blueProduct);
|
---|
26 |
|
---|
27 | demandPlan = new DemandPlan();
|
---|
28 | for (Product product : portfolio.getPortfolio())
|
---|
29 | demandPlan.setQuantity(product, (int)(Math.random()*numType+1));
|
---|
30 | // demandPlan.setQuantity(redProduct, 2);
|
---|
31 |
|
---|
32 | // System.out.println(demandPlan);
|
---|
33 |
|
---|
34 | }
|
---|
35 |
|
---|
36 |
|
---|
37 | public Portfolio getPortfolio()
|
---|
38 | {
|
---|
39 | return portfolio;
|
---|
40 | }
|
---|
41 |
|
---|
42 | public DemandPlan getDemandPlan()
|
---|
43 | {
|
---|
44 | return demandPlan;
|
---|
45 | }
|
---|
46 |
|
---|
47 | }
|
---|
48 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.