TimeAndBandwidth.java 540 B

123456789101112131415161718192021222324
  1. package util;
  2. public class TimeAndBandwidth {
  3. public Bandwidth[] offline_band;
  4. public Bandwidth[] online_band;
  5. public Timer[] timer;
  6. public TimeAndBandwidth() {
  7. offline_band = new Bandwidth[P.size];
  8. online_band = new Bandwidth[P.size];
  9. timer = new Timer[P.size];
  10. for (int i = 0; i < P.size; i++) {
  11. offline_band[i] = new Bandwidth(P.names[i] + "_off");
  12. online_band[i] = new Bandwidth(P.names[i] + "_on");
  13. timer[i] = new Timer(P.names[i]);
  14. }
  15. }
  16. public void resetTime() {
  17. for (Timer t : timer)
  18. t.reset();
  19. }
  20. }