Beispiel #1
0
 public GenerateBottom(KochManager km, int level, Socket s) {
   this.level = level;
   this.koch = new KochFractal();
   koch.addObserver(this);
   koch.setLevel(level);
   this.km = km;
   this.socket = s;
 }
Beispiel #2
0
  @Override
  public void run() {
    try {
      LOG.log(Level.INFO, "Port: {0}", socket.getPort());

      this.out = new ObjectOutputStream(socket.getOutputStream());

      koch.generateBottomEdge();

      synchronized (this) {
        km.IncreaseCounter();
        if (km.getCounter() == 3) {
          System.out.println("Calculating finished with " + km.getAmountEdges() + " edges");
          // km.writeLockedMemMapped(level);
          System.out.println("Enter the kochlevel / q to stop : ");
          km.setCounter(0);
        }
      }

    } catch (IOException ex) {
      LOG.log(Level.SEVERE, null, ex);
    }
  }