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:
2025-02-19 11:06:07 +01:00
parent c2b9d350aa
commit 121d4cd44a
4 changed files with 40 additions and 14 deletions

View File

@@ -97,8 +97,13 @@ public final class Simulation {
case DEPARTURE -> {
state.updateDeparture(time);
// Spawn unavailability if has unavailable time
this.addToFel(state.spawnUnavailableIfPossible(time, this.rng));
// Spawn departure if has requests and server is available
this.addToFel(state.spawnDepartureIfPossible(time, this.rng));
// Spawn arrival to self if is source node
this.addToFel(state.spawnArrivalIfPossilbe(time));
// Spawn arrival to child node if queue is not full otherwise drop