Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove PSG from SimGrid git
[simgrid.git] / contrib / psg / src / psgsim / PSGProcessCycle.java
diff --git a/contrib/psg/src/psgsim/PSGProcessCycle.java b/contrib/psg/src/psgsim/PSGProcessCycle.java
deleted file mode 100644 (file)
index e0931b1..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-package psgsim;
-
-import java.util.Map.Entry;
-
-import org.simgrid.msg.Host;
-import peersim.cdsim.CDProtocol;
-import peersim.core.Node;
-import peersim.core.Protocol;
-
-/**
- * This class handle an event of type NextCycleEvent, received on the protocol
- * identified by a pid among all CDProtocols defined in the
- * {@link PSGPlatform#cdProtocolsStepMap} collection.
- * <p>
- * It executes the nextCyle method associated to this protocol.
- * 
- * @author Khaled Baati 27/10/2014
- * @version version 1.1
- */
-public class PSGProcessCycle {
-
-       /**
-        * Executes the nextCycle method of the CDprotocol with the appropriate
-        * parameters, and schedules the next call using {@link PSGSimulator#add}.
-        * 
-        * @param host
-        *            the host on which this component is run
-        * @param name
-        *            the host's name
-        * @param delay
-        *            the start time
-        * @param event
-        *            the actual event
-        * @param pid
-        *            the protocol identifier
-        */
-       public static void nextCycle(Host host, String name, double delay,
-                       Object event, int pid) {
-               CDProtocol cdp = null;
-               Node node = NodeHost.getNode(host);
-               cdp = (CDProtocol) node.getProtocol(pid);
-               cdp.nextCycle(node, pid);
-               PSGTransport.flush();
-               for (Entry<Protocol, Double> entry : PSGPlatform.cdProtocolsStepMap
-                               .entrySet()) {
-                       Double step = entry.getValue();
-                       for (Entry<Protocol, Integer> p : PSGPlatform.protocolsPidsMap
-                                       .entrySet()) {
-                               if (p.getValue() == pid) {
-                                       break;
-                               }
-                       }
-                       if (PSGPlatform.getTime() <= PSGPlatform.getDuration() && host.isOn()) {
-                               PSGSimulator.add(PSGPlatform.sgToPsTime(step), event, node, pid);
-                       }
-               }
-       }
-
-}