docs: private boolean missionInit(DataInputStream din, String command, Socket socket) throws IOException {
  
          String ipOriginator = socket.getInetAddress().getHostName();
  
          int hdr;
          byte[] data;
          hdr = din.readInt();
          data = new byte[hdr];
          din.readFully(data);
          String id = new String(data, utf8);
  
          TCPUtils.Log(Level.INFO,"Mission Init" + id);
  
          String[] token = id.split(":");
          String experimentId = token[0];
          int role = Integer.parseInt(token[1]);
          int reset = Integer.parseInt(token[2]);
          int agentCount = Integer.parseInt(token[3]);
  
          port = -1;
          boolean allTokensConsumed = true;
          boolean started = false;
  
          lock.lock();
          try {
              if (role == 0) {
  
                  String previousToken = experimentId + ":0:" + (reset - 1);
                  initTokens.remove(previousToken);
  
                  String myToken = experimentId + ":0:" + reset;
                  if (!initTokens.containsKey(myToken)) {
                      TCPUtils.Log(Level.INFO,"(Pre)Start " + role + " reset " + reset);
  
                      started = startUp(command, ipOriginator, experimentId, reset, agentCount, myToken);
                      if (started)
                          initTokens.put(myToken, 0);
                  } else {
                      started = true; // Pre-started previously.
                  }
  
                  // Check that all previous tokens have been consumed. If not don't proceed to mission.
  
                  allTokensConsumed = areAllTokensConsumed(experimentId, reset, agentCount);
                  if (!allTokensConsumed) {
                      try {
                          cond.await(COND_WAIT_SECONDS, TimeUnit.SECONDS);
                      } catch (InterruptedException ie) {
                      }
                      allTokensConsumed = areAllTokensConsumed(experimentId, reset, agentCount);
                  }
              } else {
                  TCPUtils.Log(Level.INFO, "Start " + role + " reset " + reset);
  
                  started = startUp(command, ipOriginator, experimentId, reset, agentCount, experimentId + ":" + role + ":" + reset);
              }
          } finally {
              lock.unlock();
          }
  
          DataOutputStream dout = new DataOutputStream(socket.getOutputStream());
          dout.writeInt(BYTES_INT);
          dout.writeInt(allTokensConsumed && started ? 1 : 0);
          dout.flush();
  
          byte[] turnKey = "".getBytes();
          dout.writeInt(turnKey.length);
          dout.write(turnKey);
          dout.flush();
  
          return allTokensConsumed && started;
      }