Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
reduce Java debt (endless wip)
[simgrid.git] / examples / java / app / pingpong / Receiver.java
index 7bb0d29..2617455 100644 (file)
@@ -6,7 +6,6 @@
 
 package app.pingpong;
 import org.simgrid.msg.Msg;
-import org.simgrid.msg.Host;
 import org.simgrid.msg.Task;
 import org.simgrid.msg.Process;
 import org.simgrid.msg.MsgException;
@@ -14,17 +13,13 @@ import org.simgrid.msg.NativeException;
 import org.simgrid.msg.HostNotFoundException;
 
 public class Receiver extends Process {
-  final double commSizeLat = 1;
-  final double commSizeBw = 100000000;
+  private static final double COMM_SIZE_BW = 100000000;
   public Receiver(String hostname, String name, String[]args) throws HostNotFoundException, NativeException{
     super(hostname,name,args);
   }
 
   public void main(String[] args) throws MsgException {
     Msg.info("hello!");
-    double communicationTime=0;
-
-    double time = Msg.getClock();
 
     Msg.info("try to get a task");
 
@@ -34,11 +29,11 @@ public class Receiver extends Process {
 
     Msg.info("Got at time "+ timeGot);
     Msg.info("Was sent at time "+timeSent);
-    time=timeSent;
+    double time = timeSent;
 
-    communicationTime=timeGot - time;
+    double communicationTime = timeGot - time;
     Msg.info("Communication time : " + communicationTime);
-    Msg.info(" --- bw "+ commSizeBw/communicationTime + " ----");
+    Msg.info(" --- bw "+ COMM_SIZE_BW/communicationTime + " ----");
     Msg.info("goodbye!");
   }
 }
\ No newline at end of file