Humphreychinedu / BiddingBots

Technical task for Optimax-energy.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BidderBot

My take at the technical task for Optimax GmbH.

Classes to look at:

  • 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.

Util classes:

  • 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.

The bot was tested against the following strategies:

Tests:

  • 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.

Conditions of the problem:

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.

About

Technical task for Optimax-energy.


Languages

Language:Java 100.0%