public class StudentSectioningXMLLoader extends StudentSectioningLoader
Parameter | Type | Comment |
---|---|---|
General.Input | String |
Path of an XML file to be loaded |
Xml.LoadBest | Boolean |
If true, load best assignments |
Xml.LoadInitial | Boolean |
If false, load initial assignments |
Xml.LoadCurrent | Boolean |
If true, load current assignments |
Xml.LoadOfferings | Boolean |
If true, load offerings (and their stucture, i.e., courses, configurations, subparts and sections) |
Xml.LoadStudents | Boolean |
If true, load students (and their requests) |
Xml.StudentFilter | StudentFilter |
If provided, students are filtered by the given student filter |
StudentSectioningModel model = new StudentSectioningModel(cfg);
new StudentSectioningXMLLoader(model).load();
Constructor and Description |
---|
StudentSectioningXMLLoader(StudentSectioningModel model)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
load()
Load the file
|
protected void |
load(Element root)
Load data from the given XML root
|
protected Config |
loadConfig(Element configEl,
Offering offering,
Map<Long,Subpart> subpartTable,
Map<Long,Section> sectionTable,
Map<Long,Placement> timetable)
Load config
|
protected Course |
loadCourse(Element courseEl,
Offering offering)
Load course
|
CourseRequest |
loadCourseRequest(Element requestEl,
Student student,
Map<Long,Offering> offeringTable,
Map<Long,Course> courseTable)
Load course request
|
protected Enrollment |
loadEnrollment(Element enrollmentEl,
Request request)
Load enrollment
|
FreeTimeRequest |
loadFreeTime(Element requestEl,
Student student)
Load free time request
|
protected void |
loadLinkedSectiond(Element constraintsEl,
Map<Long,Offering> offeringTable)
Load linked sections
|
protected void |
loadOfferings(Element offeringsEl,
Map<Long,Offering> offeringTable,
Map<Long,Course> courseTable,
Map<Long,Placement> timetable)
Load offerings
|
protected Request |
loadRequest(Element requestEl,
Student student,
Map<Long,Offering> offeringTable,
Map<Long,Course> courseTable)
Load request
|
protected Reservation |
loadReservation(Element reservationEl,
Offering offering,
HashMap<Long,Config> configTable,
HashMap<Long,Section> sectionTable)
Load reservation
|
protected Section |
loadSection(Element sectionEl,
Subpart subpart,
Map<Long,Section> sectionTable,
Map<Long,Placement> timetable)
Load section
|
protected Student |
loadStudent(Element studentEl)
Load student
|
protected void |
loadStudents(Element studentsEl,
Map<Long,Offering> offeringTable,
Map<Long,Course> courseTable)
Load students
|
protected Subpart |
loadSubpart(Element subpartEl,
Config config,
Map<Long,Subpart> subpartTable,
Map<Long,Section> sectionTable,
Map<Long,Placement> timetable)
Load subpart
|
protected Map<Long,Placement> |
loadTimetable(Element timetableRoot)
Load given timetable
|
protected void |
loadTravelTimes(Element travelTimesEl,
DistanceMetric metric)
Load travel times
|
void |
setInputFile(File inputFile)
Set input file (e.g., if it is not set by General.Input property)
|
void |
setLoadOfferings(boolean loadOfferings)
Set whether to load offerings
|
void |
setLoadStudents(boolean loadStudents)
Set whether to load students
|
void |
setStudentFilter(StudentFilter filter)
Set student filter
|
getModel, run, setCallback
public StudentSectioningXMLLoader(StudentSectioningModel model)
model
- student sectioning modelpublic void setInputFile(File inputFile)
public void setStudentFilter(StudentFilter filter)
public void setLoadStudents(boolean loadStudents)
public void setLoadOfferings(boolean loadOfferings)
public void load() throws Exception
load
in class StudentSectioningLoader
Exception
protected void load(Element root) throws DocumentException
root
- document rootDocumentException
protected void loadOfferings(Element offeringsEl, Map<Long,Offering> offeringTable, Map<Long,Course> courseTable, Map<Long,Placement> timetable)
offeringsEl
- offerings elementofferingTable
- offering tablecourseTable
- course tabletimetable
- provided timetable (null if to be loaded from the given document)protected Course loadCourse(Element courseEl, Offering offering)
courseEl
- course elementoffering
- parent offeringprotected Config loadConfig(Element configEl, Offering offering, Map<Long,Subpart> subpartTable, Map<Long,Section> sectionTable, Map<Long,Placement> timetable)
configEl
- config elementoffering
- parent offeringsubpartTable
- subpart table (of the offering)sectionTable
- section table (of the offering)timetable
- provided timetableprotected Subpart loadSubpart(Element subpartEl, Config config, Map<Long,Subpart> subpartTable, Map<Long,Section> sectionTable, Map<Long,Placement> timetable)
subpartEl
- supart elementconfig
- parent configsubpartTable
- subpart table (of the offering)sectionTable
- section table (of the offering)timetable
- provided timetableprotected Section loadSection(Element sectionEl, Subpart subpart, Map<Long,Section> sectionTable, Map<Long,Placement> timetable)
sectionEl
- section elementsubpart
- parent subpartsectionTable
- section table (of the offering)timetable
- provided timetableprotected Reservation loadReservation(Element reservationEl, Offering offering, HashMap<Long,Config> configTable, HashMap<Long,Section> sectionTable)
reservationEl
- reservation elementoffering
- parent offeringconfigTable
- config table (of the offering)sectionTable
- section table (of the offering)protected Map<Long,Placement> loadTimetable(Element timetableRoot)
timetableRoot
- document root in the course timetabling XML formatprotected void loadTravelTimes(Element travelTimesEl, DistanceMetric metric)
travelTimesEl
- travel-time elementmetric
- distance metric to be populatedprotected void loadLinkedSectiond(Element constraintsEl, Map<Long,Offering> offeringTable)
constraintsEl
- constraints elementofferingTable
- offering tableprotected void loadStudents(Element studentsEl, Map<Long,Offering> offeringTable, Map<Long,Course> courseTable)
studentsEl
- students elementofferingTable
- offering tablecourseTable
- course tableprotected Student loadStudent(Element studentEl)
studentEl
- student elementprotected Request loadRequest(Element requestEl, Student student, Map<Long,Offering> offeringTable, Map<Long,Course> courseTable)
requestEl
- request elementstudent
- parent studentofferingTable
- offering tablecourseTable
- course tablepublic FreeTimeRequest loadFreeTime(Element requestEl, Student student)
requestEl
- request elementstudent
- parent studentpublic CourseRequest loadCourseRequest(Element requestEl, Student student, Map<Long,Offering> offeringTable, Map<Long,Course> courseTable)
requestEl
- request elementstudent
- parent studentofferingTable
- offering tablecourseTable
- course tableprotected Enrollment loadEnrollment(Element enrollmentEl, Request request)
enrollmentEl
- enrollment element (current, best, or initial)request
- parent request