Changed logic for Unavailable

This commit is contained in:
2025-01-28 19:12:05 +01:00
parent 75b12788c8
commit 0fba0cc1fc
8 changed files with 220 additions and 87 deletions

View File

@@ -30,19 +30,6 @@ public class Event implements Comparable<Event> {
return 1;
}
/**
* Create a new event.
*
* @param node The node that the event is associated with.
* @param time The time at which the event occurs.
* @param type The type of event.
*
* @return The new event.
*/
public static Event newType(ServerNode node, double time, Type type) {
return new Event(type, node, time);
}
/**
* Create a new arrival event.
*
@@ -65,11 +52,23 @@ public class Event implements Comparable<Event> {
return new Event(Type.DEPARTURE, node, time);
}
/**
* Create a new available event.
*
* @param node The node that the event is associated with.
* @param time The time at which the event occurs.
* @return The new event.
*/
public static Event newAvailable(ServerNode node, double time) {
return new Event(Type.AVAILABLE, node, time);
}
/**
* The type of event.
*/
public static enum Type {
ARRIVAL,
DEPARTURE,
AVAILABLE,
}
}