{"id":37649414,"url":"https://github.com/tamsri/radio-gyms","last_synced_at":"2026-01-16T11:30:30.021Z","repository":{"id":40399883,"uuid":"471415090","full_name":"tamsri/radio-gyms","owner":"tamsri","description":"Radio Gyms is an open-source bundle of AI environments for radio communications.","archived":false,"fork":false,"pushed_at":"2022-05-10T21:45:08.000Z","size":3968,"stargazers_count":13,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-01-13T15:56:38.844Z","etag":null,"topics":["5g-simulation","artificial-intelligence","machine-learning","open-source","python","radio","reinforcement-learning-environments","simulation","telecommunications","wireless-communication"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tamsri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-18T15:11:21.000Z","updated_at":"2025-12-31T04:39:05.000Z","dependencies_parsed_at":"2022-09-13T16:10:29.683Z","dependency_job_id":null,"html_url":"https://github.com/tamsri/radio-gyms","commit_stats":null,"previous_names":["intelek-ai/radio-gyms"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/tamsri/radio-gyms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tamsri%2Fradio-gyms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tamsri%2Fradio-gyms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tamsri%2Fradio-gyms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tamsri%2Fradio-gyms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tamsri","download_url":"https://codeload.github.com/tamsri/radio-gyms/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tamsri%2Fradio-gyms/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478279,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["5g-simulation","artificial-intelligence","machine-learning","open-source","python","radio","reinforcement-learning-environments","simulation","telecommunications","wireless-communication"],"created_at":"2026-01-16T11:30:29.920Z","updated_at":"2026-01-16T11:30:30.000Z","avatar_url":"https://github.com/tamsri.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Radio Gyms\n\n![Radio Gyms](https://github.com/intelek-ai/radio-gyms/blob/master/assets/logo.png)\n\nRadio Gyms is an open-source bundle of AI environments for radio communications. \nThe simulations are built for AI gyms with the support of radio-related calculation modules, and theoretical radio propagation models to simulate an accurate prediction, \nspecifically to perform reinforcement learning algorithms.\n\n## Installation\n### PyPi Package via pip\n```shell\npip install radio_gyms\n```\n### Build from source\n```shell\ngit clone https://github.com/intelek-ai/radio-gyms\ncd radio-gyms\npython -m pip install .\ncd ..\nrm -rf radio_gyms\n```\n### Dependencies\n* python 3.8+\n* numpy\n* pyglet\n* pywavefront\n## Features\nRadio gyms provides the toolkit for building wireless communication simulations including modules can be called to build and \ncustomize the radio propagation simulation. \n### 1. Calling Primitive Ray Tracer for Outdoor Propagation\nThe ray tracer can be called for computing the radio propagation paths in the following example.\n```python\nfrom radio_gyms.engines import Tracer\n\nSCENE_FILE_PATH = \"./city.obj\"\ntracer = Tracer(SCENE_FILE_PATH)\n# position (x, y, z)\ntx_pos = [0, 15, 0]\nrx_pos = [-30, 1.5, 45]\n# get traced result\nresult = tracer.trace_outdoor(tx_pos, rx_pos)\n# result\n# {'direct': False, \n# 'reflections': {'single': [   array([-28.94988531,   4.22886929,  62.39469675]),\n#                               array([-70.80339945,   7.04682531,  15.22840999])],\n#                  'double': []},\n# 'roof_edges': [array([-19.24403786,   8.5621709 ,  28.8660568 ]\n# 'tx_pos': array([ 0, 15,  0]),\n# 'rx_pos': array([-30. ,   1.5,  45. ]),\n# )]}\n```\n### 2. Calculate the traced result with the theoretical outdoor model\nThe result from the ray tracer can be calculated by the propagation models in ```radio_gyms.models```. \nIn this example, ```TheoreticalOutdoorModel``` can compute the traced results to predict the signal strength \nand delay between the receiver and transmitter based on the theoretical radio propagation models.\n```python\nfrom radio_gyms.models import TheoreticalOutdoorModel\nresult = {\n    'direct': False, \n    'reflections': {'single': [ [-28.94988531, 4.22886929, 62.39469675],\n                                [-70.80339945, 7.04682531, 15.22840999]],\n                    'double': []},\n    'roof_edges': [[-19.24403786, 8.5621709 , 28.8660568 ]],\n    'tx_pos': [ 0, 15, 0],\n    'rx_pos': [-30., 1.5, 45. ],\n}\nmodel = TheoreticalOutdoorModel(result, tx_power_dbm=20)\nmaximum_received_power = model.calculate_max_received_power(frequency=5.4e9) \n# -72.51 dBm\nimpulses = model.calculate_signal_impulses(freq=5.4e9)\n# [{'strength': -85.94590320344925, 'delay': 1.8653420787826134e-07},\n# {'strength': -74.3214622218488, 'delay': 2.910702009034143e-07}, \n# {'strength': -77.80902883055407, 'delay': 4.125241781539828e-07}]\n```\n### 3. Visualize the data with window \nAs we obtain the traced paths from the tracer, we can convert these paths into lines for the visualization. \n```Window()``` can be called to read the lines and the scene to visualize the scene in 3D by ```window.run()```.\n```python\nimport numpy as np\nfrom radio_gyms.visualizers import Window\nfrom radio_gyms.engines.ray_tracer.tracer import Tracer\nfrom radio_gyms.utils import OutdoorResultToLines\n\nMAT_OBJ_PATH = \"./city.obj\n\nwindow = Window()\nwindow.load_obj_to_scene(MAT_OBJ_PATH)\ntracer = Tracer(MAT_OBJ_PATH)\ntx_pos = np.array([0, 5, 0])\nlines = []\nwhile True:\n    rx_pos = (np.random.rand(3)*2-1)*100\n    rx_pos[1] = 1.2\n    if tracer.is_outdoor(rx_pos):\n        break\nresult = tracer.trace_outdoor(tx_pos, rx_pos)\nlines = lines + OutdoorResultToLines(result)\nwindow.line_sets = lines\nwindow.run()\n```\nWith the ```.run()``` The camera can be moved by ```W```  ```A```  ```S```  ```D``` keys and rotated by ```Q``` ```E```.\n![Old Town's Visualization](https://github.com/intelek-ai/radio-gyms/blob/master/assets/examples/oldtown_freeze.gif)\n\n### 4. Visualize the scene and radio propagation paths during running a simulation\n```window.render()``` can be called to visualize the simulation frame as the simulation updates the components. \n```python\nfrom radio_gyms.engines.ray_tracer.tracer import Tracer\nfrom radio_gyms.visualizers import Window\nfrom radio_gyms.utils.converters import outdoor_traced_result_to_line as OutdoorResultToLines\nfrom radio_gyms.simulations import OldtownWalk\n\nMAP_OBJ_PATH = \"./city.obj\"\n\nwindow = Window()\nwindow.load_obj_to_scene(MAP_OBJ_PATH)\ntracer = Tracer(MAP_OBJ_PATH, ref_max=2) # ref_max == max reflection tracing\nsimulation = OldtownWalk(tracer, 1, 5)\n# Run 100 episodes\nfor i in range(100):\n    simulation.update(1) # update time in the simulation by 1 second\n    results = simulation.get_results() # get result from simulation\n    window.line_sets = []\n    # convert the results to lines for visualizing in window\n    for result in results:\n        result_lines = OutdoorResultToLines(result)\n        window.line_sets += result_lines\n    # render the scene    \n    window.render()\n    window.dispatch_events()\n```\n![Old Town Simulation's Visualization](https://github.com/intelek-ai/radio-gyms/blob/master/assets/examples/oldtown.gif)\n\n### 5. Visualize the scene and radio propagation paths on notebook\nRadio gyms can be visualized on a notebook in 2D by using ```utils.Plotter```. \n```Plotter()``` requires definition of boundary of the map to visualize. The parameters such as points and lines can be passed to Plotter to visualize the data.\n\n```python\nfrom radio_gyms.engines import Tracer\nfrom radio_gyms.utils import Plotter, OutdoorResultToLines\nMAP_SCENE = \"./city.obj\"\n\ntracer = Tracer(MAP_SCENE)\nrx = [0, 1.2, 0]\ntx = [-50, 4, 40]\nresult = tracer.trace_outdoor(tx, rx)\nterrain_map = tracer.get_terrain_depth(64, 64)\nplotter = Plotter( tracer.min_bound, tracer.max_bound, terrain_map)\nplotter.rx_pos.append(rx)\nplotter.tx_pos.append(tx)\nplotter.lines =  OutdoorResultToLines(result)\n\nplotter.render_top() # Display from top view\n```\n![Old Town Simulation's Visualization on a notebook](https://github.com/intelek-ai/radio-gyms/blob/master/assets/examples/notebook_render.png)\n\n## Gyms\n### 1. ```radio-gym-01``` : Wireless UAV\n### 2. ```radio-gym-02```: UE Location Prediction\n### 3. ```radio-gym-03```: UE Location Prediction\n\n\n## Documentation\nRadio Gyms provides radio propagation engines and tools for customizations.\nThe official documentation can be found at ***[radio-gyms.intelek.ai](https://radio-gyms.intelek.ai)***\n\n## Citations\nThe pre-released source code can be cited with the following bibtex entry.\n```text\n@misc{radiogyms2022,\n  author = {Supawat Tamsri},\n  title = {Radio Gyms},\n  year = {2022},\n  publisher = {GitHub},\n  journal = {GitHub repository},\n  howpublished = {\\url{https://github.com/intelek-ai/radio-gyms}},\n}\n```\n\n## Contributors\n- [Supawat Tamsri](https://github.com/tamsri), supawat@intelek.ai\n  - Builds and implements.\n- [Muhammad Aamir Khan](https://scholar.google.com/citations?user=Q7YdzQEAAAAJ), aamir@intelek.ai\n  - Supervises on ML research and AI.\n\n## Disclaimer\n Radio gyms is the implementation from WCSim which is a part of the engineering thesis [\"Deep Reinforcement Learning for 5G Base Station Planning\"](https://www.academia.edu/75221445/Deep_Reinforcement_Learning_in_5G_Base_Station_Planning_with_3D_Ray_Tracing_Engine) by Supawat Tamsri. \n \n WCSim and Radio Gyms were significantly advised and supported by [Prof. Krzysztof Cichoń](https://scholar.google.com/citations?user=GmzK3-oAAAAJ).\n\n\n## Community \nFeel free to suggest an environment idea or contribute with us.\n* [Discord](https://discord.gg/Rp2KhXcpPh)\n\n## Road Map\n- [x] v0.1.x - Radio Ray Tracer\n- [x] v0.2.x - Theoretical Outdoor Propagation Model\n- [x] v0.3.x - Transmitter and Receiver Controller\n- [x] v0.4.x - Visualization for desktop\n- [x] v0.5.x - Visualization for notebook\n- [x] v0.6.x - Outdoor Simulation\n- [x] v0.7.x - Radio Gym 01: Wireless UAV Location Control\n- [ ] v0.8.x - Radio Gym 02: UE Location Prediction\n- [ ] v0.9.x - Radio Gym 03: Cooperative Small Cell Power Control\n- [ ] v0.9.5 - Beamforming Engine\n- [ ] v1.0.x - Radio Gym 04: Intelligent Beamformer\n- [ ] v1.1.x - FDTD Engine\n\n## License\n\nThe digital contents in ```/assets``` are available under Creative Commons (CC) license.\n\nSource code is licensed under **© Intelek AI [MIT](https://github.com/intelek-ai/radio-gyms/blob/master/LICENSE)**.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftamsri%2Fradio-gyms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftamsri%2Fradio-gyms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftamsri%2Fradio-gyms/lists"}