jbgo / Team-Forming-System

Software Engineering Project
2 stars 2 forks source link

Implement assign teams by GPA algorithm #11

Open jbgo opened 14 years ago

dracko86 commented 14 years ago

Assumptions:

  1. Groups must have the same number of persons or as close to the same number as possible

Inputs: int group size --> gs array/arraylist/list of students --> sList bool prevent undersize groups --> pug

PRE-1 check for a null or empty list or a groupsize <1 -> throw error

PRE-2 If groupsize ==1 then create a new group object and throw all students inside and return it in a single element array

@Concept approach = fill lowest first

Process:

  1. create an array copy of sList, sort it in decreasing order of GPA -> nList
  2. int numGroups = sList.size() / gs
  3. if !pug and sList.size() % gs !=0 then numGroups++
  4. create a new empty list of size numGroups of type Groups --> GA
  5. for (Student s : nList) { GA[0].add(s); sortGroupsByGPASumIncreasing(GA); }
  6. return GA;
dracko86 commented 14 years ago

Should be complete as is