Ejemplo n.º 1
0
  private void make(double proc_time, int size) {

    addInport("in");
    addOutport("out");

    multiServerCoord co = new multiServerCoord("MultiSco");
    add(co);

    for (int i = 1; i <= size; i++) {
      proc p = new procName("processor_" + i, proc_time);
      add(p);
      co.add_procs(p);
      p.setPreferredLocation(new Point(187, 22 + 80 * (i - 1)));
    }

    Iterator i = getComponents().iterator();
    while (i.hasNext()) {
      entity ent = (entity) i.next();
      devs comp = (devs) ent;
      if (!ent.equals(co)) {
        addCoupling(co, "y", comp, "inName"); // use name for routing
        addCoupling(comp, "outName", co, "x");
      }
    }
    addCoupling(this, "in", co, "in");
    addCoupling(co, "out", this, "out");

    initialize();

    preferredSize = new Dimension(508, 32 + 80 * size);
    co.setPreferredLocation(new Point(-7, 20));
  }
Ejemplo n.º 2
0
 public void showState() {
   super.showState();
   System.out.println("job: " + job.getName());
   System.out.println("input: " + input);
   System.out.println("sw: " + sw);
 }