ScalABM / auctions

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

Generic auctionlike trait #60

Closed davidrpugh closed 7 years ago

davidrpugh commented 7 years ago

@bherd-rb This PR rearranges the auction type hierarchy a bit. Now there is a trait...

trait AuctionLike[T <: Tradable, O <: Order[T], A <: AuctionLike[T, O, A]] {

  def insert(order: O): A

  def remove(order: O): A

  def clear: (Option[Stream[Fill[T]]], A)

  protected def orderBook: FourHeapOrderBook[T]

  protected def pricing: PricingPolicy[T]

}

from which all single unit auctions (including double auctions) derive. Having a common super-type is quite useful/necessary in order to fix some other issues (with PRs to come!)...