package tvark.old;

import java.io.Serializable;

import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public class ScheduleData implements Serializable{

	/**
	 * 
	 */ 
	private static final long serialVersionUID = 4886455334598304997L;

	private Student[] students;

	String GroupList[];

	private Teacher[] teachers;

	private int[][] subjBalance;

//	private int maxStudPerClass = 30;//tai cia tuributi 2

//	private static String Path;

	private Subject subjects[];
	
	private Room rooms[];
	
	private int[] subjGroups;
	
	transient XmlReadData read;

	
	ScheduleData(String path) {
		
		read = new XmlReadData(path);
		
		ReadStudents();
		ReadCodes();
		// getDifferentHourCount();
		subjGroups = getGroupsPerWeek();
		ReadTeachers();
	//	 CountGroups();
	//	 analyseTeacherHours();
	//	 share();
	}

	public int[] getNeededHours() {

		int[] fullSubject = new int[subjects.length];

		for (int i = 0; i < subjects.length; i++) {

			fullSubject[i] = subjects[i].getMaxSubjHours()
					* getGroupsPerWeek()[i];

		}
		return fullSubject;
	}

	public void shareHours(int subjNr) {
		int[][] teach = this.getTeachersBySubj(subjects[subjNr].getSubjCode());
		int[] hours = new int[teach.length];
		int teachNeed = this.getGroupsPerWeek()[subjNr];
		int need = this.getNeededHours()[subjNr];
		if (need == 0)
			return;
		for (int i = 0; i < teach.length; i++) {
			hours[i] = teachers[teach[i][0]].getHours()[teach[i][1]];
		}
		int test = 0;
		if (need % teachNeed != 0)
			test = 1;

		int average = need / teachNeed;
		int select[] = new int[teachNeed];
		boolean flag = false;

		int last = -1;
		for (int j = 0; j < select.length; j++) {
			int temp = max(hours);
			last = 0;
			flag = false;
			select[j] = -1;
			for (int i = 0; i < teach.length; i++) {
				if (hours[i] >= average && temp >= hours[i] && hours[i] != -1) {
					flag = true;
					temp = hours[i];
					last = i;
				} else {
					if (!flag) {
						last = -1;
					}
				}
			}

			select[j] = last;
			if (last != -1)
				hours[last] = -1;

		}

		if (flag) {
			for (int i = 0; i < teachNeed; i++) {
				if (test > 0
						&& teachers[teach[select[i]][0]].getHours()[teach[select[i]][1]]
								- average > 0) {
					teachers[teach[select[i]][0]].setHoursNeaded(
							teach[select[i]][1], average + 1);
					test--;
				} else {
					teachers[teach[select[i]][0]].setHoursNeaded(
							teach[select[i]][1], average);

				}

			}
		}

		return;
	}

	public int max(int[] arr) {
		int ret = arr[0];
		for (int i = 0; i < arr.length; i++) {
			if (arr[i] > ret)
				ret = arr[i];
		}

		return ret;

	}

	public void ReadCodes() {
		//XmlReadData read = new XmlReadData(0, Path);
		int rowCount = read.getRow_count(0);
		subjects = new Subject[rowCount - 1];

		int[] maxSubjHourCount = analyseStudentSubjects();
		for (int i = 0; i < rowCount; i++) {
			Node n = read.getData(0).item(i);
			Element eilute = (Element) n;
			if (i > 0) {
				NodeList cells = eilute.getElementsByTagName("Cell");
				subjects[i - 1] = new Subject();
				for (int k = 0; k < cells.getLength(); k++) {
					NodeList d = eilute.getElementsByTagName("Data");
					Node duom = d.item(k);
					Node nnn = duom.getFirstChild();

					if (k == 0){ 
						subjects[i - 1].setSubjCode(nnn.getNodeValue());
									}
					else if (k == 1){ 
						subjects[i - 1].setType(nnn.getNodeValue());
			//			System.out.println(subjects[i - 1].getType());
					}
					//prioriteto nuskaitymas
				    else if (k == 2) {
						subjects[i - 1].setPriority(nnn.getNodeValue());
					}
					//max studentø skaiciaus su kuriuo gali dirbti mokytojas nuskaitymas
				    else if (k == 3) {
						subjects[i - 1].setMaxStud(Integer.parseInt(nnn.getNodeValue()));
					//	System.out.println(subjects[i - 1].getMaxStud());		
					}					
				
					subjects[i - 1].setMaxSubjHours(maxSubjHourCount[i - 1]);
					// System.out.println(teachers[i-2].getHours()+" k ="+k);
					subjects[i - 1].setNr(i - 1);

				}
			}
		}
		return;
	}

	public int getSubjNrByCode(String code) {
		int ret = -1;
		for (int i = 0; i < subjects.length; i++) {
			if (subjects[i].getSubjCode().equals(code)) {
				ret = subjects[i].getNr();
			}
		}

		return ret;
	}

	public int[][] getTeachersBySubj(String code) {

		int count = 0;

		for (int i = 0; i < teachers.length; i++) {
			for (int j = 0; j < teachers[i].getSubjCode().length; j++) {
				if (teachers[i].getSubjCode()[j].equals(code)) {
					count++;

				}
			}
		}
		int[][] ret = new int[count][2];
		count = 0;
		for (int i = 0; i < teachers.length; i++) {
			for (int j = 0; j < teachers[i].getSubjCode().length; j++) {
				if (teachers[i].getSubjCode()[j].equals(code)) {
					ret[count][0] = teachers[i].getNr();
					ret[count][1] = j;
					count++;
				}
			}
		}

		return ret;
	}
//--------------dalyko kabinetai------------------------------------------
	public int[] getRoomBySubj(String code) {

		int count = 0;
		for (int i = 0; i < teachers.length; i++) 
		{
			for (int j = 0; j < teachers[i].getRooms().length; j++) 
			{
				if (teachers[i].getSubjCode()[j].equals(code)) 
				{
					for (int k = 0; k < teachers[i].getRooms()[j].length; k++) 
					{
						count++;
					}
				}
			}
		}		
		int[] nret = new int[count];
		count = 0;
		
		for (int i = 0; i < teachers.length; i++) 
		{
			for (int j = 0; j < teachers[i].getRooms().length; j++) 
			{
				if (teachers[i].getSubjCode()[j].equals(code)) 
				{
					for (int k = 0; k < teachers[i].getRooms()[j].length; k++) 
					{
					nret[count] = teachers[i].getRooms()[j][k];
					count++;
					}
				}
			}
		}
		//----------------------------------
		int sk=0;
		for (int a =0; a<count; a++) 
		{
			for (int b = 1; b<count-1; b++)
			{
				if (nret[a] == nret[b]&& a!=b && nret[a]!=0)
				{
					nret[b]=0;
					sk++;
				}				
			}
		}	
		int[] ret = new int[count - sk];
		int temp=0;
		// is masyvo atrenkami tik nepasikartojantys numeriai
		for (int a = 0; a<count; a++) 
		{
			if(nret[a]!=0){	
				ret[temp]=nret[a];
//			System.out.println("nepasikartojantis kabinetas..."+ ret[temp]);	
			temp++;
		   }
		}		
		return ret;
	}	
	
//--------------------------------------------------------
	public void share() {
		for (int i = 0; i < subjects.length; i++) {
			int[][] test = getTeachersBySubj(subjects[i].getSubjCode());
			if (test.length > 1) {
				shareHours(i);
			} else {
				teachers[test[0][0]].setHoursNeaded(test[0][1],
						getNeededHours()[i]);
			}
		}
	}

	public int[] analyseStudentSubjects() {
		/*
		 * // Read Students firs!!! // Allocate subjects first!!! // analyse
		 * student work hours // get the maximum of each subject // after use
		 * function in ReadCodes() //
		 */

		int[] maxCount = new int[subjects.length]; // maximum hours that
		// students study of
		// particular subject

		for (int j = 0; j < subjects.length; j++) {

			for (int i = 0; i < students.length; i++) {

				if (maxCount[j] < students[i].getHours()[j])
					maxCount[j] = students[i].getHours()[j];
			}

		}
		return maxCount;
	}

	public int[] getGroupsPerWeek() {
		// get the count of groups that r neaded for each subject
		// subjects must be read!!!!!
		// students must be read!!!!!
		// modify and modernise
		int[] Count = new int[subjects.length];
		int reiksm;

		for (int j = 0; j < subjects.length; j++) {
			for (int i = 0; i < students.length; i++) {
				if (students[i].getHours()[j] != 0) {
					Count[j]++;
				}

			}
		//	reiksm = Count[j] % maxStudPerClass;
		//	Count[j] = Count[j] / maxStudPerClass;
			
			reiksm = Count[j] % subjects[j].getMaxStud();
			Count[j] = Count[j] / subjects[j].getMaxStud();
			

			if (reiksm > 0)
				Count[j]++;
			// System.out.println(Count[j]);
		}

		return Count;

	}

	public int[] getDifferentHourCount() {

		int[] Count = new int[subjects.length];
		int[] DalykoVal = new int[students.length];

		// students[i] // ribos nuo 0 iki students.length;
		// subjects[j] // ribos nuo 0 iki subjects.length;
		// students[i].getHours()[1]=0; int[k] k=subject
		// uzduotis: suskaiciuot kiek yra skirtingu valandu kiekvieno dalyko
		int reiksm;
		for (int j = 0; j < subjects.length; j++) {
			for (int i = 0; i < students.length; i++) {
				DalykoVal[i] = students[i].getHours()[j];
			}
			for (int i = 0; i < students.length; i++) {
				int k = i + 1;
				reiksm = DalykoVal[i];
				for (; k < students.length; k++) {
					if (reiksm == DalykoVal[k]) {

						DalykoVal[k] = -1;
					}

				}
			}

			for (int i = 0; i < students.length; i++) {

				if (DalykoVal[i] != -1) {

					Count[j]++;
				}
			}

		}
		// Count for return

		return Count;
	}



//-----------------------nuskaito mokytoju informacija-----------------------------
	public void ReadTeachers() {

	//	XmlReadData read = new XmlReadData(1, Path);

		// teachers = new String[read.getRow_count()-1][read.getColumn_count()];
		teachers = new Teacher[read.getRow_count(1) - 2];

		for (int i = 0; i < read.getRow_count(1); i++) {
			Node n = read.getData(1).item(i);
			Element eilute = (Element) n;

			if (i > 1) {
				NodeList cells = eilute.getElementsByTagName("Cell");
				teachers[i - 2] = new Teacher();
				for (int k = 0; k < cells.getLength(); k++) {
					Node nnn;
					try {
						nnn = cells.item(k).getChildNodes().item(0)
								.getFirstChild();
						// System.out.println(list.getNodeValue());
					} catch (NullPointerException ex) {
						nnn = null;
					}
					// NodeList d = eilute.getElementsByTagName("Data");
					// Node duom = d.item(k);

					if (k == 3) {
						if (nnn != null)
							teachers[i - 2].setName("" + nnn.getNodeValue());
						// System.out.println(teachers[i-2].getName()+" k ="+k);
					} else if (k == 5) {
						if (nnn != null)
							teachers[i - 2].setHours(stringToInt(nnn
									.getNodeValue()));
						// System.out.println(teachers[i-2].getHours()+" k ="+k);
//-------------nuskaito kabinetus-------------------------------------			
					} else if (k == 4) {
						if (nnn != null) 
						{
							String[] teachRoom = nnn.getNodeValue().split("#");
							String[][] rooms = new String[teachRoom.length][];
							for (int x = 0; x < teachRoom.length; x++) 
							{
								rooms[x] = teachRoom[x].split("; ");
								rooms[x][rooms[x].length - 1] = rooms[x][rooms[x].length - 1]
										.replaceAll(";", "");
							}
							int[][]roomsint = new int [teachRoom.length][];	
							for (int y = 0; y < teachRoom.length; y++) {
								roomsint[y] = new int [rooms[y].length];
								for (int z = 0; z < rooms[y].length; z++){
									roomsint[y][z] = Integer.parseInt(rooms[y][z]);						
								}
							}
					teachers[i - 2].setRooms(roomsint);	
						}
						//System.out.println(teachers[i-2].getName()+" k ="+k);
						
//----------------------------------------------				
					} else if (k == 7) {
						if (nnn != null) {
							String[] classGroup = nnn.getNodeValue().split("#");
							String[][] classes = new String[classGroup.length][];
							for (int x = 0; x < classGroup.length; x++) {
								classes[x] = classGroup[x].split("; ");
								classes[x][classes[x].length - 1] = classes[x][classes[x].length - 1]
										.replaceAll(";", "");
							}

							teachers[i - 2].setClassGrops(classes);
						}
					//	 System.out.println(teachers[i-2].getName()+" k ="+k);
						 
					} else if (k == 6) {
						if (nnn != null)
							teachers[i - 2].setSubjCode(nnn.getNodeValue()
									.split(";"));
						Subject[] sub = new Subject[teachers[i - 2]
								.getSubjCode().length];
						for (int subjCount = 0; subjCount < teachers[i - 2]
								.getSubjCode().length; subjCount++) {
							for (int j = 0; j < subjects.length; j++) {
								if (subjects[j]
										.getSubjCode()
										.equals(
												teachers[i - 2].getSubjCode()[subjCount])) {
									sub[subjCount] = subjects[j];
								}
							}
						}
						teachers[i - 2].setSubjects(sub);
						teachers[i - 2].allocateNeeds(sub.length);
						teachers[i - 2].setNr(i - 2);
			//System.out.println(teachers[i-2].getCode()+" k ="+k);
					} else if (k == 8) {
						if(nnn!=null){
						String temp[] = nnn.getNodeValue().split(";");
						
						for (int z=0; z<temp.length;z++){
							teachers[i-2].setOff(z, Integer.parseInt(temp[z]));
						//	System.out.println(teachers[i-2].getOff()+" k ="+k);
						}
						}
						
					}
				}
			}
		}
		getShoolRooms();
		
	}
//------------------------------------------------------
	public int[] stringToInt(String arr) {
		String[] temp = arr.split(";");
		int ret[] = new int[temp.length];
		for (int i = 0; i < temp.length; i++) {
			ret[i] = Integer.parseInt(temp[i]);
		}
		return ret;
	}

	public void analyseTeacherHours() {
		// get teach subj hours
		// teachers must be allocated
		// subjects must be allocated

		int[] average = new int[subjects.length];
		int[] teachCount = new int[subjects.length];

		for (int i = 0; i < subjects.length; i++) 
		{
			for (int j = 0; j < teachers.length; j++) 
			{
				for (int subjCount = 0; subjCount < teachers[j].getSubjects().length; subjCount++) 
				{
					if (subjects[i].getSubjCode().equals(
							teachers[j].getSubjCode()[subjCount])) 
					{

						average[i] += teachers[j].getSubjects()[subjCount]
								.getMaxSubjHours();
						teachCount[i]++;
					}

				}
			}

		}
		int[] neededhours = new int[subjects.length];

		for (int i = 0; i < subjects.length; i++) 
		{
			// if(subjBalance[i]<=subjects[i].getMaxSubjHours()){
			neededhours[i] = subjects[i].getMaxSubjHours() * 2;
			average[i] = neededhours[i] / teachCount[i]; // /this one is
			// wrong!!!! AVERAGE
			// SHOULD BE NEADED
			// HOUR
			// COUNT!!!!!!!!!!!!!!!!!!!!!
			int cnt = neededhours[i] % teachCount[i];
			if (cnt > 0)
				average[i]++;
		}

		int[] remainer = new int[subjects.length];
		int[][] freeHours = new int[teachers.length][];
		int[][] workHours = new int[teachers.length][];
		for (int i = 0; i < teachers.length; i++) 
		{
			workHours[i] = new int[teachers[i].getHours().length];
			freeHours[i] = new int[teachers[i].getHours().length];
			for (int j = 0; j < subjects.length; j++) 
			{
				for (int subjCount = 0; subjCount < teachers[i].getSubjects().length; subjCount++) {
					if (subjects[j].getSubjCode().equals(
							teachers[i].getSubjCode()[subjCount])
							&& average[j] != 0) 
					{
						if (average[j] - teachers[i].getHours()[subjCount] > 0) 
						{
							remainer[j] += average[j]
									- teachers[i].getHours()[subjCount];
							workHours[i][subjCount] = teachers[i].getHours()[subjCount];
							freeHours[i][subjCount] = 0;
						} else if (average[j]
								- teachers[i].getHours()[subjCount] < 0) 
						{
							workHours[i][subjCount] = average[j];
							freeHours[i][subjCount] = teachers[i].getHours()[subjCount]
									- average[j];
						} else if (average[j]
								- teachers[i].getHours()[subjCount] == 0) 
						{
							workHours[i][subjCount] = average[j];
							freeHours[i][subjCount] = 0;
						}

					}
				}
			}
		}
		// System.out.println("entering here");
		for (int j = 0; j < subjects.length; j++) 
		{
			while (remainer[j] > 0) {
				for (int i = 0; i < teachers.length; i++) 
				{

					for (int subjCount = 0; subjCount < teachers[i]
							.getSubjects().length; subjCount++) 
					{
						if (subjects[j].getSubjCode().equals(
								teachers[i].getSubjCode()[subjCount])) 
						{
							if (remainer[j] != 0 && freeHours[i][subjCount] > 0) 
							{
								workHours[i][subjCount]++;
								freeHours[i][subjCount]--;
								remainer[j]--;
							} else if (remainer[j] > 0
									&& freeHours[i][subjCount] == 0) {
								System.out.println("Add teachers or hours :"
										+ remainer[j] + " Subject :"
										+ subjects[j].getSubjCode());
								remainer[j]--;
							}

						}

					}
				}
			}
		}
		subjBalance = workHours;
	}

	public void CountGroups() {
		int sheetCount = read.getSheet_count();
		GroupList = new String[sheetCount - 3]; // allocate Group list
		for (int i = 0; i < sheetCount - 3; i++) {
			String name = read.getName(i+2);
			GroupList[i] = name;
		}
	}
//----------------------------------------------------------------------------------------
	public void ReadStudents() {
	//	XmlReadData xml = new XmlReadData(Path);
		int studentCount = 0;

		for (int i = 0; i < read.getSheet_count() - 3; i++) {
			//XmlReadData read = new XmlReadData(i + 2, Path);
			studentCount += read.getRow_count(i+2) - 2;
		}
		students = new Student[studentCount];
		// System.out.println(xml.getSheet_count());

		// String[xml.getSheet_count(Path)-3][35][];
		int count = 0;
		for (int j = 2; j < read.getSheet_count() - 1; j++) {
		//	XmlReadData read = new XmlReadData(j, Path);
			String klass = read.getName(j);
			// System.out.println(j-2+" "+read.getRow_count());

			for (int i = 0; i < read.getRow_count(j); i++) {

				Node n = read.getData(j).item(i);
				Element row = (Element) n;

				if (i > 1) {
					students[count] = new Student();
					students[count].setKlass(klass);
					// students[j-2][i-2] = new String[read.getColumn_count()];
					NodeList cells = row.getElementsByTagName("Cell");

					for (int k = 0; k < cells.getLength(); k++) {
						boolean flag = true;
						Node list = null;
						try {
							list = cells.item(k).getChildNodes().item(0)
									.getFirstChild();
							// System.out.println(list.getNodeValue());
						} catch (NullPointerException ex) {
							flag = false;
						}

						// NodeList d = row.getElementsByTagName("Data");
						// Node duom = d.item(k);
						// Node nnn = duom.getFirstChild();
						// students[j-2][i - 2][k] = "" + nnn.getNodeValue();

						if (k == 0) {
							if (flag) {
								students[count].setNr(Integer.parseInt(list
										.getNodeValue()));
							} else {
								students[count].setNr(-1);
							}
						} else if (k == 1) {
							if (flag) {
								students[count].setName(list.getNodeValue());
							} else {
								students[count].setName("null");
							}
						} else if (k < 33) {	// buvo 29
							if (flag) {
								students[count].setHour(k - 2, Integer
										.parseInt(list.getNodeValue()));
							} else {
								students[count].setHour(k - 2, 0);
							}
						}

					}
					count++;
				}

			}

		}

	}

	public int[] getClassTeachers(String clas) {
		int[] ret;
		int temp = 0;
		for (int i = 0; i < teachers.length; i++) {
			for (int j = 0; j < teachers[i].getClassGrops().length; j++) {
				for (int k = 0; k < teachers[i].getClassGrops()[j].length; k++) {
					if (clas.equals(teachers[i].getClassGrops()[j][k])) {
						temp++;
					}
				}
			}
		}

		ret = new int[temp];
		temp = 0;
		for (int i = 0; i < teachers.length; i++) {
			for (int j = 0; j < teachers[i].getClassGrops().length; j++) {
				for (int k = 0; k < teachers[i].getClassGrops()[j].length; k++) {
					if (clas.equals(teachers[i].getClassGrops()[j][k])) {
						ret[temp] = i;
						temp++;
					}
				}
			}
		}
		return ret;

	}
//---------------visi naudojami mokyklos kabinetai surasomi i klase Room--------------	
	public void getShoolRooms() 
	{
			for (int t = 0; t < teachers.length; t++) 
			{
				if(teachers[t].getSubjCode().length != teachers[t].getRooms().length )
					System.out.println(teachers[t].getName()+" nesutampa mokomu dalyku ir dalykams skirtu kabinetu masyvu skaicius");		
			}
	//-----------------------------		
		int count = 0;
		for (int i = 0; i < teachers.length; i++) 
		{
			for (int j = 0; j < teachers[i].getRooms().length; j++) 
			{
				for (int k = 0; k < teachers[i].getRooms()[j].length; k++) 
				{
					//suskaiciuojamas pasikartojanciu kabinetø nr skaicius
					count++;
				}
			}
		}
		int[]mas = new int[count];
		int temp = 0;		
		for (int i = 0; i < teachers.length; i++) 
		{
			for (int j = 0; j < teachers[i].getRooms().length; j++) 
			{
				for (int k = 0; k < teachers[i].getRooms()[j].length; k++) 
				{
					// surasomi visi panaudoti kabinetu numeriai i viena masyva
					mas[temp] = teachers[i].getRooms()[j][k];
				//	System.out.println("kabinetu sarasas..."+mas[temp]);
					temp++;
				}
			}
		}
//		System.out.println("kabinetu masyve..."+ count);
//--------i pasikartojancius numerius suraso nulius-------------
		int sk=0;
		for (int a =0; a<count; a++) 
		{
			for (int b = 1; b<count-1; b++)
			{
				if (mas[a] == mas[b]&& a!=b && mas[a]!=0) 
				{
					mas[b]=0;
					sk++;
				}				
			}
		}	
		rooms = new Room[count - sk];
		temp=0;
//	System.out.println("mokyklos kabinetu skaicius..."+ rooms.length);
		// is masyvo atrenkami tik nepasikartojantys numeriai
		for (int a = 0; a<count; a++) 
		{
			if(mas[a]!=0){
				rooms[temp] = new Room();		
				rooms[temp].setRoom(mas[a]);
//			System.out.println("nepasikartojantis kabinetas..."+ rooms[temp].getRoom());	
			temp++;
		   }
		}
}
//-----------------------grazina nurodytam kabinete dirbanciu mokytoju sarasa----------------------------
	public int[] getRoomTeachers(String room) 
	{
		int[] ret;
		int temp = 0;
		for (int i = 0; i < teachers.length; i++) 
		{
			for (int j = 0; j < teachers[i].getRooms().length; j++) 
			{
				for (int k = 0; k < teachers[i].getRooms()[j].length; k++) 
				{
					if (room.equals(teachers[i].getRooms()[j][k])) 
					{
						temp++;
					}
				}
			}
		}		
		ret = new int[temp];
		temp = 0;
		for (int i = 0; i < teachers.length; i++) 
		{
			for (int j = 0; j < teachers[i].getRooms().length; j++) 
			{
				for (int k = 0; k < teachers[i].getRooms()[j].length; k++) 
				{
					if (room.equals(teachers[i].getRooms()[j][k])) 
					{
						ret[temp] = i;
						temp++;
					}
				}
			}
		}
		return ret;
	}
//------------------------------------------------------------------------------------------------	
	
	public int[] getClassStudents(String clas) {

		int[] ret;
		int temp = 0;
		for (int i = 0; i < students.length; i++) {
			if (clas.equals(students[i].getKlass())) {
				temp++;
			}
		}

		ret = new int[temp];
		temp = 0;
		for (int i = 0; i < students.length; i++) {
			if (clas.equals(students[i].getKlass())) {
				ret[temp] = i;
				temp++;

			}
		}
		return ret;

	}
	
//------------------------------
	public String[] getSubjCodes() {
		String[] subjCodes = new String[subjects.length];
		for (int i = 0; i < subjects.length; i++) {
			subjCodes[i] = subjects[i].getSubjCode();
		}

		return subjCodes;
	}

	
	public Student[] getStudents() {
		return students;
	}

	public Teacher[] getTeachers() {
		return teachers;
	}
	
	
	public int[][] getSubjBalance() {
		return subjBalance;
	}

	public int[] getSubjGroups() {
		return subjGroups;
	}

	public Subject[] getSubjects() {
		return subjects;
	}
	public Room[] getRooms() 
	{
		return rooms;
	}
	
	public String[] getGroupList() {
		return GroupList;
	}
}
