public static void main(String args[]) {
    long start = System.currentTimeMillis();
    RegistSchedulerImproved scheduler;
    String prefix = "../regist-data/data/";
    RegistOffering offering = new RegistOffering(prefix + "CLASSES-SAMPLE");
    RegistWriteInSource wis = new RegistWriteInSource(prefix + "WRITEIN-SAMPLE");

    wis.load();
    offering.load();

    scheduler = new RegistSchedulerImproved(offering, wis.getWriteIns());
    scheduler.assign();
    long stop = System.currentTimeMillis();
    System.out.println("TimeMillis: " + (stop - start));

    Set studs = scheduler.getStudents();
    int randStud = new Random().nextInt(studs.size());
    String stdNum = (String) studs.toArray()[randStud];

    RegistScheduleExporter exporter =
        new RegistScheduleExporter(scheduler, prefix + "FORM5-SAMPLE", "2004", "SECOND");
    exporter.export();

    Statistics stat = new Statistics(scheduler);
    stat.display();

    // scheduler.validate();

    System.out.println("PL(" + stdNum + ") :" + stat.getPercentageLoad(stdNum));
    Iterator ite = scheduler.getSchedule(stdNum).getSections().iterator();
    while (ite.hasNext()) {
      Section s = (Section) ite.next();
      System.out.println(s.getSubject().getName() + " " + s.getSectionName());
    }
  }
  protected void setUp() throws Exception {
    super.setUp();
    super.setUp();

    offering = new RegistOffering(prefix + "CLASSES-2004-SECOND-CMSC");
    wis = new RegistWriteInSource(prefix + "WRITEIN-2004-SECOND-CMSC");
    wis.load();
    offering.load();
    scheduler = new RegistSchedulerImprovedMBM3(offering, wis.getWriteIns());
  }