Defines the Request struct representing a network request in the load balancer simulation.
Simulates a web server that receives and processes requests from the load balancer.
int id
Unique identifier for this server.
~WebServer()
Destructor. Cleans up any assigned request to prevent memory leaks.
const bool tick()
Advances the server by one clock cycle.
WebServer(int id)
Constructs a WebServer with the given ID.
int cyclesRemaining
Clock cycles remaining to finish the current request.
void assignRequest(Request *req)
Assigns a new request to this server for processing.
int getId()
Returns the server's unique ID.
Request * currRequest
Pointer to the currently assigned request, or nullptr if idle.
Represents a single network request with source/destination IPs, processing time, and job type.