public Agent(StateObservation stateObs, ElapsedCpuTimer elapsedTimer) {
    k = 80;
    fileName = "bigFile.txt";
    maxValues = null;
    tuples = new ArrayList<Tuple>();

    tools.IO input = new tools.IO();
    String[] lines = input.readFile(fileName);
    for (int i = 0; i < lines.length; i++) {
      Tuple t = new Tuple(lines[i]);
      if (maxValues == null) {
        maxValues = new double[t.values.size()];
      }
      tuples.add(t);
      for (int j = 0; j < t.values.size(); j++) {
        if (maxValues[j] < t.values.get(j)) {
          maxValues[j] = t.values.get(j);
        }
      }
    }

    for (int i = 0; i < maxValues.length; i++) {
      if (maxValues[i] <= 0) {
        maxValues[i] = 1;
      }
    }

    for (int i = 0; i < tuples.size(); i++) {
      tuples.get(i).normalize(maxValues);
    }
  }
Пример #2
0
  public void close() {
    try {
      connexion.close();
      IO.trace("Connexion du joueur " + this.username + " viens d'etre fermé");
      // TODO Trace. (faire un level d'importance?)

    } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }