Example #1
0
 public void setParameters(String name, int time, int staff, int[] dependencies) {
   this.name = name;
   this.time = time;
   this.staff = staff;
   for (int id : dependencies) {
     if (project.tasks.contains(new Task(id, project)) && (id != -1)) {
       Task tmp_t = project.getTask(new Task(id, project));
       Edge tmp_e = new Edge(tmp_t, this);
       project.addEdge(tmp_e);
       tmp_t.addEdge(tmp_e);
     } else {
       Task tmp_t = new Task(id, project);
       project.addTask(tmp_t);
       Edge tmp_e = new Edge(tmp_t, this);
       tmp_t.addEdge(tmp_e);
       project.addEdge(tmp_e);
     }
   }
 }
Example #2
0
 public void addEdge(Task v, Task w) {
   v.addEdge(new Edge(v, w));
 }