}
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);
}
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);