Simulate metapopulations for portfolio optimization