public boolean isValidSolution() {
		
		for (Lecture lecture : environment.getLectureList()) {
			int numAssigns = 0;
			for (Assign assign : assignmentMap.values()) {
				if (assign.getLecture().equals(lecture))
					numAssigns++;
			}
			// Ensure that every lecture is assigned exactly once
			if (numAssigns > 1) {
				System.out.println(lecture.toString() + "assigned " + numAssigns + " times");
				return false;
			}
		}
		
		// Ensure that the number of students writing an exam in any room is less than or equal to the capacity of that room
		for (Assign assign : assignmentMap.values()) {
			Session session = assign.getSession();
			TreeSet<Lecture> sessionLectures = lecturesInSession.get(session);
			long numberOfStudents = 0;
			for (Lecture lecture : sessionLectures) {
				numberOfStudents += lecture.getClassSize();
			}
			if (numberOfStudents > session.getRoom().getCapacity()) {
				System.out.println(session.toString() + " has capacity of " + session.getRoom().getCapacity() + " and has " + numberOfStudents + " students");
				return false;
			}
			
		}

		
		// Ensure that every lecture's required time is less than or equal to the length of the session it is assigned to
		for (Assign assign : assignmentMap.values()) {
			Lecture lecture = assign.getLecture();
			Session session = assign.getSession();
			if (lecture.getLength() > session.getLength()) {
				System.out.println("length mismatch between " + lecture.toString() + " and " + session.toString());
				return false;
			}
		}
				
		// If we reach here, we're dealing with a valid partial solution
		return true;
	}