Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Smelly code, smelly code, how are they writing you
[simgrid.git] / examples / java / app / pingpong / Receiver.java
index 7bb0d29..e4469b3 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,15 +13,14 @@ import org.simgrid.msg.NativeException;
 import org.simgrid.msg.HostNotFoundException;
 
 public class Receiver extends Process {
-  final double commSizeLat = 1;
-  final double commSizeBw = 100000000;
+  static final double commSizeLat = 1;
+  static final double commSizeBw = 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();
 
@@ -36,7 +34,7 @@ public class Receiver extends Process {
     Msg.info("Was sent at time "+timeSent);
     time=timeSent;
 
-    communicationTime=timeGot - time;
+    double communicationTime = timeGot - time;
     Msg.info("Communication time : " + communicationTime);
     Msg.info(" --- bw "+ commSizeBw/communicationTime + " ----");
     Msg.info("goodbye!");