QCloudSched
A Python-native cloud computing simulation framework inspired by Java CloudSim.
QCloudSched provides a discrete-event simulation environment for modelling and evaluating cloud infrastructures, resource allocation strategies, scheduling algorithms, energy-aware policies, and virtual machine management.
Features
- Discrete-event simulation engine with a priority-queue event loop
- Datacenters, Hosts, VMs, and Cloudlets — the full CloudSim entity hierarchy
- Pluggable scheduling algorithms — Round Robin, Min-Min, Genetic Algorithm, QAOA, Quantum Walk, Quantum Annealing, and more
- Metrics collection — makespan, throughput, utilisation, energy, cost, SLA violations
- Export — CSV, JSON, and Matplotlib plots
- Rich terminal output — colour-coded logs, metrics tables, validation checks, and cloudlet execution tables (themed output like the screenshot)
srclayout — all library code lives undersrc/cloudsim/
Requirements
- Python 3.10+
rich— terminal outputmatplotlib— plot generationpytest— unit testing
Installation
# 1. Clone the repository
git clone https://github.com/goutam-tech/qcloudsched.git
cd qcloudsched
# 2. Create and activate a virtual environment
python -m venv .venv
source .venv/bin/activate # macOS/Linux
.venv\Scripts\activate # Windows
# 3. Install the library in editable mode
pip install -e .
# 4. (Optional) dev tooling
pip install -e .[dev]
Quick Start
from cloudsim import CloudSimulation, print_simulation_summary
from cloudsim.algorithms.scheduling import RoundRobinScheduler, MinMinScheduler
# Build a simulation from JSON dataset files
sim = CloudSimulation.from_files(
hosts="datasets/hosts/hosts.json",
vms="datasets/vms/vms.json",
cloudlets="datasets/cloudlets/cloudlets_100.json",
scheduler=RoundRobinScheduler(),
)
# Run and collect metrics
import time
wall_start = time.perf_counter()
metrics = sim.run()
wall_elapsed = time.perf_counter() - wall_start
# Themed output (banner + metrics table + validation checks + cloudlet table)
print_simulation_summary(
metrics=metrics,
cloudlets=sim.cloudlets,
vms=sim.vms,
wall_time=wall_elapsed,
sim_time=sim.simulation.clock.now(),
events=sim.simulation.total_events_processed,
)
Or use the command line:
qcloudsched info
qcloudsched version
Themed Output
QCloudSched includes a built-in Rich-powered logger so every simulation run produces professional, colour-coded terminal output:
from cloudsim import (
print_banner,
print_metrics_table,
print_validation_checks,
print_cloudlet_table,
print_simulation_summary,
info,
success,
warning,
error,
metric,
make_progress,
)
The print_simulation_summary() helper renders everything in one call:
a banner panel, a metrics summary table, validation checks (completion,
per-VM CPU utilisation, SLA violations), and a cloudlet execution table.
Project Structure
qcloudsched/
├── src/
│ └── cloudsim/ # Library package (everything lives here)
│ ├── __init__.py # Public API exports
│ ├── core/ # Simulation engine, clock, events, entities
│ ├── simulation/ # High-level CloudSimulation interface
│ ├── cloudlets/ # Cloudlet, TaskLoader
│ ├── vms/ # VM, VMLoader
│ ├── hosts/ # Host, HostLoader
│ ├── datacenters/ # Datacenter, Broker, DatacenterCharacteristics
│ ├── schedulers/ # CloudletScheduler, VMScheduler, built-in policies
│ ├── algorithms/ # Pluggable scheduling algorithms
│ │ ├── scheduling/ # RoundRobin, MinMin, GA, QAOA, QW, QA, …
│ │ ├── power/
│ │ ├── vm_allocation/
│ │ └── migration/
│ ├── provisioners/ # CPU, RAM, BW provisioners
│ ├── metrics/ # SimulationMetrics, MetricsCollector
│ ├── network/ # Network model
│ ├── utils/ # Rich-powered logger
│ └── cli/ # Command-line interface
├── tests/ # pytest unit + integration tests
├── datasets/ # Sample JSON input files
├── experiments/ # Example experiment scripts
├── results/ # Generated CSV, JSON, and plots
├── pyproject.toml # Packaging + tool configuration
├── pytest.ini # Pytest configuration
├── requirements.txt # Runtime dependencies
└── README.md
Writing a Custom Algorithm
- Create a file under
src/cloudsim/algorithms/scheduling/my_algorithm.py. - Subclass
CloudletSchedulerfromcloudsim.schedulers. - Implement
submit_cloudlets,get_next_cloudlet, andis_finished. - Pass an instance to
CloudSimulation.from_files(..., scheduler=MyAlgorithm()).
from cloudsim.schedulers import CloudletScheduler
class PriorityScheduler(CloudletScheduler):
def submit_cloudlets(self, cloudlets, vms):
sorted_cl = sorted(cloudlets, key=lambda c: c.priority)
for idx, cl in enumerate(sorted_cl):
cl.assigned_vm_id = vms[idx % len(vms)].vm_id
cl.state = "QUEUED"
...
Exported Results
After running an experiment, results are written to:
| Path | Contents |
|---|---|
results/csv/cloudlets.csv |
Per-cloudlet timing metrics |
results/csv/summary.csv |
Aggregated metrics |
results/json/cloudlets.json |
Per-cloudlet results in JSON |
results/json/summary.json |
Aggregated metrics in JSON |
results/plots/exec_time_hist.png |
Execution time distribution |
results/plots/vm_load.png |
Cloudlet distribution per VM |
results/plots/gantt.png |
Cloudlet execution timeline (Gantt) |
Running Tests
pytest tests/ -v --tb=short
pytest tests/ --cov=cloudsim --cov-report=term-missing
License
MIT License.
Metadata
Release files for qcloudsched 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| qcloudsched-1.0.1.tar.gz | 52.6 kB | With provenance | Details for qcloudsched-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| qcloudsched-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for qcloudsched-1.0.1-py3-none-any.whl |
Total release size: 124.1 kB
Release files / qcloudsched-1.0.1.tar.gz
| Download URL | qcloudsched-1.0.1.tar.gz |
|---|---|
| Size | 52.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0ac95efc92c54fd1a58b9a22008274d93696bb355558fca7a2ba5b48d512a1cc
|
|
BLAKE2b-256 checksum How to use checksums |
733aae258c6d0355ab842a2bd5c568c5c0be66617aba26d928d75bad5ca043ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logRelease files / qcloudsched-1.0.1-py3-none-any.whl
| Download URL | qcloudsched-1.0.1-py3-none-any.whl |
|---|---|
| Size | 71.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a7a2aecd7a5132d7367f245d5c9858e24a784ccb2e9ee82f6723beea6e9fa05e
|
|
BLAKE2b-256 checksum How to use checksums |
e777046cfa91c7f6b9ae7f5df847891e54e52f1d073b6c1630e46a4d8420453d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logSecurity for qcloudsched 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for qcloudsched-1.0.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.