/** Call loadResources before this */
private void loadShifts(String filename)
throws FileNotFoundException, IOException {
try {
ShiftContainer shifts = new ShiftContainer(model);
StringTokenizer tokenizer = this.openFile(filename);
//ignore header fields
tokenizer.nextToken();
tokenizer.nextToken();
tokenizer.nextToken();
tokenizer.nextToken();
tokenizer.nextToken();
tokenizer.nextToken();
tokenizer.nextToken();
tokenizer.nextToken();
tokenizer.nextToken();
while (tokenizer.hasMoreTokens()) {
Shift shift = new Shift();
int id = Integer.parseInt(tokenizer.nextToken());
shift.setId(id);
int res_id = Integer.parseInt(tokenizer.nextToken());
shift.setResource(model.getResourceContainer().getResourceById(res_id));
int time_begin = Integer.parseInt(tokenizer.nextToken());
int time_end = Integer.parseInt(tokenizer.nextToken());
shift.setTime(new TimeInterval(time_begin, time_end));
int placeid_begin = Integer.parseInt(tokenizer.nextToken());
shift.setBeginPlace(model.getPlaceContainer().getPlaceById(placeid_begin));
int placeid_end = Integer.parseInt(tokenizer.nextToken());
shift.setEndPlace(model.getPlaceContainer().getPlaceById(placeid_end));
int overtime = Integer.parseInt(tokenizer.nextToken());
shift.setOvertime(overtime);
int overtime_cost = Integer.parseInt(tokenizer.nextToken());
shift.setOvertimeCost(overtime_cost);
int cost = Integer.parseInt(tokenizer.nextToken());
shift.setStandCost(cost);
shifts.putShift(id, shift);
model.getResourceContainer().getResourceById(res_id).putShift(id, shift);
}
model.setShiftContainer(shifts);
}