use of org.cpsolver.studentsct.StudentSectioningXMLSaver in project cpsolver by UniTime.
the class Test method main.
public static void main(String[] args) {
try {
System.setProperty("jprof", "cpu");
ToolBox.configureLogging();
DataProperties cfg = new DataProperties();
cfg.setProperty("Neighbour.BranchAndBoundTimeout", "5000");
cfg.setProperty("Suggestions.Timeout", "1000");
cfg.setProperty("Extensions.Classes", DistanceConflict.class.getName() + ";" + TimeOverlapsCounter.class.getName());
cfg.setProperty("StudentWeights.Class", StudentSchedulingAssistantWeights.class.getName());
cfg.setProperty("StudentWeights.PriorityWeighting", "true");
cfg.setProperty("StudentWeights.LeftoverSpread", "true");
cfg.setProperty("StudentWeights.BalancingFactor", "0.0");
cfg.setProperty("Reservation.CanAssignOverTheLimit", "true");
cfg.setProperty("Distances.Ellipsoid", DistanceMetric.Ellipsoid.WGS84.name());
cfg.setProperty("StudentWeights.MultiCriteria", "true");
cfg.setProperty("CourseRequest.SameTimePrecise", "true");
cfg.setProperty("Xml.LoadBest", "false");
cfg.setProperty("Xml.LoadCurrent", "false");
cfg.putAll(System.getProperties());
final Test test = new Test(cfg);
final File input = new File(args[0]);
StudentSectioningXMLLoader loader = new StudentSectioningXMLLoader(test.model(), test.assignment());
loader.setInputFile(input);
loader.load();
test.run();
Solver<Request, Enrollment> s = new Solver<Request, Enrollment>(cfg);
s.setInitalSolution(test.model());
StudentSectioningXMLSaver saver = new StudentSectioningXMLSaver(s);
File output = new File(input.getParentFile(), input.getName().substring(0, input.getName().lastIndexOf('.')) + "-" + cfg.getProperty("run", "r0") + ".xml");
saver.save(output);
test.stats(input);
} catch (Exception e) {
sLog.error("Test failed: " + e.getMessage(), e);
}
}
Aggregations