My take at the technical task for Optimax GmbH.
- BidderImpl - class to instantiate and use for competition.
- BiddingStrategy - enum-class that defines the strategy for BidderImpl.java, and a brief description of other strategies used for testing.
- NathanStrategy - a strategy I came up with.
- StrategyController - class that resolves where bidder calculates its bidding amount.
- StrategyUtil - class that provides static methods to formulate and implement strategies.
- CalcUtil - util class with general calculations.
- MatchUtil - util to decrease the number of equality checks.
- CopycatStrategy - bids it's opponent's last bid plus one if has an advantage, else skips round.
- FairStrategy - always bids mean price of 2 QU's.
- RisingStrategy - gradually raises bid so that would go with empty balance at the end.
- SafeStrategy - waits for advantage then bids median plus 2.
- WinnerIncrementStrategy - waits for advantage then bids last winning bid plus one.
- LehaSVV2009Strategy - strategy formulated and implemented by @lehaSVV2009.
- PyramidPlayerStrategy - strategy formulated and implemented by @PyramidPlayer.
- BidderBotIntegrationTests - integration tests ensuring that we win a considerable amount of games against other algorithms (winning rates in comments).
- StrategyUtillUnitTests - unit coverage for StrategyUtil.java to ensure that methods do not deviate from expectable behavior since all the strategies rely on them.
A product x QU (quantity units) will be auctioned under 2 parties. The parties have each y MU (monetary units) for auction. They offer then simultaneously an arbitrary number of its MU on the first 2 QU of the product. After that, the bids will be visible to both. The 2 QU of the product is awarded to who has offered the most MU; if both bid the same, then both get 1 QU. Both bidders must pay their amount - including the defeated. A bid of 0 MU is allowed. Bidding on each 2 QU is repeated until the supply of x QU is fully auctioned. Each bidder aims to get a larger amount than its competitor. In an auction wins the program that is able to get more QU than the other. With a tie, the program that retains more MU wins. Write a program that can participate in such an auction and competes with one of our programs. Please explain its strategy. The bidder interface:
- Bidder - Interface provided with task.