project/src/ca/mun/team/NaiveGroupGeneration.java
// Recursively determines the number of students in the teams for even distribution
Recursively determines the number of students in the teams for even distribution
Recursively determines the number of students in the teams for even distribution
private void calculateTeamSizes() {
		stuInSmallerTeams += largerTeamSize;
		numSmallerTeams++;
		numLargerTeams--;
		if (stuInSmallerTeams%smallerTeamSize == 0) { return; }
		if (numLargerTeams == 0) {
			if ((stuInSmallerTeams%smallerTeamSize) == (smallerTeamSize-1)) { return; }
			largerTeamSize = smallerTeamSize-1;
			smallerTeamSize -= 2;
			numLargerTeams = numberOfStu/largerTeamSize;
			stuInSmallerTeams = numberOfStu%largerTeamSize;
			if (stuInSmallerTeams == 0) {
				numSmallerTeams = 0;
				return;
			}
			else {
				numSmallerTeams = 1;
			}
		}
		calculateTeamSizes();
	}
private void calculateTeamSizes ( ) { stuInSmallerTeams += largerTeamSize ; numSmallerTeams ++ ; numLargerTeams -- ; if ( stuInSmallerTeams % smallerTeamSize == 0 ) { return ; } if ( numLargerTeams == 0 ) { if ( ( stuInSmallerTeams % smallerTeamSize ) == ( smallerTeamSize - 1 ) ) { return ; } largerTeamSize = smallerTeamSize - 1 ; smallerTeamSize -= 2 ; numLargerTeams = numberOfStu / largerTeamSize ; stuInSmallerTeams = numberOfStu % largerTeamSize ; if ( stuInSmallerTeams == 0 ) { numSmallerTeams = 0 ; return ; } else { numSmallerTeams = 1 ; } } calculateTeamSizes ( ) ; }
Recursively determines the number of students in the teams for even distribution
Recursively determines the number of students in the teams for even distribution