Exemplo n.º 1
0
  @Override
  public void crawlFillWriteConfigurations() throws InterruptedException, IOException, Exception {
    this.openFirefox();
    this.loadWebpage();
    Thread.sleep(3000);

    for (int transferActual = 0;
        transferActual < this.transferClick;
        transferActual += (this.transferClick * this.crawlSpeed)) {
      for (int diskActual = 0;
          diskActual < this.diskClick;
          diskActual += (this.diskClick * this.crawlSpeed)) {
        for (int ramActual = 0;
            ramActual < this.ramClick;
            ramActual += (this.ramClick * this.crawlSpeed)) {
          for (int cpuActual = 0;
              cpuActual < this.cpuClick;
              cpuActual += (this.cpuClick * this.crawlSpeed)) {
            Configuration config = new Configuration(); // For linux config
            config.setProvider(this);
            config.setCpu(this.getCpu());
            config.setRam(this.getRam());
            config.setHdd(this.getDisk());
            config.setTransferSpeed(this.getTransfer());
            config.setPrice(this.getPrice());
            config.setOsUri(URI.linux);
            config.setDate(this.getDate());
            this.configurations.add(config);
            config.println();

            Configuration config2 = new Configuration(); // For windows config
            config2.setProvider(this);
            config2.setCpu(this.getCpu());
            config2.setRam(this.getRam());
            config2.setHdd(this.getDisk());
            config2.setTransferSpeed(this.getTransfer());
            config2.setPrice(this.getPrice() + this.getWindowsPrice());
            config2.setOsUri(URI.windows);
            config2.setDate(this.getDate());
            this.configurations.add(config2);
            config2.println();

            this.mooveCpu((this.cpuClick * this.crawlSpeed));
          }
          this.mooveCpu(-this.cpuClick);
          this.mooveRam((this.ramClick * this.crawlSpeed));
        }
        this.mooveRam(-this.ramClick);
        this.mooveDisk((this.diskClick * this.crawlSpeed));
      }
      this.mooveDisk(-this.diskClick);
      this.mooveTransfer((this.transferClick * this.crawlSpeed));
    }

    Thread.sleep(3000);
    this.closeFirefox();
    if (!SipsRdf.verbose) {
      System.out.println("");
    }
    this.writeConfigurationsInCsv();
  }