ScalABM / auctions

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

Remove implicit ordering params #52

Closed davidrpugh closed 7 years ago

davidrpugh commented 7 years ago

@bherd-rb This PR is a first step towards making the ordering parameters explicit. This allows the creation of an overloaded empty constructor where the user can either pass ordering parameters or not (in which case the default orderings are used).

This allows a user to create a order book as follows in Java...

FourHeapOrderBook<GoogleStock> orderBook = FourHeapOrderBook.empty();

...and in Scala...

val orderBook = FourHeapOrderBook.empty[GoogleStock]

...there is still a bit of work to do cleaning up the way orderings are defined on the Scala side. In particular I am thinking about pulling the orderings out of the companion objects and into a separate orderings package. I think this would allow easier use of defined orderings from the Java side (i.e., no messing with MODULE$ syntax; would also allow for easier sub-classing of orderings.

davidrpugh commented 7 years ago

@bherd-rb The changes originally in this PR have made it into develop via other PRs! I am going to leave this branch open and use it to explore some of the ideas we discussed concerning extracting the orderings from the various companion objects into classes (possibly in a separate package) to improve the syntax for Java users.

davidrpugh commented 7 years ago

I am going to close this an open a clean PR for extracting orderings.