The line splitting here is not great; it makes it hard to see that the .map is on the range i to i+2, and all this stuff is in a tuple. Feel free to either use temporary variables or use blocks, e.g.
```
(1 to partitions).map { i =>
  (i to (i+2)).map(_ => machines(rnd.nextInt(machines.size))
}
```