Beispiel #1
0
 /**
  * Invoke a HelloWorldApp method called sendRndMsg. First choose a random application from
  * helloClients.
  */
 private void sendRandomMessage() {
   int n = helloClients.size();
   int client = environment.getRandomSource().nextInt(n);
   HelloWorldApp app = (HelloWorldApp) helloClients.get(client);
   app.sendRndMsg(environment.getRandomSource());
 }
Beispiel #2
0
 /** Print leafsets of all nodes in pastryNodes. */
 private void printLeafSets() {
   for (int i = 0; i < pastryNodes.size(); i++) {
     PastryNode pn = (PastryNode) pastryNodes.get(i);
     System.out.println(pn.getLeafSet().toString());
   }
 }