Changed logic for Unavailable
This commit is contained in:
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user