Question: I am trying to find a hash function which could provide some outputs that have their values well distributed across certain range of values. And the input will be IP addresses.

We are storing IP address as a key into HBase, my understanding is that the rowkey is used in hbase to distribute each row into different region server. If we could distribute the IP addresses well, then the read/write performance should get some level of improvement.

Answer: 
Create a `RobotModel` that contains a `Collection<Robot>` and defines their interaction. Iterate the model in the `doInBackground()` implementation of a [`SwingWorker`](https://docs.oracle.com/javase/tutorial/uiswing/concurrency/worker.html). Invoke `publish()` as meaningful events arise, and `process()` updates to the `RobotWorld` view by querying the model. As discussed [here](https://stackoverflow.com/a/3072979/230513), there should be no drawing in the model and no interaction logic in the view. A single worker should suffice for a moderately complex model, but you can synchronize multiple workers as shown [here](https://stackoverflow.com/a/11372932/230513).
A good option to achieve this is to use [ScheduledThreadPoolExecutor](http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ThreadPoolExecutor.html).  

Instantiate the thread pool via:

```
ScheduledThreadPoolExecutor threadsPool = new ScheduledThreadPoolExecutor(size);

```

To create a new Robot Thread, use:

```
    threadsPool.submit(new Runnable() {
        @Override
        public void run() {
            launchRobot();
        }
    });

```

This way, each invocation will instantiate a new Thread.  

You can set the limit of the total number of allowed Thread via the "size" argument.  

You can also pass a result after each thread completes using:

```
public <T> Future<T> submit(Runnable task, T result) 

```

If you want less detail, you could let Java do the work for you with the following convenience API:  

`Executors.newCachedThreadPool()` (unbounded thread pool, with automatic thread reclamation) or:  

`Executors.newFixedThreadPool(int)` (fixed size thread pool)

*Remember us, Executor. Remember what was done here today. And may Adun watch over you*