Modified the new constructor in PatchEnsemble to use multithreading.