Line | |
---|
1 | package negotiator.onetomany;
|
---|
2 |
|
---|
3 | import java.util.HashMap;
|
---|
4 |
|
---|
5 | public class Preference extends DemandPlan
|
---|
6 | {
|
---|
7 |
|
---|
8 | private Bid desiredBid = new Bid();
|
---|
9 | private HashMap<Product, Double> weight = new HashMap<Product, Double>();
|
---|
10 |
|
---|
11 | Product redProduct = new Product("Red");
|
---|
12 | Product pinkProduct = new Product("Pink");
|
---|
13 | Product blueProduct = new Product("Blue");
|
---|
14 |
|
---|
15 |
|
---|
16 | desiredBid.setQuantity(redProduct,4);
|
---|
17 | desiredBid.setQuantity(pinkProduct,4);
|
---|
18 | desiredBid.setQuantity(blueProduct,2);
|
---|
19 |
|
---|
20 | weight.setWeight(redProduct,0.6);
|
---|
21 | weight.setWeight(pinkProduct,0.3);
|
---|
22 | weight.setWeight(blueProduct,0.1);
|
---|
23 |
|
---|
24 |
|
---|
25 | public Bid getDesiredBid()
|
---|
26 | {
|
---|
27 | return desiredBid;
|
---|
28 | }
|
---|
29 |
|
---|
30 |
|
---|
31 | public HashMap<Product, Double> getWeight()
|
---|
32 | {
|
---|
33 | return weight;
|
---|
34 | }
|
---|
35 |
|
---|
36 | }
|
---|
37 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.