This PR adds a combineWith method to the Auction type that effectively merges an auction with another auction of an appropriate type. This method will be used to parallelize auction simulations as follows.
val orders: ParIterable[(Token, Order[T])] = ???
val withOutOrders: Auction = ???
val withOrders: Auction = orders.aggregate(withOutOrders)((auction, order) => auction.insert(order), (auction1, auction2) => auction1.combineWith(auction2))
The real work is being done by the aggregate method which is part of the scala collections library. Finalizing this PR requires implementing some helper methods in the FourHeapOrderBook class and addressing an issue with the visibility modifier on the orderBook field in the Auction type.
This PR adds a
combineWith
method to theAuction
type that effectively merges an auction with another auction of an appropriate type. This method will be used to parallelize auction simulations as follows.The real work is being done by the
aggregate
method which is part of the scala collections library. Finalizing this PR requires implementing some helper methods in theFourHeapOrderBook
class and addressing an issue with the visibility modifier on theorderBook
field in theAuction
type.