Package hu.u_szeged.nbo.res_alloc.model.container

Examples of hu.u_szeged.nbo.res_alloc.model.container.TaskContainer


  }
 
  private void loadTasks(String filename)
  throws FileNotFoundException, IOException {
    try {
      TaskContainer tasks = new TaskContainer(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();
     
      while (tokenizer.hasMoreTokens()) {
        Task task = new Task();
        int id = Integer.parseInt(tokenizer.nextToken());
        task.setId(id);
        int place_id = Integer.parseInt(tokenizer.nextToken());
        task.setPlace(model.getPlaceContainer().getPlaceById(place_id));
        int normtime = Integer.parseInt(tokenizer.nextToken());
        task.setNormTime(normtime);
        int tp1 = Integer.parseInt(tokenizer.nextToken());
        int tp2 = Integer.parseInt(tokenizer.nextToken());
        task.setPrefferedTimeInterval(new TimeInterval(tp1, tp2));
        int ck1 = Integer.parseInt(tokenizer.nextToken());
        task.setDCost1(ck1);
        int ck2 = Integer.parseInt(tokenizer.nextToken());
        task.setDCost2(ck2);
        int ck3 = Integer.parseInt(tokenizer.nextToken());
        task.setDCost3(ck3);
       
        tasks.putTask(id, task);
      }
     
      model.setTaskContainer(tasks);
    }
    catch (FileNotFoundException e) {
View Full Code Here

TOP

Related Classes of hu.u_szeged.nbo.res_alloc.model.container.TaskContainer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.