Last change
on this file since 341 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:
594 bytes
|
Rev | Line | |
---|
[338] | 1 | /**
|
---|
| 2 | *
|
---|
| 3 | */
|
---|
| 4 | package bargainingchips;
|
---|
| 5 |
|
---|
| 6 | import java.util.ArrayList;
|
---|
| 7 | import java.util.HashMap;
|
---|
| 8 | import java.util.List;
|
---|
| 9 | import java.util.Map;
|
---|
| 10 |
|
---|
| 11 | /**
|
---|
| 12 | * @author Faria Nassiri-Mofakham
|
---|
| 13 | *
|
---|
| 14 | */
|
---|
| 15 | public class ChipIssueValueBuilder<T>
|
---|
| 16 | {
|
---|
| 17 |
|
---|
| 18 | private Map<Chip, T> issue;
|
---|
| 19 |
|
---|
| 20 | /**
|
---|
| 21 | */
|
---|
| 22 | public ChipIssueValueBuilder()
|
---|
| 23 | {
|
---|
| 24 | this.issue = new HashMap<Chip, T>();
|
---|
| 25 | }
|
---|
| 26 |
|
---|
| 27 | public ChipIssueValueBuilder<T> addIssue(String c, T v)
|
---|
| 28 | {
|
---|
| 29 | issue.put(new Chip(c), v);
|
---|
| 30 | return this;
|
---|
| 31 | }
|
---|
| 32 |
|
---|
| 33 | /**
|
---|
| 34 | */
|
---|
| 35 | public ChipIssueValue<T> build()
|
---|
| 36 | {
|
---|
| 37 | return new ChipIssueValue<T>(issue);
|
---|
| 38 | }
|
---|
| 39 |
|
---|
| 40 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.