Ejemplo n.º 1
0
  // Fill in weights for specific counting aggregator approaches
  //
  // Basis function 1: Count of computers running
  // Basis function 2: Count of computers running and connected to
  //                   one other running computer
  //
  // Assuming action succeeds... compute next-state value based on action,
  // choose best action.
  public Action getBasisAction() {

    int best_reboot = -1;
    double best_reboot_val = -1d;
    for (int c = 1; c <= _nVars; c++) {
      ArrayList test_state = (ArrayList) _state.clone();
      test_state.set(c - 1 + _nVars, TRUE);
      double test_val = evalBasisState(test_state, W_BASIS_1, W_BASIS_2);
      if (test_val > best_reboot_val) {
        best_reboot_val = test_val;
        best_reboot = c;
      }
    }

    return (Action) _mdp._hmName2Action.get("reboot" + best_reboot);
  }