in simulator/src/main/java/com/google/cloud/simulator/Simulator.java [100:118]
private Simulator(MatcherContext context, long contractId, long midprice, long seed, long orderTicks) {
this.anchorMidprice = midprice;
this.midprice = midprice;
this.m = new Matcher(context, contractId);
if (seed != 0) {
this.r = new Random(seed);
} else {
this.r = new Random();
}
// Calculate ticks
this.orderTicks = orderTicks;
this.cancelTicks = BOOK_SIZE * orderTicks;
this.trailingTimeoutTicks = cancelTicks;
// Queue the first task
this.context = context;
this.context.add(0, () -> generateOrder());
}