Example #1
0
 public void print() {
   List<String> textOutput = new ArrayList<String>();
   for (Server server : servers) {
     // TODO find the condition for an unallocated server
     if (server.getSlot() == -1) {
       textOutput.add(UNALLOCATED_SERVER);
     } else {
       StringBuilder line = new StringBuilder();
       // the allocated row(ar as ​i) and slot within the row(i) for the server, and the allocated
       // logical pool for it (a pi );
       line.append(server.getRow())
           .append(SPACE)
           .append(server.getSlot())
           .append(SPACE)
           .append(server.getPool());
       textOutput.add(line.toString());
     }
   }
   FileManager.write(textOutput, "output.txt");
   System.err.println(this.getScore());
 }