source: src/main/java/bargainingchips/actions/Bid.java@ 338

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: 587 bytes
Line 
1package bargainingchips.actions;
2
3import bargainingchips.Bundle;
4import bargainingchips.BundleBuilder;
5
6public class Bid extends Offer
7{
8 /**
9 * Creates a bid. Bundle is immutable and therefore so is Offer.
10 */
11 public Bid(Bundle b)
12 {
13 super(b, OfferType.BID);
14 }
15
16 /**
17 * Just a sample example of a bid
18 */
19 public static Bid getSampleBid(String color, int qty)
20 {
21 Bundle b = new BundleBuilder()
22 .addStack(color, 7.0, qty)
23 .build();
24 return new Bid(b);
25 }
26
27 @Override
28 public String toString()
29 {
30 return "Bid: " + getBundle();
31 }
32}
Note: See TracBrowser for help on using the repository browser.