ScalABM / auctions

A functional API for auction simulations
Apache License 2.0
13 stars 1 forks source link

Support for ascending (descending) price auctions (reverse auctions)... #43

Open davidrpugh opened 7 years ago

davidrpugh commented 7 years ago

Ascending price auctions are an important class of auctions that our API should be able to support. We should also support descending price reverse auctions.

One way to extend our API to support these auctions would be to generalize the type signature of the insert method and encapsulate it in a mixin trait.

// use the Try try to indicate whether insert was a success of a failure
def insert(order: LimitBidOrder[T]): Try[Auction[T]] = {
    // logic that checks whether the order improves upon the current bidQuote and returns success or failure, depending.  
}

...another signature would be something like...

def insert(order: LimitBidOrder[T]): Either[Reject[LimitBidOrder[T]], Auction[T]] = {
    // logic that checks whether the order improves upon the current bidQuote and either rejects the order or not, depending.
}