AbstractEvent.java 703 B

12345678910111213141516171819202122232425262728293031
  1. package de.tu_darmstadt.tk.SmartHomeNetworkSim.core.scheduler;
  2. /**
  3. * Abstract Event can be used to schedule changes to the model. For example, updates of devices.
  4. *
  5. * @author Andreas T. Meyer-Berg
  6. */
  7. public abstract class AbstractEvent implements Schedulable {
  8. /**
  9. * Timestep the event takes place
  10. */
  11. private long timestep;
  12. /**
  13. * Creates an Event at the given timestep, which can be scheduled.
  14. * @param timestep timestep, the event should be scheduled
  15. */
  16. public AbstractEvent(long timestep){
  17. this.timestep = timestep;
  18. }
  19. @Override
  20. public long getEventTime(){
  21. return timestep;
  22. }
  23. @Override
  24. public abstract void simulateEvent(long time);
  25. }