awraf-toolkit


Nameawraf-toolkit JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/afrilab/awraf
SummaryAdaptive Weight-Based Resource Allocation Framework for 6G IoT with THz Links and Intelligent Surfaces
upload_time2025-08-25 17:22:01
maintainerNone
docs_urlNone
authorKushagra Agrawal, Ferheen Ayaz, Polat Goktas
requires_python>=3.7
licenseNone
keywords iot 6g resource-allocation edge-computing thz irs machine-learning reinforcement-learning optimization simulation wireless-networks federated-learning
VCS
bugtrack_url
requirements numpy matplotlib pandas seaborn scipy tabulate
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # AWRAF Toolkit: Adaptive Weight-Based Resource Allocation Framework for 6G IoT

[![Python 3.7+](https://img.shields.io/badge/python-3.7+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![PyPI version](https://badge.fury.io/py/awraf-toolkit.svg)](https://badge.fury.io/py/awraf-toolkit)

A comprehensive Python toolkit for the **Adaptive Weight-Based Resource Allocation Framework (AWRAF)**, designed for dynamic resource management in 6G IoT environments with Terahertz (THz) links and Intelligent Reflecting Surfaces (IRS).

## ๐Ÿš€ Features

- **Realistic 6G Scenarios**: Smart Healthcare (IRS-THz), Smart Transportation (V2X-THz), and Baseline IoT environments
- **Adaptive Resource Allocation**: Dynamic adjustment of allocation weights based on real-time system conditions
- **Multiple Algorithms**: AWRAF (Dynamic/Static), Greedy, and Reinforcement Learning baselines
- **Statistical Validation**: Comprehensive performance analysis with confidence intervals and t-tests
- **Scalability Analysis**: Performance evaluation under varying device and server loads
- **Command-Line Interface**: Easy-to-use CLI for quick simulations without coding
- **Modern Python**: Type hints, dataclasses, and clean architecture

## ๐Ÿ“ฆ Installation

### From PyPI (Recommended)
```bash
pip install awraf-toolkit
```

### From Source
```bash
git clone https://github.com/afrilab/awraf.git
cd awraf
pip install -e .
```

## ๐ŸŽฏ Quick Start

### **Option 1: Command Line (Easiest)**

Run simulations directly from the command line:

```bash
# Install the package
pip install awraf-toolkit

# Quick demo
awraf-sim --demo

# Custom simulation
awraf-sim --scenarios "SMART_HEALTHCARE:50:10" --algorithms "AWRAF_DYNAMIC,GREEDY" --trials 30
```

### **Option 2: Python API**

Use the Python interface for more control:

```python
import numpy as np
from awraf import AWRAFSimulator, ScenarioType, AlgorithmType
from awraf import run_statistical_analysis, analyze_and_plot, print_summary_table

# Set random seeds for reproducibility
np.random.seed(42)

# Define your simulation parameters
scenarios = [
    (ScenarioType.SMART_HEALTHCARE, 50, 10),
    (ScenarioType.SMART_TRANSPORTATION, 60, 12),
    (ScenarioType.BASELINE_IOT, 40, 10)
]

algorithms = [
    AlgorithmType.AWRAF_DYNAMIC,
    AlgorithmType.AWRAF_STATIC,
    AlgorithmType.GREEDY,
    AlgorithmType.RL_BASED
]

# Run comprehensive analysis
results = run_statistical_analysis(scenarios, algorithms, num_trials=30)
aggregated = analyze_and_plot(results, scenarios)
print_summary_table(aggregated, results)
```

## ๐Ÿ“š API Reference

### Core Classes

| Class | Description | Key Methods |
|-------|-------------|-------------|
| `AWRAFSimulator` | Main simulation engine for resource allocation | `run_simulation(max_iterations=100)` |
| `IoTDevice` | Represents IoT devices with 6G characteristics | Data class with device properties |
| `EdgeServer` | Represents edge servers with 6G capabilities | Data class with server properties |
| `ScenarioGenerator` | Generates realistic IoT scenarios | `generate_scenario()` |
| `RLAgent` | Q-learning agent for reinforcement learning | `choose_action(state)`, `update_q_table(...)` |

### Enums

| Enum | Values | Description |
|------|--------|-------------|
| `ScenarioType` | `SMART_HEALTHCARE`, `SMART_TRANSPORTATION`, `BASELINE_IOT` | Available IoT scenarios |
| `AlgorithmType` | `AWRAF_DYNAMIC`, `AWRAF_STATIC`, `GREEDY`, `RL_BASED` | Resource allocation algorithms |

### Main Functions

| Function | Parameters | Returns | Description |
|----------|------------|---------|-------------|
| `run_statistical_analysis(scenarios, algorithms, num_trials=30)` | `scenarios`: List of (ScenarioType, devices, servers)<br>`algorithms`: List of AlgorithmType<br>`num_trials`: Number of simulation runs | `pandas.DataFrame` | Runs multiple simulation trials for statistical validation |
| `analyze_and_plot(df_stats, scenarios_config)` | `df_stats`: Statistical results DataFrame<br>`scenarios_config`: Scenarios configuration | `pandas.DataFrame` | Creates comprehensive plots and returns aggregated results |
| `print_summary_table(df_agg, df_stats)` | `df_agg`: Aggregated results<br>`df_stats`: Statistical results | `None` | Prints formatted performance comparison table |

### Data Models

#### IoTDevice Attributes
- `device_id`: Unique identifier
- `task_size`: Computational task size
- `latency_tolerance`: Maximum acceptable latency
- `energy_constraint`: Energy consumption limit
- `device_type`: Type of IoT device
- `scenario`: Associated scenario type
- `mobility_speed`: Device movement speed
- `federated_learning_capable`: FL support flag
- `thz_frequency`: THz frequency band
- `data_to_upload`: Data size for uplink
- `model_size_downlink`: Model size for downlink

#### EdgeServer Attributes
- `server_id`: Unique identifier
- `computational_capacity`: Processing power
- `bandwidth`: Network bandwidth
- `energy_capacity`: Energy storage
- `server_type`: Type of edge server
- `irs_elements`: Number of IRS elements
- `thz_bandwidth`: THz bandwidth capacity
- `supports_federated_learning`: FL support flag
- `current_load`: Current computational load
- `allocated_devices`: List of assigned devices

## ๐Ÿ”ฌ Usage Examples

### Basic Simulation
```python
from awraf import AWRAFSimulator, ScenarioType, AlgorithmType

# Create simulator for healthcare scenario
sim = AWRAFSimulator(
    scenario_type=ScenarioType.SMART_HEALTHCARE,
    algorithm=AlgorithmType.AWRAF_DYNAMIC,
    num_devices=50,
    num_servers=10
)

# Run simulation
history = sim.run_simulation(max_iterations=100)

# Access results
print(f"Average device utility: {np.mean(history['device_utility']):.3f}")
print(f"Success rate: {history['allocation_success_rate'][-1]*100:.1f}%")
```

### Custom Scenario Analysis
```python
from awraf import run_statistical_analysis, ScenarioType, AlgorithmType

# Define custom scenarios
custom_scenarios = [
    (ScenarioType.SMART_HEALTHCARE, 100, 20),    # 100 devices, 20 servers
    (ScenarioType.SMART_TRANSPORTATION, 200, 40), # 200 devices, 40 servers
]

# Compare algorithms
algorithms = [AlgorithmType.AWRAF_DYNAMIC, AlgorithmType.GREEDY]

# Run analysis with 50 trials
results = run_statistical_analysis(custom_scenarios, algorithms, num_trials=50)
```

### Performance Comparison
```python
from awraf import analyze_and_plot, print_summary_table

# Analyze and visualize results
aggregated = analyze_and_plot(results, custom_scenarios)

# Print comprehensive summary
print_summary_table(aggregated, results)
```

## ๐Ÿ“Š Output Analysis

The toolkit provides comprehensive analysis including:

- **Device Utility**: Normalized utility scores with confidence intervals
- **Server Load**: Load balancing efficiency across edge servers
- **Allocation Success Rate**: Percentage of successful resource allocations
- **Communication Delay**: Network latency analysis
- **Scalability**: Performance under varying device/server ratios
- **Statistical Significance**: T-test results comparing algorithms

## ๐Ÿ—๏ธ Project Structure

```
awraf-toolkit/
โ”œโ”€โ”€ awraf/                    # Main package
โ”‚   โ”œโ”€โ”€ __init__.py          # Package initialization
โ”‚   โ”œโ”€โ”€ simulator.py         # Core simulation engine
โ”‚   โ”œโ”€โ”€ models.py            # Data models (IoTDevice, EdgeServer)
โ”‚   โ”œโ”€โ”€ enums.py             # Enums for scenarios and algorithms
โ”‚   โ”œโ”€โ”€ scenario.py          # Scenario generation
โ”‚   โ”œโ”€โ”€ algorithm.py         # RL agent implementation
โ”‚   โ””โ”€โ”€ utils.py             # Analysis and plotting utilities
โ”œโ”€โ”€ examples/                 # Usage examples
โ”‚   โ””โ”€โ”€ run_simulation.py    # Complete simulation example
โ”œโ”€โ”€ tests/                    # Unit tests
โ”œโ”€โ”€ README.md                 # This file
โ”œโ”€โ”€ setup.py                  # Package configuration
โ””โ”€โ”€ requirements.txt          # Dependencies
```

## ๐Ÿ–ฅ๏ธ Command-Line Interface (CLI)

The AWRAF Toolkit includes a powerful command-line interface that makes it easy to run simulations without writing Python code.

### **Installation & Usage**

After installing the package, you'll have access to the `awraf-sim` command:

```bash
# Install the package
pip install awraf-toolkit

# Check if CLI is available
awraf-sim --help
```

### **Quick Demo**

Run a quick demonstration with default scenarios:

```bash
awraf-sim --demo
```

This runs a 10-trial simulation with:
- Smart Healthcare: 30 devices, 6 servers
- Smart Transportation: 40 devices, 8 servers  
- Baseline IoT: 25 devices, 5 servers
- Algorithms: AWRAF Dynamic vs Greedy

### **Custom Simulations**

#### **Basic Single Scenario**
```bash
awraf-sim --scenarios "SMART_HEALTHCARE:50:10" --algorithms "AWRAF_DYNAMIC"
```

#### **Multiple Scenarios & Algorithms**
```bash
awraf-sim --scenarios "SMART_HEALTHCARE:50:10,SMART_TRANSPORTATION:60:12" --algorithms "AWRAF_DYNAMIC,GREEDY" --trials 50
```

#### **With Custom Random Seed**
```bash
awraf-sim --scenarios "BASELINE_IOT:100:20" --algorithms "AWRAF_DYNAMIC,RL_BASED" --trials 100 --seed 42
```

### **CLI Parameters**

| Parameter | Description | Example | Default |
|-----------|-------------|---------|---------|
| `--scenarios` | Comma-separated scenarios in format "scenario:devices:servers" | `"SMART_HEALTHCARE:50:10"` | Required |
| `--algorithms` | Comma-separated algorithms to compare | `"AWRAF_DYNAMIC,GREEDY"` | Required |
| `--trials` | Number of simulation trials | `50` | `30` |
| `--demo` | Run demo with default settings | `--demo` | False |
| `--seed` | Random seed for reproducibility | `42` | Random |

### **Available Scenarios**
- `SMART_HEALTHCARE`: Healthcare IoT with IRS-THz capabilities
- `SMART_TRANSPORTATION`: V2X transportation with THz links
- `BASELINE_IOT`: Standard IoT environment

### **Available Algorithms**
- `AWRAF_DYNAMIC`: AWRAF with adaptive weights
- `AWRAF_STATIC`: AWRAF with fixed weights
- `GREEDY`: Greedy resource allocation
- `RL_BASED`: Reinforcement learning approach

### **CLI Output**

The CLI provides:
- ๐Ÿ“Š **Configuration Summary**: Shows selected scenarios, algorithms, and trials
- โณ **Progress Updates**: Real-time trial progress
- ๐Ÿ“ˆ **Statistical Analysis**: T-test results and performance metrics
- ๐ŸŽจ **Visualization**: Comprehensive plots and charts
- ๐Ÿ“‹ **Summary Table**: Formatted performance comparison

### **Example CLI Session**

```bash
$ awraf-sim --scenarios "SMART_HEALTHCARE:40:8" --algorithms "AWRAF_DYNAMIC,GREEDY" --trials 20

๐Ÿš€ Running AWRAF Toolkit Demo...
๐Ÿ“Š Scenarios: ['SMART_HEALTHCARE(40 devices, 8 servers)']
๐Ÿ”ง Algorithms: ['AWRAF_DYNAMIC', 'GREEDY']
๐Ÿ”„ Trials: 20

โณ Running statistical analysis...
Running Statistical Validation (20 trials)...
  Trial 1/20...
  Trial 2/20...
  [...]
  Trial 20/20...

๐Ÿ“ˆ Generating plots and analysis...
--- T-Test Results (p-value for Device Utility) ---
Scenario: Smart Healthcare (IRS-THz)
  vs Greedy Allocation: p-value = 0.0234 (Significant Improvement)

๐Ÿ“‹ Printing summary table...
[Comprehensive performance summary table]

โœ… Analysis complete!
```

## ๐Ÿงช Testing

Run the test suite to ensure everything works correctly:

```bash
# Install in development mode
pip install -e .

# Run tests
python -m pytest tests/ -v

# Run example
python examples/run_simulation.py

# Test CLI
awraf-sim --demo
```

## ๐Ÿ“‹ Requirements

- Python 3.7+
- numpy
- matplotlib
- pandas
- seaborn
- scipy
- tabulate

## ๐Ÿค Contributing

We welcome contributions! Please feel free to:

1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests for new functionality
5. Submit a pull request

## ๐Ÿ“„ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## ๐Ÿ“– Citation

If you use this toolkit in your research, please cite:

```bibtex
@article{awraf2024,
  title={AWRAF: An Energy-Aware Adaptive Weight-Based Resource Allocation Framework for IoT with THz Links and Intelligent Surfaces},
  author={Agrawal, Kushagra and Ayaz, Ferheen and Goktas, Polat},
  journal={arXiv preprint},
  year={2024}
}
```



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/afrilab/awraf",
    "name": "awraf-toolkit",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "iot, 6g, resource-allocation, edge-computing, thz, irs, machine-learning, reinforcement-learning, optimization, simulation, wireless-networks, federated-learning",
    "author": "Kushagra Agrawal, Ferheen Ayaz, Polat Goktas",
    "author_email": "kush4409@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/fd/0f/6111ef3c23a7cf41d67a57316cf87e0230ace71644eab1df1cc9662c1a7f/awraf_toolkit-0.1.0.tar.gz",
    "platform": null,
    "description": "# AWRAF Toolkit: Adaptive Weight-Based Resource Allocation Framework for 6G IoT\r\n\r\n[![Python 3.7+](https://img.shields.io/badge/python-3.7+-blue.svg)](https://www.python.org/downloads/)\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\r\n[![PyPI version](https://badge.fury.io/py/awraf-toolkit.svg)](https://badge.fury.io/py/awraf-toolkit)\r\n\r\nA comprehensive Python toolkit for the **Adaptive Weight-Based Resource Allocation Framework (AWRAF)**, designed for dynamic resource management in 6G IoT environments with Terahertz (THz) links and Intelligent Reflecting Surfaces (IRS).\r\n\r\n## \ud83d\ude80 Features\r\n\r\n- **Realistic 6G Scenarios**: Smart Healthcare (IRS-THz), Smart Transportation (V2X-THz), and Baseline IoT environments\r\n- **Adaptive Resource Allocation**: Dynamic adjustment of allocation weights based on real-time system conditions\r\n- **Multiple Algorithms**: AWRAF (Dynamic/Static), Greedy, and Reinforcement Learning baselines\r\n- **Statistical Validation**: Comprehensive performance analysis with confidence intervals and t-tests\r\n- **Scalability Analysis**: Performance evaluation under varying device and server loads\r\n- **Command-Line Interface**: Easy-to-use CLI for quick simulations without coding\r\n- **Modern Python**: Type hints, dataclasses, and clean architecture\r\n\r\n## \ud83d\udce6 Installation\r\n\r\n### From PyPI (Recommended)\r\n```bash\r\npip install awraf-toolkit\r\n```\r\n\r\n### From Source\r\n```bash\r\ngit clone https://github.com/afrilab/awraf.git\r\ncd awraf\r\npip install -e .\r\n```\r\n\r\n## \ud83c\udfaf Quick Start\r\n\r\n### **Option 1: Command Line (Easiest)**\r\n\r\nRun simulations directly from the command line:\r\n\r\n```bash\r\n# Install the package\r\npip install awraf-toolkit\r\n\r\n# Quick demo\r\nawraf-sim --demo\r\n\r\n# Custom simulation\r\nawraf-sim --scenarios \"SMART_HEALTHCARE:50:10\" --algorithms \"AWRAF_DYNAMIC,GREEDY\" --trials 30\r\n```\r\n\r\n### **Option 2: Python API**\r\n\r\nUse the Python interface for more control:\r\n\r\n```python\r\nimport numpy as np\r\nfrom awraf import AWRAFSimulator, ScenarioType, AlgorithmType\r\nfrom awraf import run_statistical_analysis, analyze_and_plot, print_summary_table\r\n\r\n# Set random seeds for reproducibility\r\nnp.random.seed(42)\r\n\r\n# Define your simulation parameters\r\nscenarios = [\r\n    (ScenarioType.SMART_HEALTHCARE, 50, 10),\r\n    (ScenarioType.SMART_TRANSPORTATION, 60, 12),\r\n    (ScenarioType.BASELINE_IOT, 40, 10)\r\n]\r\n\r\nalgorithms = [\r\n    AlgorithmType.AWRAF_DYNAMIC,\r\n    AlgorithmType.AWRAF_STATIC,\r\n    AlgorithmType.GREEDY,\r\n    AlgorithmType.RL_BASED\r\n]\r\n\r\n# Run comprehensive analysis\r\nresults = run_statistical_analysis(scenarios, algorithms, num_trials=30)\r\naggregated = analyze_and_plot(results, scenarios)\r\nprint_summary_table(aggregated, results)\r\n```\r\n\r\n## \ud83d\udcda API Reference\r\n\r\n### Core Classes\r\n\r\n| Class | Description | Key Methods |\r\n|-------|-------------|-------------|\r\n| `AWRAFSimulator` | Main simulation engine for resource allocation | `run_simulation(max_iterations=100)` |\r\n| `IoTDevice` | Represents IoT devices with 6G characteristics | Data class with device properties |\r\n| `EdgeServer` | Represents edge servers with 6G capabilities | Data class with server properties |\r\n| `ScenarioGenerator` | Generates realistic IoT scenarios | `generate_scenario()` |\r\n| `RLAgent` | Q-learning agent for reinforcement learning | `choose_action(state)`, `update_q_table(...)` |\r\n\r\n### Enums\r\n\r\n| Enum | Values | Description |\r\n|------|--------|-------------|\r\n| `ScenarioType` | `SMART_HEALTHCARE`, `SMART_TRANSPORTATION`, `BASELINE_IOT` | Available IoT scenarios |\r\n| `AlgorithmType` | `AWRAF_DYNAMIC`, `AWRAF_STATIC`, `GREEDY`, `RL_BASED` | Resource allocation algorithms |\r\n\r\n### Main Functions\r\n\r\n| Function | Parameters | Returns | Description |\r\n|----------|------------|---------|-------------|\r\n| `run_statistical_analysis(scenarios, algorithms, num_trials=30)` | `scenarios`: List of (ScenarioType, devices, servers)<br>`algorithms`: List of AlgorithmType<br>`num_trials`: Number of simulation runs | `pandas.DataFrame` | Runs multiple simulation trials for statistical validation |\r\n| `analyze_and_plot(df_stats, scenarios_config)` | `df_stats`: Statistical results DataFrame<br>`scenarios_config`: Scenarios configuration | `pandas.DataFrame` | Creates comprehensive plots and returns aggregated results |\r\n| `print_summary_table(df_agg, df_stats)` | `df_agg`: Aggregated results<br>`df_stats`: Statistical results | `None` | Prints formatted performance comparison table |\r\n\r\n### Data Models\r\n\r\n#### IoTDevice Attributes\r\n- `device_id`: Unique identifier\r\n- `task_size`: Computational task size\r\n- `latency_tolerance`: Maximum acceptable latency\r\n- `energy_constraint`: Energy consumption limit\r\n- `device_type`: Type of IoT device\r\n- `scenario`: Associated scenario type\r\n- `mobility_speed`: Device movement speed\r\n- `federated_learning_capable`: FL support flag\r\n- `thz_frequency`: THz frequency band\r\n- `data_to_upload`: Data size for uplink\r\n- `model_size_downlink`: Model size for downlink\r\n\r\n#### EdgeServer Attributes\r\n- `server_id`: Unique identifier\r\n- `computational_capacity`: Processing power\r\n- `bandwidth`: Network bandwidth\r\n- `energy_capacity`: Energy storage\r\n- `server_type`: Type of edge server\r\n- `irs_elements`: Number of IRS elements\r\n- `thz_bandwidth`: THz bandwidth capacity\r\n- `supports_federated_learning`: FL support flag\r\n- `current_load`: Current computational load\r\n- `allocated_devices`: List of assigned devices\r\n\r\n## \ud83d\udd2c Usage Examples\r\n\r\n### Basic Simulation\r\n```python\r\nfrom awraf import AWRAFSimulator, ScenarioType, AlgorithmType\r\n\r\n# Create simulator for healthcare scenario\r\nsim = AWRAFSimulator(\r\n    scenario_type=ScenarioType.SMART_HEALTHCARE,\r\n    algorithm=AlgorithmType.AWRAF_DYNAMIC,\r\n    num_devices=50,\r\n    num_servers=10\r\n)\r\n\r\n# Run simulation\r\nhistory = sim.run_simulation(max_iterations=100)\r\n\r\n# Access results\r\nprint(f\"Average device utility: {np.mean(history['device_utility']):.3f}\")\r\nprint(f\"Success rate: {history['allocation_success_rate'][-1]*100:.1f}%\")\r\n```\r\n\r\n### Custom Scenario Analysis\r\n```python\r\nfrom awraf import run_statistical_analysis, ScenarioType, AlgorithmType\r\n\r\n# Define custom scenarios\r\ncustom_scenarios = [\r\n    (ScenarioType.SMART_HEALTHCARE, 100, 20),    # 100 devices, 20 servers\r\n    (ScenarioType.SMART_TRANSPORTATION, 200, 40), # 200 devices, 40 servers\r\n]\r\n\r\n# Compare algorithms\r\nalgorithms = [AlgorithmType.AWRAF_DYNAMIC, AlgorithmType.GREEDY]\r\n\r\n# Run analysis with 50 trials\r\nresults = run_statistical_analysis(custom_scenarios, algorithms, num_trials=50)\r\n```\r\n\r\n### Performance Comparison\r\n```python\r\nfrom awraf import analyze_and_plot, print_summary_table\r\n\r\n# Analyze and visualize results\r\naggregated = analyze_and_plot(results, custom_scenarios)\r\n\r\n# Print comprehensive summary\r\nprint_summary_table(aggregated, results)\r\n```\r\n\r\n## \ud83d\udcca Output Analysis\r\n\r\nThe toolkit provides comprehensive analysis including:\r\n\r\n- **Device Utility**: Normalized utility scores with confidence intervals\r\n- **Server Load**: Load balancing efficiency across edge servers\r\n- **Allocation Success Rate**: Percentage of successful resource allocations\r\n- **Communication Delay**: Network latency analysis\r\n- **Scalability**: Performance under varying device/server ratios\r\n- **Statistical Significance**: T-test results comparing algorithms\r\n\r\n## \ud83c\udfd7\ufe0f Project Structure\r\n\r\n```\r\nawraf-toolkit/\r\n\u251c\u2500\u2500 awraf/                    # Main package\r\n\u2502   \u251c\u2500\u2500 __init__.py          # Package initialization\r\n\u2502   \u251c\u2500\u2500 simulator.py         # Core simulation engine\r\n\u2502   \u251c\u2500\u2500 models.py            # Data models (IoTDevice, EdgeServer)\r\n\u2502   \u251c\u2500\u2500 enums.py             # Enums for scenarios and algorithms\r\n\u2502   \u251c\u2500\u2500 scenario.py          # Scenario generation\r\n\u2502   \u251c\u2500\u2500 algorithm.py         # RL agent implementation\r\n\u2502   \u2514\u2500\u2500 utils.py             # Analysis and plotting utilities\r\n\u251c\u2500\u2500 examples/                 # Usage examples\r\n\u2502   \u2514\u2500\u2500 run_simulation.py    # Complete simulation example\r\n\u251c\u2500\u2500 tests/                    # Unit tests\r\n\u251c\u2500\u2500 README.md                 # This file\r\n\u251c\u2500\u2500 setup.py                  # Package configuration\r\n\u2514\u2500\u2500 requirements.txt          # Dependencies\r\n```\r\n\r\n## \ud83d\udda5\ufe0f Command-Line Interface (CLI)\r\n\r\nThe AWRAF Toolkit includes a powerful command-line interface that makes it easy to run simulations without writing Python code.\r\n\r\n### **Installation & Usage**\r\n\r\nAfter installing the package, you'll have access to the `awraf-sim` command:\r\n\r\n```bash\r\n# Install the package\r\npip install awraf-toolkit\r\n\r\n# Check if CLI is available\r\nawraf-sim --help\r\n```\r\n\r\n### **Quick Demo**\r\n\r\nRun a quick demonstration with default scenarios:\r\n\r\n```bash\r\nawraf-sim --demo\r\n```\r\n\r\nThis runs a 10-trial simulation with:\r\n- Smart Healthcare: 30 devices, 6 servers\r\n- Smart Transportation: 40 devices, 8 servers  \r\n- Baseline IoT: 25 devices, 5 servers\r\n- Algorithms: AWRAF Dynamic vs Greedy\r\n\r\n### **Custom Simulations**\r\n\r\n#### **Basic Single Scenario**\r\n```bash\r\nawraf-sim --scenarios \"SMART_HEALTHCARE:50:10\" --algorithms \"AWRAF_DYNAMIC\"\r\n```\r\n\r\n#### **Multiple Scenarios & Algorithms**\r\n```bash\r\nawraf-sim --scenarios \"SMART_HEALTHCARE:50:10,SMART_TRANSPORTATION:60:12\" --algorithms \"AWRAF_DYNAMIC,GREEDY\" --trials 50\r\n```\r\n\r\n#### **With Custom Random Seed**\r\n```bash\r\nawraf-sim --scenarios \"BASELINE_IOT:100:20\" --algorithms \"AWRAF_DYNAMIC,RL_BASED\" --trials 100 --seed 42\r\n```\r\n\r\n### **CLI Parameters**\r\n\r\n| Parameter | Description | Example | Default |\r\n|-----------|-------------|---------|---------|\r\n| `--scenarios` | Comma-separated scenarios in format \"scenario:devices:servers\" | `\"SMART_HEALTHCARE:50:10\"` | Required |\r\n| `--algorithms` | Comma-separated algorithms to compare | `\"AWRAF_DYNAMIC,GREEDY\"` | Required |\r\n| `--trials` | Number of simulation trials | `50` | `30` |\r\n| `--demo` | Run demo with default settings | `--demo` | False |\r\n| `--seed` | Random seed for reproducibility | `42` | Random |\r\n\r\n### **Available Scenarios**\r\n- `SMART_HEALTHCARE`: Healthcare IoT with IRS-THz capabilities\r\n- `SMART_TRANSPORTATION`: V2X transportation with THz links\r\n- `BASELINE_IOT`: Standard IoT environment\r\n\r\n### **Available Algorithms**\r\n- `AWRAF_DYNAMIC`: AWRAF with adaptive weights\r\n- `AWRAF_STATIC`: AWRAF with fixed weights\r\n- `GREEDY`: Greedy resource allocation\r\n- `RL_BASED`: Reinforcement learning approach\r\n\r\n### **CLI Output**\r\n\r\nThe CLI provides:\r\n- \ud83d\udcca **Configuration Summary**: Shows selected scenarios, algorithms, and trials\r\n- \u23f3 **Progress Updates**: Real-time trial progress\r\n- \ud83d\udcc8 **Statistical Analysis**: T-test results and performance metrics\r\n- \ud83c\udfa8 **Visualization**: Comprehensive plots and charts\r\n- \ud83d\udccb **Summary Table**: Formatted performance comparison\r\n\r\n### **Example CLI Session**\r\n\r\n```bash\r\n$ awraf-sim --scenarios \"SMART_HEALTHCARE:40:8\" --algorithms \"AWRAF_DYNAMIC,GREEDY\" --trials 20\r\n\r\n\ud83d\ude80 Running AWRAF Toolkit Demo...\r\n\ud83d\udcca Scenarios: ['SMART_HEALTHCARE(40 devices, 8 servers)']\r\n\ud83d\udd27 Algorithms: ['AWRAF_DYNAMIC', 'GREEDY']\r\n\ud83d\udd04 Trials: 20\r\n\r\n\u23f3 Running statistical analysis...\r\nRunning Statistical Validation (20 trials)...\r\n  Trial 1/20...\r\n  Trial 2/20...\r\n  [...]\r\n  Trial 20/20...\r\n\r\n\ud83d\udcc8 Generating plots and analysis...\r\n--- T-Test Results (p-value for Device Utility) ---\r\nScenario: Smart Healthcare (IRS-THz)\r\n  vs Greedy Allocation: p-value = 0.0234 (Significant Improvement)\r\n\r\n\ud83d\udccb Printing summary table...\r\n[Comprehensive performance summary table]\r\n\r\n\u2705 Analysis complete!\r\n```\r\n\r\n## \ud83e\uddea Testing\r\n\r\nRun the test suite to ensure everything works correctly:\r\n\r\n```bash\r\n# Install in development mode\r\npip install -e .\r\n\r\n# Run tests\r\npython -m pytest tests/ -v\r\n\r\n# Run example\r\npython examples/run_simulation.py\r\n\r\n# Test CLI\r\nawraf-sim --demo\r\n```\r\n\r\n## \ud83d\udccb Requirements\r\n\r\n- Python 3.7+\r\n- numpy\r\n- matplotlib\r\n- pandas\r\n- seaborn\r\n- scipy\r\n- tabulate\r\n\r\n## \ud83e\udd1d Contributing\r\n\r\nWe welcome contributions! Please feel free to:\r\n\r\n1. Fork the repository\r\n2. Create a feature branch\r\n3. Make your changes\r\n4. Add tests for new functionality\r\n5. Submit a pull request\r\n\r\n## \ud83d\udcc4 License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n\r\n## \ud83d\udcd6 Citation\r\n\r\nIf you use this toolkit in your research, please cite:\r\n\r\n```bibtex\r\n@article{awraf2024,\r\n  title={AWRAF: An Energy-Aware Adaptive Weight-Based Resource Allocation Framework for IoT with THz Links and Intelligent Surfaces},\r\n  author={Agrawal, Kushagra and Ayaz, Ferheen and Goktas, Polat},\r\n  journal={arXiv preprint},\r\n  year={2024}\r\n}\r\n```\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Adaptive Weight-Based Resource Allocation Framework for 6G IoT with THz Links and Intelligent Surfaces",
    "version": "0.1.0",
    "project_urls": {
        "Bug Reports": "https://github.com/afrilab/awraf/issues",
        "Homepage": "https://github.com/afrilab/awraf",
        "Source": "https://github.com/afrilab/awraf"
    },
    "split_keywords": [
        "iot",
        " 6g",
        " resource-allocation",
        " edge-computing",
        " thz",
        " irs",
        " machine-learning",
        " reinforcement-learning",
        " optimization",
        " simulation",
        " wireless-networks",
        " federated-learning"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d0ce734fbee4311b2a4fe794de887c24221af5e274bd1c380578b32295210eeb",
                "md5": "fcfde3f8673953e4344cb80adb402661",
                "sha256": "f154ced3f27f3609e3a6068bc88acc4bcd5710567a1eb94c29e3bbfda8d26b82"
            },
            "downloads": -1,
            "filename": "awraf_toolkit-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fcfde3f8673953e4344cb80adb402661",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 16980,
            "upload_time": "2025-08-25T17:22:00",
            "upload_time_iso_8601": "2025-08-25T17:22:00.480698Z",
            "url": "https://files.pythonhosted.org/packages/d0/ce/734fbee4311b2a4fe794de887c24221af5e274bd1c380578b32295210eeb/awraf_toolkit-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "fd0f6111ef3c23a7cf41d67a57316cf87e0230ace71644eab1df1cc9662c1a7f",
                "md5": "fad25d57362edb0d74b8cfed4d69d27b",
                "sha256": "fbde2eb5c6daa93715755bc20cb47fc9ec4feb5e858072d975f9e80d5a77e22c"
            },
            "downloads": -1,
            "filename": "awraf_toolkit-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "fad25d57362edb0d74b8cfed4d69d27b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 21111,
            "upload_time": "2025-08-25T17:22:01",
            "upload_time_iso_8601": "2025-08-25T17:22:01.776050Z",
            "url": "https://files.pythonhosted.org/packages/fd/0f/6111ef3c23a7cf41d67a57316cf87e0230ace71644eab1df1cc9662c1a7f/awraf_toolkit-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-25 17:22:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "afrilab",
    "github_project": "awraf",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "numpy",
            "specs": []
        },
        {
            "name": "matplotlib",
            "specs": []
        },
        {
            "name": "pandas",
            "specs": []
        },
        {
            "name": "seaborn",
            "specs": []
        },
        {
            "name": "scipy",
            "specs": []
        },
        {
            "name": "tabulate",
            "specs": []
        }
    ],
    "lcname": "awraf-toolkit"
}
        
Elapsed time: 1.09825s