@Service public class AuctionService extends TimeslotPhaseProcessor implements InitializationService
Orders may be market orders (no specified price) as well as limit orders (the normal case). Market orders are considered to have a "more attractive" price than any limit order, so they are sorted first in the clearing process. In case the clearing process needs to set a price by matching a market order with a limit order, the clearing price is set by applying a "default margin" to the limit order. If there are no limit orders in the match, then the market clears at a fixed default clearing price. It's probably best if brokers do not allow this to happen.
| Constructor and Description |
|---|
AuctionService() |
| Modifier and Type | Method and Description |
|---|---|
void |
activate(org.joda.time.Instant time,
int phaseNumber)
Processes incoming Order instances for each timeslot, generating the appropriate
MarketTransactions, Orderbooks, and ClearedTrade instances.
|
double |
getDefaultClearingPrice() |
double |
getDefaultMargin() |
double |
getSellerSurplusRatio() |
void |
handleMessage(Order msg)
Receives, validates, and queues an incoming Order message.
|
String |
initialize(Competition competition,
List<String> completedInits)
Initializes a plugin prior to the beginning of a game.
|
boolean |
validateOrder(Order order) |
init, setTimeslotPhasepublic String initialize(Competition competition, List<String> completedInits)
InitializationServiceinitialize in interface InitializationServicepublic double getSellerSurplusRatio()
public double getDefaultMargin()
public double getDefaultClearingPrice()
public void handleMessage(Order msg)
public boolean validateOrder(Order order)
public void activate(org.joda.time.Instant time,
int phaseNumber)
activate in class TimeslotPhaseProcessorCopyright © 2017 Power TAC. All rights reserved.