Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove PSG from SimGrid git
[simgrid.git] / contrib / psg / src / example / chord / TrafficGenerator.java
diff --git a/contrib/psg/src/example/chord/TrafficGenerator.java b/contrib/psg/src/example/chord/TrafficGenerator.java
deleted file mode 100644 (file)
index 09c5854..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/**\r
- * \r
- */\r
-package example.chord;\r
-\r
-import org.simgrid.msg.Host;\r
-\r
-import peersim.core.*;\r
-import peersim.config.Configuration;\r
-import peersim.edsim.EDSimulator;\r
-import psgsim.PSGSimulator;\r
-\r
-/**\r
- * @author Andrea\r
- * \r
- */\r
-public class TrafficGenerator implements Control {\r
-\r
-       private static final String PAR_PROT = "protocol";\r
-\r
-       private final int pid;\r
-\r
-       /**\r
-        * \r
-        */\r
-       public TrafficGenerator(String prefix) {\r
-               pid = Configuration.getPid(prefix + "." + PAR_PROT);\r
-       }\r
-\r
-       /*\r
-        * (non-Javadoc)\r
-        * \r
-        * @see peersim.core.Control#execute()\r
-        */\r
-       public boolean execute() {\r
-               int size = Network.size();\r
-               Node sender, target;\r
-               int i = 0;\r
-               do {\r
-                       i++;\r
-                       sender = Network.get(CommonState.r.nextInt(size));\r
-                       target = Network.get(CommonState.r.nextInt(size));\r
-               } while (sender == null || sender.isUp() == false || target == null\r
-                               || target.isUp() == false);\r
-               LookUpMessage message = new LookUpMessage(sender,\r
-                               ((ChordProtocol) target.getProtocol(pid)).chordId);\r
-               System.out.println("TrafficGenerator at time "+CommonState.getTime()+" Node:"\r
-                               + message.getSender().getID() +" target "+target.getID() + " pid:"\r
-                               + pid);\r
-               EDSimulator.add(10, message, sender, pid);\r
-               return false;\r
-       }\r
-\r
-}\r