Package jline.examples.java.advanced
Class CyclicPollingExamples
java.lang.Object
jline.examples.java.advanced.CyclicPollingExamples
Examples demonstrating cyclic polling systems.
This class provides Java implementations corresponding to the Kotlin notebooks
in jline.examples.kotlin.advanced.cyclicPolling package.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidMain method to run all cyclic polling examples.static voidDemonstrates exhaustive polling with deterministic service times (polling_exhaustive_det.ipynb).static voidDemonstrates exhaustive polling with exponential service times (polling_exhaustive_exp.ipynb).static voidDemonstrates gated polling service discipline (polling_gated.ipynb).static voidDemonstrates k-limited polling service discipline (polling_klimited.ipynb).
-
Constructor Details
-
CyclicPollingExamples
public CyclicPollingExamples()
-
-
Method Details
-
polling_exhaustive_det
Demonstrates exhaustive polling with deterministic service times (polling_exhaustive_det.ipynb). This example models a polling system where the server visits queues in cyclic order and serves all customers at a queue before moving to the next (exhaustive service). The service times are deterministic, allowing analysis of worst-case behaviors. Features: - Multiple queues with POLLING scheduling strategy - Exhaustive service discipline - Deterministic service time distributions - Cyclic server movement pattern- Throws:
Exception- if the solver encounters an error
-
polling_exhaustive_exp
Demonstrates exhaustive polling with exponential service times (polling_exhaustive_exp.ipynb). This example is similar to the deterministic case but uses exponential service times, which is more common in practice and allows for analytical approximations. The exhaustive service discipline ensures fairness by completely serving each queue. Features: - Multiple queues with POLLING scheduling strategy - Exhaustive service discipline - Exponential service time distributions - Analysis of mean waiting times and queue lengths- Throws:
Exception- if the solver encounters an error
-
polling_gated
Demonstrates gated polling service discipline (polling_gated.ipynb). In gated polling, the server only serves customers that were present when it arrived at the queue. New arrivals during service must wait for the next cycle. This provides better control over service times but may increase waiting times. Features: - Multiple queues with POLLING scheduling strategy - Gated service discipline - Comparison with exhaustive service - Analysis of cycle times and fairness- Throws:
Exception- if the solver encounters an error
-
polling_klimited
Demonstrates k-limited polling service discipline (polling_klimited.ipynb). In k-limited polling, the server serves at most k customers at each queue before moving to the next. This provides a compromise between exhaustive and 1-limited (pure cyclic) service, balancing fairness and efficiency. Features: - Multiple queues with POLLING scheduling strategy - K-limited service discipline with configurable k - Analysis of the impact of k on performance - Trade-off between fairness and efficiency- Throws:
Exception- if the solver encounters an error
-
main
Main method to run all cyclic polling examples.- Parameters:
args- command line arguments (not used)
-