Optimizing cloudlet scheduling and wireless sensor localization