-/* Copyright (c) 2012-2014, 2016. The SimGrid Team.
+/* Copyright (c) 2012-2019. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
}
public void mainLoop() {
- double next_lookup_time = Msg.getClock() + Common.RANDOM_LOOKUP_INTERVAL;
+ double nextLookupTime = Msg.getClock() + Common.RANDOM_LOOKUP_INTERVAL;
while (Msg.getClock() < this.deadline) {
try {
if (comm == null) {
comm = Task.irecv(Integer.toString(id));
}
if (!comm.test()) {
- if (Msg.getClock() >= next_lookup_time) {
+ if (Msg.getClock() >= nextLookupTime) {
randomLookup();
- next_lookup_time += Common.RANDOM_LOOKUP_INTERVAL;
+ nextLookupTime += Common.RANDOM_LOOKUP_INTERVAL;
} else {
waitFor(1);
}
}
}
catch (Exception e) {
+ Msg.debug("Caught exception: " + e);
}
}
Msg.info(findNodeSuccedded + "/" + (findNodeSuccedded + findNodeFailed) + " FIND_NODE have succedded.");
waitFor(1);
}
catch (Exception ex) {
+ Msg.debug("Caught exception: " + ex);
}
} while (Msg.getClock() < timeout && !destinationFound);
}
public int sendFindNodeToBest(Answer nodeList) {
int destination = nodeList.getDestinationId();
int i;
- for (i = 0; i < Common.alpha && i < nodeList.size(); i++) {
+ for (i = 0; i < Common.ALPHA && i < nodeList.size(); i++) {
Contact node = nodeList.getNodes().get(i);
if (node.getId() != this.id) {
this.sendFindNode(node.getId(),destination);