Generalized Phase Diversity Wavefront Sensing Based on Stochastic Parallel Optimization Algorithm