Refactor Event comparison logic for clarity and add getRandomChild method to ServerNodeState for improved child selection; update simulation tests for null checks and event processing
This commit is contained in:
@@ -23,11 +23,7 @@ public class Event implements Comparable<Event> {
|
||||
|
||||
@Override
|
||||
public int compareTo(Event other) {
|
||||
if (this.time < other.time)
|
||||
return -1;
|
||||
if (this.time == other.time)
|
||||
return 0;
|
||||
return 1;
|
||||
return Double.compare(this.time, other.time);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user