NetworkManipulationAlgorithm.java 1.3 KB

123456789101112131415161718192021222324252627282930
  1. package de.tu_darmstadt.tk.SmartHomeNetworkSim.core;
  2. import de.tu_darmstadt.tk.SmartHomeNetworkSim.control.Controller;
  3. import de.tu_darmstadt.tk.SmartHomeNetworkSim.control.NetworkController;
  4. /**
  5. * Interface for programs/algorithms/manipulations/optimizations which could run during each
  6. * simulation step. The Main Controller which is an argument is quite powerful and
  7. * allows full access to the whole model, simulation, parts of the GUI and
  8. * should be used wisely.<br>
  9. * The runAlgorithm method will be called at the end of each simulation cycle,
  10. * if imported and added to the simulation.<br>
  11. * Packets which were sent during the last simulation step can be accessed by using {@link Controller#getNetworkController()},{@link NetworkController#getLinks()},
  12. * {@link Link#getPackets()} for each link.<br>
  13. * For further accesses to the different components, check the javaDoc, or traverse the controller.
  14. *
  15. * @author Andreas T. Meyer-Berg
  16. */
  17. public interface NetworkManipulationAlgorithm {
  18. /**
  19. *
  20. * @param controller
  21. * Main controller of the framework, access to the network model,
  22. * settings, simulation etc.
  23. * @param currentTimeStep
  24. * current time in the simulation
  25. */
  26. public void runAlgorithm(Controller controller, long currentTimeStep);
  27. }