private void setUpMap(int nRows, int nCols, int nPlanets) {
		this.numCols = nCols;
		this.numRows = nRows;
		this.numPlanets = nPlanets;
		
		_grid = new Location[numRows][numCols];
		
		for(int x = 0; x < numRows; x++) {
			for(int y = 0; y < numCols; y++) {
				_grid[x][y] = new Location(x, y);
			}
		}
		
		float minDistance;
		boolean validLoc;
		Random r = new Random();
		int xPos = 0, yPos = 0;
		int maxAttempts = 5, attempts = 0; 
		Location[] planetLocs = null;
		// Place Planets
		if(nPlanets > 0){
			planetLocs = new Location[nPlanets];
			minDistance = Math.max(nRows, nCols) / (float)nPlanets;
			
			if(debug) System.out.println("minDistance for planets is " + minDistance);
			
			do {
				xPos = (int)((r.nextGaussian() * nRows / 6) + (nRows / 2));
				yPos = (int)((r.nextGaussian() * nCols / 6) + (nCols / 2));
			} while(xPos < 0 || xPos >= nRows || yPos  < 0 || yPos >= nCols);

			if(debug) System.out.println("Placing planet at " + xPos + ", " + yPos);

			_grid[xPos][yPos].setPlanet(new IndustrialPlanet(_grid[xPos][yPos]));
			planetLocs[0] = _grid[xPos][yPos];
			for(int i = 1; i < nPlanets; i++) {
				attempts = 0;
				do {
					validLoc = true;
					
					do {
						xPos = (int)((r.nextGaussian() * nRows / 6) + (nRows / 2));
						yPos = (int)((r.nextGaussian() * nCols / 6) + (nCols / 2));
					} while(xPos < 0 || xPos >= nRows || yPos  < 0 || yPos >= nCols);
			
					for(int loc = 0; loc < i - 1; loc++) {
						if(Location.distance(planetLocs[loc], _grid[xPos][yPos]) < minDistance) {
							validLoc = false;
							break;
						}
					}
					attempts++;
				} while(!validLoc && attempts < maxAttempts);

				if(debug && attempts >= maxAttempts) System.out.println("Max attempts reached. Placing planet at " + xPos + ", " + yPos);
				else if(debug) System.out.println("Placing planet at " + xPos + ", " + yPos);
				
				_grid[xPos][yPos].setPlanet(new IndustrialPlanet(_grid[xPos][yPos]));
				planetLocs[i] = _grid[xPos][yPos];
			}
		}
		
		// Place Players
		minDistance = Math.max(numRows, numCols) / TurnManager.numPlayers;
		maxAttempts = 50 / TurnManager.numPlayers; // We wanna try to enforce the player positions a little more strongly than the planets, if there are only a few players.
		
		if(debug) System.out.println("MinDistance for ships is " + minDistance);
		
		Location[] startPoints = new Location[TurnManager.numPlayers];
		xPos = r.nextInt(numRows);
		yPos = r.nextInt(numCols);

		if(debug) System.out.println("Placing player 1's ship at " + xPos + ", " + yPos);

		// Randomly place the first player.
		_grid[xPos][yPos].EnterSector(new CapitalShip(1));
		startPoints[0] = _grid[xPos][yPos];
		for(int i = 2; i <= TurnManager.numPlayers; i++) {
			attempts = 0;
			do {
				validLoc = true;
				
				// Randomly determine a direction and a distance from first player.
				xPos = r.nextInt(numRows);
				yPos = r.nextInt(numCols);

				// Analyze location as a valid location. i.e. not within minDistance of other players and still a valid location.
				for(int loc = 0; loc < i - 1; loc++) {
					if(Location.distance(startPoints[loc], _grid[xPos][yPos]) < minDistance) {
						validLoc = false;
						break;
					}
				}
				
				if(nPlanets > 0 && validLoc) {
					for(int p = 0; p < nPlanets; p++) {
						if(Location.distance(planetLocs[p], _grid[xPos][yPos]) < minDistance) {
							validLoc = false;
							break;
						}
					}
				}
				
				attempts++;
			} while(!validLoc && attempts < maxAttempts);

			if(debug && attempts >= maxAttempts) System.out.println("Max Attempts reached. Placing player " + i + "'s ship at " + xPos + ", " + yPos);
			if(debug) System.out.println("Placing player " + i + "'s ship at " + xPos + ", " + yPos);
			
			// If valid, assign location as starting point and move on.
			_grid[xPos][yPos].EnterSector(new CapitalShip(i));
			startPoints[i - 1] = _grid[xPos][yPos];
		}
	}