A general model for designing networks of marine reserves