/** Call loadTasks method before this */
private void loadTaskResDemand(String filename)
throws FileNotFoundException, IOException {
try {
ResourceDemandContainer rdc = new ResourceDemandContainer(model);
StringTokenizer tokenizer = this.openFile(filename);
//ignore header fields
tokenizer.nextToken();
tokenizer.nextToken();
while (tokenizer.hasMoreTokens()) {
ResourceDemand rd = new ResourceDemand();
int id = Integer.parseInt(tokenizer.nextToken());
rd.setId(id);
int task_id = Integer.parseInt(tokenizer.nextToken());
rd.setTask(model.getTaskContainer().getTaskById(task_id));
rdc.putResourceDemand(id, rd);
model.getTaskContainer().getTaskById(task_id).putResourceDemand(rd);
}
model.setResourceDemandContainer(rdc);
}