final double[] ordersPerHour = { 15d };// , 20d, 50d, 100d, 1000d };
final StandardDeviation sd = new StandardDeviation();
final RandomGenerator rng = new MersenneTwister(123L);
final List<Times> times = newArrayList();
// for (int i = 0; i < 10; i++) {
// times.add(generateTimes(rng));
// }
times.add(asTimes(1000, 250L, 500L, 750L));
times.add(asTimes(1000, 100L, 500L, 750L));
times.add(asTimes(1000, 100L, 200L, 300L, 400L, 500L, 600L, 700L, 800L,
900L));
times.add(asTimes(1000, 100L, 200L, 300L, 399L, 500L, 600L, 700L, 800L,
900L));
times
.add(asTimes(1000, 10L, 150L, 250L, 350L, 450L, 550L, 650L, 750L, 850L,
950L));
times
.add(asTimes(1000, 50L, 150L, 250L, 350L, 450L, 551L, 650L, 750L, 850L,
950L));
times.add(asTimes(1000, 250L, 500L, 750L));
times.add(asTimes(1000, 0L, 50L, 55L, 57L, 59L, 60L, 100L, 150L, 750L));
times.add(asTimes(1000, 5L, 5L, 5L, 5L));
times.add(asTimes(1000, 4L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L,
5L,
5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L));
times.add(asTimes(1000, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L,
5L,
5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L));
times.add(asTimes(1000, 0L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L,
5L,
5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L,
999L));
times.add(asTimes(1000, 500L, 500L, 500L, 500L));
times.add(asTimes(1000, 5L, 5L, 5L, 5L, 400L, 410L, 430L, 440L, 800L, 810L,
820L,
830L));
times.add(asTimes(1000, 0L, 0L, 0L));
times.add(asTimes(1000, 1L, 1L, 1L));
times.add(asTimes(1000, 999L, 999L, 999L));
times.add(asTimes(1000, 0L, 0L, 500L, 500L, 999L, 999L));
times.add(asTimes(1000, 250L, 250L, 500L, 500L, 750L, 750L));
times.add(asTimes(1000, 250L, 250L, 250L, 500L, 500L, 500L, 750L, 750L,
750L));
for (int i = 0; i < 10; i++) {
times.add(generateTimes(rng, 10d));
}
for (int i = 0; i < 10; i++) {
times.add(generateTimes(rng, 30d));
}
for (int i = 0; i < 5; i++) {
final List<Double> ts = generateTimes(rng, 50d).list;
final List<Double> newTs = newArrayList();
for (final double l : ts) {
newTs.add(l);
newTs.add(Math.min(999, Math.max(0, l
+ DoubleMath.roundToLong((rng.nextDouble() * 6d) - 3d,
RoundingMode.HALF_EVEN))));
}
times.add(asTimesDouble(1000, newTs));
}
for (int i = 0; i < 5; i++) {
final List<Double> ts = generateTimes(rng, 100d).list;
final List<Double> newTs = newArrayList();
System.out.println("num events: " + ts.size());
for (final double l : ts) {
newTs.add(l);
newTs.add(Math.min(999, Math.max(0, l
+ DoubleMath.roundToLong((rng.nextDouble() * 2d) - 1d,
RoundingMode.HALF_EVEN))));
newTs.add(Math.min(999, Math.max(0, l
+ DoubleMath.roundToLong((rng.nextDouble() * 2d) - 1d,
RoundingMode.HALF_EVEN))));
}
times.add(asTimesDouble(1000, newTs));
}
final List<Long> t2 = asList(10L, 30L, 50L, 70L, 90L);
for (int i = 0; i < 5; i++) {
final List<Long> c = newArrayList();
for (int j = 0; j < i + 1; j++) {
c.addAll(t2);
}
Collections.sort(c);
times.add(asTimes(100, c));
}
final List<Long> t = asList(100L, 300L, 500L, 700L, 900L);
for (int i = 0; i < 15; i++) {
final List<Long> c = newArrayList();
for (int j = 0; j < i + 1; j++) {
c.addAll(t);
}
Collections.sort(c);
times.add(asTimes(1000, c));
}
final List<Long> variant = newArrayList();
variant.addAll(t);
for (int i = 0; i < 70; i++) {
variant.add(100L);
}
Collections.sort(variant);
times.add(asTimes(1000, variant));
checkState(variant.size() == 75);
checkState(times.get(times.size() - 2).list.size() == 75, "",
times.get(times.size() - 2).list.size());
for (int i = 0; i < 10; i++) {
times.add(generateTimes(rng, (i + 1) * 100d));
}
final ImmutableList<Long> all = ContiguousSet.create(
Range.closedOpen(0L, 1000L),
DiscreteDomain.longs()).asList();
times.add(asTimes(1000, all));
final List<Long> more = newArrayList(all);
for (final long l : all) {
if (l % 2 == 0) {
more.add(l);
}
}
Collections.sort(more);
times.add(asTimes(1000, more));
final List<Long> more2 = newArrayList(all);
for (int i = 0; i < 200; i++) {
more2.add(100L);
}
for (int i = 0; i < 100; i++) {
more2.add(200L);
}
Collections.sort(more2);
final List<Long> newMore = newArrayList();
for (int i = 0; i < more2.size(); i++) {
newMore.add(more2.get(i) * 10L);
}
times.add(asTimes(1000, more2));
times.add(asTimes(10000, newMore));
for (int k = 0; k < 5; k++) {
final List<Double> ts = newArrayList(generateTimes(rng, 20).list);
final List<Double> additions = newArrayList();
for (int i = 0; i < ts.size(); i++) {
if (i % 3 == 0) {
for (int j = 0; j < k; j++) {
additions.add(ts.get(i) + (rng.nextDouble() * 10));
}
}
}
ts.addAll(additions);
Collections.sort(ts);