Last change
on this file since 338 was 338, checked in by Faria Nassiri Mofakham, 5 years ago |
An extended version of Buyer (BuyerExtended), which can be constructed using one among many utility functions. UF_LessPrice and seven complex utility functions based on price+quantity and two types of weights: UF_LessPriceCloseToQuantity, UF_IntensifiedLessPriceCloseToQuantity, UF_PeakedPricePeakedQuantity, UF_PeakedFlatPricePeakedFlatQuantity, UF_PeakedFlatCurvePriceGaussianQuantity, UF_BezierPriceBezierQuantity, and UF_BezierPriceGaussianQuantity. Two more fundamental helper classes: ChipIssueValue, ChipIssueValueBuilder. Adding a validity check to Stack. An update in Bundle main. Adding getSampleBid function to Bid. An update in k variable in Agent. A UF class and UtilityHelperMethods for individual passing utility functions. Adding some more tests in UF_CloseToQuantity main. An update on BundleTest.
|
File size:
577 bytes
|
Line | |
---|
1 | package bargainingchips;
|
---|
2 |
|
---|
3 | import java.util.Iterator;
|
---|
4 | import java.util.Map;
|
---|
5 |
|
---|
6 | /**
|
---|
7 | * A wish list is a list of chips with their quantities.
|
---|
8 | */
|
---|
9 | public class WishList extends ChipMapping<Integer> implements Iterable<Chip>
|
---|
10 | {
|
---|
11 | public WishList(Map<Chip, Integer> f)
|
---|
12 | {
|
---|
13 | this.f = f;
|
---|
14 | }
|
---|
15 |
|
---|
16 | public int getQuantity(Chip c)
|
---|
17 | {
|
---|
18 | return f.get(c);
|
---|
19 | }
|
---|
20 |
|
---|
21 | @Override
|
---|
22 | public Iterator<Chip> iterator()
|
---|
23 | {
|
---|
24 | return f.keySet().iterator();
|
---|
25 | }
|
---|
26 |
|
---|
27 | @Override
|
---|
28 | public String toString()
|
---|
29 | {
|
---|
30 | return f.toString();
|
---|
31 | }
|
---|
32 |
|
---|
33 | public int size()
|
---|
34 | {
|
---|
35 | return f.size();
|
---|
36 | }
|
---|
37 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.