public void vaccinateFracOfMostSocPeopleAtHighDegLocRestByHomeDist(int numVaccines, double fraction, int percentile, double minHomeDist, double maxHomeDist){
		HashMap distances = EpiSimUtil.locationsRestByHomeDist(minHomeDist, maxHomeDist, percentile);
		int numFetchRows = 100;
		try {
			Connection con = EpiSimUtil.dbConnect();
			PreparedStatement getAggPop = con.prepareStatement(
					"SELECT aggregatePop FROM "+EpiSimUtil.locTbl+" WHERE locationID = ?");
			PreparedStatement getLocs = con.prepareStatement(
					"SELECT locationID FROM "+EpiSimUtil.llCountTbl+" ORDER BY outbound DESC LIMIT ?,?");
			for (int i = 0; numVaccines > 0; i++) {
				getLocs.setInt(1, i*numFetchRows);
				getLocs.setInt(2, numFetchRows);
				ResultSet getLocsQ = getLocs.executeQuery();
				while (getLocsQ.next() && numVaccines > 0) {
					int location = getLocsQ.getInt("locationID");
					if (distances.containsKey(new Integer(location))) {
						getAggPop.setInt(1, location);
						ResultSet getAggPopQ = getAggPop.executeQuery();
						if (getAggPopQ.first()) {
							double temp = fraction*getAggPopQ.getInt("aggregatePop");
							int curLocNumVaccs = (int) temp;
							if (numVaccines >= curLocNumVaccs) {
								numVaccines -= curLocNumVaccs;
								this.vaccinateMostSocPeopleAtLocation(location, curLocNumVaccs);
							} else {
								this.vaccinateMostSocPeopleAtLocation(location, numVaccines);
								numVaccines = 0;
							}
						} else {
							System.out.println("#####################################################");
							System.out.println("# Could not get aggregate population for location "+location+"; "+numVaccines+" waisted vaccines as a result.");
							System.out.println("#####################################################");
							numVaccines = 0;
						}
					}
				}
			}
			con.close();
		} catch (Exception e){
			System.out.println(e);
		}
	}