[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-tkn-tub--ns3-gym":3,"tool-tkn-tub--ns3-gym":64},[4,17,27,35,43,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,3,"2026-04-05T11:01:52",[13,14,15],"开发框架","图像","Agent","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",140436,2,"2026-04-05T23:32:43",[13,15,26],"语言模型",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":23,"last_commit_at":33,"category_tags":34,"status":16},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[13,14,15],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":23,"last_commit_at":41,"category_tags":42,"status":16},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[13,26],{"id":44,"name":45,"github_repo":46,"description_zh":47,"stars":48,"difficulty_score":23,"last_commit_at":49,"category_tags":50,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[14,51,52,53,15,54,26,13,55],"数据工具","视频","插件","其他","音频",{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":10,"last_commit_at":62,"category_tags":63,"status":16},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[15,14,13,26,54],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":76,"owner_avatar_url":77,"owner_bio":78,"owner_company":79,"owner_location":79,"owner_email":79,"owner_twitter":79,"owner_website":80,"owner_url":81,"languages":82,"stars":95,"forks":96,"last_commit_at":97,"license":98,"difficulty_score":99,"env_os":100,"env_gpu":101,"env_ram":101,"env_deps":102,"category_tags":111,"github_topics":112,"view_count":10,"oss_zip_url":79,"oss_zip_packed_at":79,"status":16,"created_at":118,"updated_at":119,"faqs":120,"releases":150},679,"tkn-tub\u002Fns3-gym","ns3-gym","ns3-gym - The Playground for Reinforcement Learning in Networking Research","ns3-gym 是一个专为网络研究打造的强化学习平台，它将业界标准的网络模拟器 ns-3 与流行的 OpenAI Gym 框架无缝集成。借助 ns3-gym，研究者能将复杂的网络仿真环境转化为标准的强化学习任务，从而轻松训练智能体来优化网络协议或通信策略。\n\nns3-gym 主要解决了网络仿真与人工智能结合门槛高的问题。过去，要在 ns-3 中运行强化学习需要大量定制开发，而现在它提供了现成的接口，让任何 ns-3 脚本都能变成可交互的 Gym 环境。这意味着你可以像操作游戏关卡一样控制网络流量、信道选择等参数。\n\n它非常适合网络协议研究人员、通信算法工程师以及对智能网络感兴趣的开发者使用。其技术亮点在于灵活性极高，允许观察仿真中的任意变量，并仅需实现少量 C++ 接口函数即可接入。无论是认知无线电信道选择还是其他网络场景，ns3-gym 都能提供高效的实验环境，加速网络智能化研究的进程。","ns3-gym\n============\n\n[OpenAI Gym](https:\u002F\u002Fgym.openai.com\u002F) is a toolkit for reinforcement learning (RL) widely used in research. The network simulator [ns-3](https:\u002F\u002Fwww.nsnam.org\u002F) is the de-facto standard for academic and industry studies in the areas of networking protocols and communication technologies. ns3-gym is a framework that integrates both OpenAI Gym and ns-3 in order to encourage usage of RL in networking research.\n\nInstallation\n============\n\nWe recommend using Linux (e.g. Ubuntu 22 or higher).\n\n1. Install all dependencies required by ns-3.\n```\n# minimal requirements for C++:\napt-get install gcc g++ python3 python3-pip cmake\n```\nCheck [ns-3 requirements](https:\u002F\u002Fwww.nsnam.org\u002Fdocs\u002Ftutorial\u002Fhtml\u002Fgetting-started.html#prerequisites\u002F)\n\n2. Install ZMQ, Protocol Buffers and pkg-config libs:\n```\nsudo apt-get update\napt-get install libzmq5 libzmq3-dev\napt-get install libprotobuf-dev\napt-get install protobuf-compiler\napt-get install pkg-config\n```\n\n3. Download and install ns3\n\n```\nwget https:\u002F\u002Fwww.nsnam.org\u002Freleases\u002Fns-allinone-3.40.tar.bz2\ntar xf ns-allinone-3.40.tar.bz2\ncd ns-allinone-3.40\n```\n\n4. Clone ns3-gym repository into `contrib` directory and change the branch:\n```\ncd .\u002Fns-3.40\u002Fcontrib\ngit clone https:\u002F\u002Fgithub.com\u002Ftkn-tub\u002Fns3-gym.git .\u002Fopengym\ncd opengym\u002F\ngit checkout app-ns-3.36+\n```\nCheck [working with cmake](https:\u002F\u002Fwww.nsnam.org\u002Fdocs\u002Fmanual\u002Fhtml\u002Fworking-with-cmake.html)\n\nIt is important to use the `opengym` as the name of the ns3-gym app directory. \n\n5. Configure and build ns-3 project:\n```\ncd ..\u002F..\u002F\n.\u002Fns3 configure --enable-examples\n.\u002Fns3 build\n```\nNote: Opengym Protocol Buffer messages (C++ and Python) are build during configure.\n\n6. Install ns3gym located in model\u002Fns3gym (Python3 required)\n```\ncd .\u002Fcontrib\u002Fopengym\u002F\n```\n```\npip3 install --user .\u002Fmodel\u002Fns3gym\n```\nor\n```\npython3 -m venv ns3gym-venv\nsource .\u002Fns3gym-venv\u002Fbin\u002Factivate\npip3 install .\u002Fmodel\u002Fns3gym\n```\n\n7. (Optional) Install all libraries required by your agent (like tensorflow, keras, etc.).\n\n8. Run example:\n```\ncd .\u002Fcontrib\u002Fopengym\u002Fexamples\u002Fopengym\u002F \n.\u002Fsimple_test.py\n```\n\n9. (Optional) Start ns-3 simulation script and Gym agent separately in two terminals (useful for debugging):\n```\n# Terminal 1\n.\u002Fns3 run \"opengym\"\n\n# Terminal 2\ncd .\u002Fcontrib\u002Fopengym\u002Fexamples\u002Fopengym\u002F \n.\u002Ftest.py --start=0\n```\n\n\nExamples\n========\n\nAll examples can be found [here](.\u002Fexamples\u002F).\n\n## Basic Interface\n\n1. Example Python script. Note, that `gym.make('ns3-v0')` starts ns-3 simulation script located in current working directory.\n```\nimport gym\nimport ns3gym\nimport MyAgent\nfrom ns3gym import ns3env\n\n#env = gym.make('ns3-v0')  \u003C--- causes some errors with the new OpenAI Gym framework, please use ns3env.Ns3Env()\nenv = ns3env.Ns3Env()\nobs = env.reset()\nagent = MyAgent.Agent()\n\nwhile True:\n  action = agent.get_action(obs)\n  obs, reward, done, info = env.step(action)\n\n  if done:\n    break\nenv.close()\n```\n2. Any ns-3 simulation script can be used as a Gym environment. This requires only to instantiate OpenGymInterface and implement the ns3-gym C++ interface consisting of the following functions:\n```\nPtr\u003COpenGymSpace> GetObservationSpace();\nPtr\u003COpenGymSpace> GetActionSpace();\nPtr\u003COpenGymDataContainer> GetObservation();\nfloat GetReward();\nbool GetGameOver();\nstd::string GetExtraInfo();\nbool ExecuteActions(Ptr\u003COpenGymDataContainer> action);\n```\nNote, that the generic ns3-gym interface allows to observe any variable or parameter in a simulation.\n\nA more detailed description can be found in our [Paper](http:\u002F\u002Fwww.tkn.tu-berlin.de\u002Ffileadmin\u002Ffg112\u002FPapers\u002F2019\u002Fgawlowicz19_mswim.pdf).\n\n## Cognitive Radio\nWe consider the problem of radio channel selection in a wireless multi-channel environment, e.g. 802.11 networks with external interference. The objective of the agent is to select for the next time slot a channel free of interference. We consider a simple illustrative example where the external interference follows a periodic pattern, i.e. sweeping over all channels one to four in the same order as shown in the table.\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftkn-tub_ns3-gym_readme_2ed1b0ea01bd.png\" alt=\"drawing\" width=\"500\"\u002F>\n\u003C\u002Fp>\n\nWe created such a scenario in ns-3 using existing functionality from ns-3, i.e. interference created using `WaveformGenerator` class and sensing performed using `SpectrumAnalyzer` class.\n\nSuch a periodic interferer can be easily learned by an RL-agent so that based on the current observation of the occupation on each channel in a given time slot the correct channel can be determined for the next time slot avoiding any collision with the interferer.\n\nOur proposed RL mapping is:\n- observation - occupation on each channel in the current time slot, i.e. wideband-sensing,\n- actions - set the channel to be used for the next time slot,\n- reward - +1 in case of no collision with interferer; otherwise -1,\n- gameover - if more than three collisions happened during the last ten time-slots\n\nThe figure below shows the learning performance when using a simple neural network with fully connected input and an output layer.\nWe see that after around 80 episodes the agent is able to perfectly predict the next channel state from the current observation hence avoiding any collision with the interference.\n\nThe full source code of the example can be found [here](.\u002Fexamples\u002Finterference-pattern\u002F).\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftkn-tub_ns3-gym_readme_fc51a59659f3.png\" alt=\"drawing\" width=\"600\"\u002F>\n\u003C\u002Fp>\n\nNote, that in a more realistic scenario the simple waveform generator in this example can be replaced by a real wireless technology like LTE unlicensed (LTE-U).\n\n\n## RL-TCP\nThe proper RL-TCP agent example is still under development. However, we have already implemented and released two versions (i.e. time and event-based) of an interface allowing to monitor parameters of a TCP instance and control its `Congestion Window` and `Slow Start Threshold` -- see details [here](.\u002Fexamples\u002Frl-tcp\u002Ftcp_base.py). Note, that both versions inherits from `TcpCongestionOps` and hence can be used as an argument for `ns3::TcpL4Protocol::SocketType`.\n\nMoreover, using the event-based interface, we already have an example Python Gym agent that implements TCP NewReno and communicates with the ns-3 simulation process using ns3gym -- see [here](.\u002Fexamples\u002Frl-tcp\u002Ftcp_newreno.py). The example can be used as a starting point to implement an RL-based TCP congestion control algorithms.\n\nIn order to run it, please execute:\n```\ncd .\u002Fcontrib\u002Fopengym\u002Fexamples\u002Frl-tcp\u002F\n.\u002Ftest_tcp.py\n```\n\nOr in two terminals:\n```\n# Terminal 1:\n.\u002Fns3 run \"rl-tcp --transport_prot=TcpRl\"\n\n# Terminal 2:\ncd .\u002Fcontrib\u002Fopengym\u002Fexamples\u002Frl-tcp\u002F\n.\u002Ftest_tcp.py --start=0\n```\n\nNote, that our Python TCP NewReno implementation achieves the same number of transmitted packets like the one implemented in ns3 (see the output of ns-3 simulation, i.e. `RxPkts: 5367` in both cases). Please execute the following command to cross-check:\n```\n.\u002Fns3 run \"rl-tcp --transport_prot=TcpNewReno\"\n```\n\nContact\n============\n* Piotr Gawlowicz, TU-Berlin, gawlowicz@tkn\n* Anatolij Zubow, TU-Berlin, zubow@tkn\n* tkn = tkn.tu-berlin.de\n\nHow to reference ns3-gym?\n============\n\nPlease use the following bibtex :\n\n```\n@inproceedings{ns3gym,\n  Title = {{ns-3 meets OpenAI Gym: The Playground for Machine Learning in Networking Research}},\n  Author = {Gaw{\\l}owicz, Piotr and Zubow, Anatolij},\n  Booktitle = {{ACM International Conference on Modeling, Analysis and Simulation of Wireless and Mobile Systems (MSWiM)}},\n  Year = {2019},\n  Location = {Miami Beach, USA},\n  Month = {November},\n  Url = {http:\u002F\u002Fwww.tkn.tu-berlin.de\u002Ffileadmin\u002Ffg112\u002FPapers\u002F2019\u002Fgawlowicz19_mswim.pdf\n}\n```\n","ns3-gym\n============\n\n[OpenAI Gym](https:\u002F\u002Fgym.openai.com\u002F) 是一个广泛用于研究的强化学习（RL）工具包。网络模拟器 [ns-3](https:\u002F\u002Fwww.nsnam.org\u002F) 是网络协议和通信技术领域的学术界与工业界研究的事实标准。ns3-gym 是一个集成了 OpenAI Gym 和 ns-3 的框架，旨在鼓励在网络研究中应用强化学习。\n\nInstallation\n============\n\n我们建议使用 Linux（例如 Ubuntu 22 或更高版本）。\n\n1. 安装 ns-3 所需的所有依赖项。\n```\n# minimal requirements for C++:\napt-get install gcc g++ python3 python3-pip cmake\n```\n查看 [ns-3 requirements](https:\u002F\u002Fwww.nsnam.org\u002Fdocs\u002Ftutorial\u002Fhtml\u002Fgetting-started.html#prerequisites\u002F)\n\n2. 安装 ZMQ、协议缓冲区（Protocol Buffers）和 pkg-config 库：\n```\nsudo apt-get update\napt-get install libzmq5 libzmq3-dev\napt-get install libprotobuf-dev\napt-get install protobuf-compiler\napt-get install pkg-config\n```\n\n3. 下载并安装 ns3\n\n```\nwget https:\u002F\u002Fwww.nsnam.org\u002Freleases\u002Fns-allinone-3.40.tar.bz2\ntar xf ns-allinone-3.40.tar.bz2\ncd ns-allinone-3.40\n```\n\n4. 将 ns3-gym 仓库克隆到 `contrib` 目录并切换分支：\n```\ncd .\u002Fns-3.40\u002Fcontrib\ngit clone https:\u002F\u002Fgithub.com\u002Ftkn-tub\u002Fns3-gym.git .\u002Fopengym\ncd opengym\u002F\ngit checkout app-ns-3.36+\n```\n查看 [working with cmake](https:\u002F\u002Fwww.nsnam.org\u002Fdocs\u002Fmanual\u002Fhtml\u002Fworking-with-cmake.html)\n\n重要的是使用 `opengym` 作为 ns3-gym 应用目录的名称。 \n\n5. 配置并构建 ns-3 项目：\n```\ncd ..\u002F..\u002F\n.\u002Fns3 configure --enable-examples\n.\u002Fns3 build\n```\n注意：Opengym 协议缓冲区（Protocol Buffer）消息（C++ 和 Python）是在配置期间构建的。\n\n6. 安装位于 model\u002Fns3gym 的 ns3gym（需要 Python3）\n```\ncd .\u002Fcontrib\u002Fopengym\u002F\n```\n```\npip3 install --user .\u002Fmodel\u002Fns3gym\n```\n或者\n```\npython3 -m venv ns3gym-venv\nsource .\u002Fns3gym-venv\u002Fbin\u002Factivate\npip3 install .\u002Fmodel\u002Fns3gym\n```\n\n7. （可选）安装代理所需的所有库（如 tensorflow, keras 等）。\n\n8. 运行示例：\n```\ncd .\u002Fcontrib\u002Fopengym\u002Fexamples\u002Fopengym\u002F \n.\u002Fsimple_test.py\n```\n\n9. （可选）在两个终端中分别启动 ns-3 模拟脚本和 Gym 代理（用于调试）：\n```\n# Terminal 1\n.\u002Fns3 run \"opengym\"\n\n# Terminal 2\ncd .\u002Fcontrib\u002Fopengym\u002Fexamples\u002Fopengym\u002F \n.\u002Ftest.py --start=0\n```\n\n\nExamples\n========\n\n所有示例均可在 [此处](.\u002Fexamples\u002F) 找到。\n\n## Basic Interface\n\n1. 示例 Python 脚本。注意，`gym.make('ns3-v0')` 会启动位于当前工作目录中的 ns-3 模拟脚本。\n```\nimport gym\nimport ns3gym\nimport MyAgent\nfrom ns3gym import ns3env\n\n#env = gym.make('ns3-v0')  \u003C--- causes some errors with the new OpenAI Gym framework, please use ns3env.Ns3Env()\nenv = ns3env.Ns3Env()\nobs = env.reset()\nagent = MyAgent.Agent()\n\nwhile True:\n  action = agent.get_action(obs)\n  obs, reward, done, info = env.step(action)\n\n  if done:\n    break\nenv.close()\n```\n2. 任何 ns-3 模拟脚本都可以用作 Gym 环境。这只需要实例化 OpenGymInterface 并实现由以下函数组成的 ns3-gym C++ 接口：\n```\nPtr\u003COpenGymSpace> GetObservationSpace();\nPtr\u003COpenGymSpace> GetActionSpace();\nPtr\u003COpenGymDataContainer> GetObservation();\nfloat GetReward();\nbool GetGameOver();\nstd::string GetExtraInfo();\nbool ExecuteActions(Ptr\u003COpenGymDataContainer> action);\n```\n注意，通用的 ns3-gym 接口允许观察模拟中的任何变量或参数。\n\n更详细的描述可在我们的 [论文](http:\u002F\u002Fwww.tkn.tu-berlin.de\u002Ffileadmin\u002Ffg112\u002FPapers\u002F2019\u002Fgawlowicz19_mswim.pdf) 中找到。\n\n## Cognitive Radio\n我们考虑无线多信道环境（例如带有外部干扰的 802.11 网络）中的无线信道选择问题。代理的目标是为下一个时隙选择一个无干扰的信道。我们考虑一个简单的说明性示例，其中外部干扰遵循周期性模式，即按照表中所示的顺序遍历所有一到四号信道。\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftkn-tub_ns3-gym_readme_2ed1b0ea01bd.png\" alt=\"drawing\" width=\"500\"\u002F>\n\u003C\u002Fp>\n\n我们使用 ns-3 中的现有功能创建了此场景，即使用 `WaveformGenerator` 类创建干扰，并使用 `SpectrumAnalyzer` 类进行感知。\n\n这种周期性干扰器可以被 RL 代理轻松学习，以便基于给定时间槽内每个信道的占用情况的当前观测，确定下一个时间槽的正确信道，从而避免与干扰器发生任何碰撞。\n\n我们提出的 RL 映射如下：\n- observation - 当前时隙中每个信道的占用情况，即宽带感知，\n- actions - 设置下一个时隙要使用的信道，\n- reward - 如果没有与干扰器发生碰撞则为 +1；否则为 -1，\n- gameover - 如果过去十个时隙内发生了超过三次碰撞\n\n下图显示了使用具有全连接输入和输出层的简单神经网络时的学习性能。\n我们看到，在大约 80 个回合后，代理能够根据当前观测完美预测下一个信道状态，从而避免与干扰发生任何碰撞。\n\n该示例的完整源代码可在 [此处](.\u002Fexamples\u002Finterference-pattern\u002F) 找到。\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftkn-tub_ns3-gym_readme_fc51a59659f3.png\" alt=\"drawing\" width=\"600\"\u002F>\n\u003C\u002Fp>\n\n注意，在更现实的场景中，本例中的简单波形生成器可以替换为真实的无线技术，如 LTE 非授权频段（LTE-U）。\n\n\n## RL-TCP\n适当的 RL-TCP 代理示例仍在开发中。然而，我们已经实现并发布了两个版本（即时基和事件基）的接口，允许监控 TCP 实例的参数并控制其 `拥塞窗口` 和 `慢启动阈值` -- 详见 [此处](.\u002Fexamples\u002Frl-tcp\u002Ftcp_base.py)。注意，这两个版本都继承自 `TcpCongestionOps`，因此可以作为 `ns3::TcpL4Protocol::SocketType` 的参数使用。\n\n此外，使用事件基接口，我们已经有示例 Python Gym 代理实现了 TCP NewReno，并使用 ns3gym 与 ns-3 模拟进程通信 -- 见 [此处](.\u002Fexamples\u002Frl-tcp\u002Ftcp_newreno.py)。该示例可作为实现基于 RL 的 TCP 拥塞控制算法的起点。\n\n为了运行它，请执行：\n```\ncd .\u002Fcontrib\u002Fopengym\u002Fexamples\u002Frl-tcp\u002F\n.\u002Ftest_tcp.py\n```\n\n或在两个终端中：\n```\n# Terminal 1:\n.\u002Fns3 run \"rl-tcp --transport_prot=TcpRl\"\n\n# 终端 2：\ncd .\u002Fcontrib\u002Fopengym\u002Fexamples\u002Frl-tcp\u002F\n.\u002Ftest_tcp.py --start=0\n```\n\n请注意，我们的 Python TCP NewReno（一种 TCP 拥塞控制算法）实现所传输的数据包数量与在 ns3（网络仿真工具）中实现的版本相同（参见 ns-3 仿真输出，即两种情况下均为 `RxPkts: 5367`）。请执行以下命令进行交叉验证：\n```\n.\u002Fns3 run \"rl-tcp --transport_prot=TcpNewReno\"\n```\n\n联系方式\n============\n* Piotr Gawlowicz, TU-Berlin, gawlowicz@tkn\n* Anatolij Zubow, TU-Berlin, zubow@tkn\n* tkn = tkn.tu-berlin.de\n\n如何引用 ns3-gym？\n============\n\n请使用以下 bibtex（参考文献引用格式）：\n\n```\n@inproceedings{ns3gym,\n  Title = {{ns-3 meets OpenAI Gym: The Playground for Machine Learning in Networking Research}},\n  Author = {Gaw{\\l}owicz, Piotr and Zubow, Anatolij},\n  Booktitle = {{ACM International Conference on Modeling, Analysis and Simulation of Wireless and Mobile Systems (MSWiM)}},\n  Year = {2019},\n  Location = {Miami Beach, USA},\n  Month = {November},\n  Url = {http:\u002F\u002Fwww.tkn.tu-berlin.de\u002Ffileadmin\u002Ffg112\u002FPapers\u002F2019\u002Fgawlowicz19_mswim.pdf\n}\n```","# ns3-gym 快速上手指南\n\nns3-gym 是一个将 [OpenAI Gym](https:\u002F\u002Fgym.openai.com\u002F) 与 [ns-3](https:\u002F\u002Fwww.nsnam.org\u002F) 网络模拟器集成的框架，旨在促进强化学习（RL）在网络协议和通信技术研究中应用。\n\n## 环境准备\n\n*   **操作系统**: 推荐使用 Linux (例如 Ubuntu 22 或更高版本)。\n*   **基础依赖**: 确保已安装 C++ 编译工具链及 Python 环境。\n\n```bash\napt-get install gcc g++ python3 python3-pip cmake\n```\n\n*   **第三方库**: 安装 ZeroMQ、Protocol Buffers 和 pkg-config。\n\n```bash\nsudo apt-get update\napt-get install libzmq5 libzmq3-dev\napt-get install libprotobuf-dev\napt-get install protobuf-compiler\napt-get install pkg-config\n```\n\n## 安装步骤\n\n1.  **下载并解压 ns-3**\n    ```bash\n    wget https:\u002F\u002Fwww.nsnam.org\u002Freleases\u002Fns-allinone-3.40.tar.bz2\n    tar xf ns-allinone-3.40.tar.bz2\n    cd ns-allinone-3.40\n    ```\n\n2.  **克隆 ns3-gym 插件**\n    必须将仓库克隆到 `contrib` 目录下，且目录名需为 `opengym`。同时切换到指定分支。\n    ```bash\n    cd .\u002Fns-3.40\u002Fcontrib\n    git clone https:\u002F\u002Fgithub.com\u002Ftkn-tub\u002Fns3-gym.git .\u002Fopengym\n    cd opengym\u002F\n    git checkout app-ns-3.36+\n    ```\n\n3.  **配置并构建 ns-3**\n    此步骤会生成 Opengym Protocol Buffer 消息文件。\n    ```bash\n    cd ..\u002F..\u002F\n    .\u002Fns3 configure --enable-examples\n    .\u002Fns3 build\n    ```\n\n4.  **安装 Python 模块**\n    进入 `model\u002Fns3gym` 目录进行安装。\n    ```bash\n    cd .\u002Fcontrib\u002Fopengym\u002F\n    pip3 install --user .\u002Fmodel\u002Fns3gym\n    ```\n    *(可选) 如需使用虚拟环境：*\n    ```bash\n    python3 -m venv ns3gym-venv\n    source .\u002Fns3gym-venv\u002Fbin\u002Factivate\n    pip3 install .\u002Fmodel\u002Fns3gym\n    ```\n\n5.  **安装强化学习库 (可选)**\n    根据代理需求安装如 tensorflow、keras 等库。\n\n## 基本使用\n\n### 编写 Agent 脚本\n核心逻辑是实例化 `Ns3Env`，通过 `step` 动作与环境交互。注意不要直接使用 `gym.make('ns3-v0')`，建议使用 `ns3env.Ns3Env()`。\n\n```python\nimport gym\nimport ns3gym\nimport MyAgent\nfrom ns3gym import ns3env\n\n# 初始化环境\nenv = ns3env.Ns3Env()\nobs = env.reset()\nagent = MyAgent.Agent()\n\nwhile True:\n  action = agent.get_action(obs)\n  obs, reward, done, info = env.step(action)\n\n  if done:\n    break\nenv.close()\n```\n\n### 运行示例\n安装完成后，可运行官方提供的简单测试脚本验证环境是否正常工作。\n\n```bash\ncd .\u002Fcontrib\u002Fopengym\u002Fexamples\u002Fopengym\u002F \n.\u002Fsimple_test.py\n```\n\n*(调试建议)* 若需单独启动 ns-3 模拟器和 Gym 代理以便调试，可在两个终端分别执行：\n\n```bash\n# Terminal 1\n.\u002Fns3 run \"opengym\"\n\n# Terminal 2\ncd .\u002Fcontrib\u002Fopengym\u002Fexamples\u002Fopengym\u002F \n.\u002Ftest.py --start=0\n```","某物联网研发团队正在开发智能工厂的无线连接方案，需要让设备在多个接入点间自动切换以保持低延迟。\n\n### 没有 ns3-gym 时\n- 需要手动编写复杂的 C++ 代码来模拟网络环境并对接强化学习算法，开发成本极高。\n- 调试困难，每次调整策略都要重新编译整个 ns-3 仿真器，反馈周期长。\n- 无法直接复用现有的 OpenAI Gym 生态库，需从零实现状态观测与动作执行接口。\n- 观察网络状态和获取奖励信号的过程繁琐，容易因数据格式不匹配导致仿真崩溃。\n\n### 使用 ns3-gym 后\n- ns3-gym 提供了标准的 Gym 接口，Python 脚本即可直接控制 ns-3 仿真进程，无需重复造轮子。\n- 支持动态观测任意网络参数，无需修改底层 C++ 代码即可轻松获取延迟或丢包率作为状态输入。\n- 利用现有 RL 框架快速训练模型，迭代周期从数周缩短至数天，极大加速策略验证。\n- 支持分离仿真与训练终端，便于实时调试 Agent 行为而不中断网络模拟，排查问题更直观。\n\nns3-gym 通过标准化接口打通了网络仿真与强化学习的壁垒，大幅降低了通信协议优化算法的研发门槛。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftkn-tub_ns3-gym_fc51a596.png","tkn-tub","Telecommunication Networks Group","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Ftkn-tub_4ce9e7b0.png","Telecommunication Networks Group (TKN) at the School of Electrical Engineering and Computer Science, TU Berlin",null,"http:\u002F\u002Fwww.tkn.tu-berlin.de\u002F","https:\u002F\u002Fgithub.com\u002Ftkn-tub",[83,87,91],{"name":84,"color":85,"percentage":86},"C++","#f34b7d",65.2,{"name":88,"color":89,"percentage":90},"Python","#3572A5",25.3,{"name":92,"color":93,"percentage":94},"CMake","#DA3434",9.6,682,218,"2026-04-04T20:04:30","GPL-2.0",4,"Linux","未说明",{"notes":103,"python":104,"dependencies":105},"推荐使用 Ubuntu 22 或更高版本的 Linux；需安装 ns-3 网络模拟器及 C++ 编译环境；工具需克隆至 ns-3 源码的 contrib\u002Fopengym 目录并切换特定分支；强化学习代理库（如 TensorFlow、Keras）为可选依赖；调试时建议分两个终端分别运行 ns-3 仿真和 Gym Agent 进程。","3.x",[106,107,108,109,92,110],"ns-3","OpenAI Gym","ZeroMQ","Protocol Buffers","Python3",[13,15],[113,114,115,116,117],"ns3","gym-environment","openai-gym","reinforcement-learning","reinforcement-learning-environments","2026-03-27T02:49:30.150509","2026-04-06T08:48:07.983019",[121,126,131,136,141,145],{"id":122,"question_zh":123,"answer_zh":124,"source_url":125},2825,"构建配置期间未生成 protobuf 消息导致构建失败怎么办？","此问题常见于 ns-3 旧版本（如 3.36.1）。建议将 ns-3 升级到较新版本（如 3.38）或进行全新安装。在 ns-3.38 中通常不再出现配置或构建错误。","https:\u002F\u002Fgithub.com\u002Ftkn-tub\u002Fns3-gym\u002Fissues\u002F73",{"id":127,"question_zh":128,"answer_zh":129,"source_url":130},2826,"执行 .\u002Fwaf build 时报错 Build failed 如何解决？","请确保将 ns3-gym 仓库克隆到特定的子目录中，例如 `opengym`。正确命令为：`git clone https:\u002F\u002Fgithub.com\u002Ftkn-tub\u002Fns3-gym.git .\u002Fopengym`。直接克隆到当前目录可能导致任务失败。","https:\u002F\u002Fgithub.com\u002Ftkn-tub\u002Fns3-gym\u002Fissues\u002F30",{"id":132,"question_zh":133,"answer_zh":134,"source_url":135},2827,"编译时报错 fatal error: ns3\u002Fopengym-module.h: No such file or directory 怎么办？","该错误通常是因为缺少依赖或未正确生成模块。请检查是否安装了 `zmq` 库，并确认 `protoc` 编译器路径正确。此外，尝试退出 Anaconda 环境后再运行配置命令。","https:\u002F\u002Fgithub.com\u002Ftkn-tub\u002Fns3-gym\u002Fissues\u002F14",{"id":137,"question_zh":138,"answer_zh":139,"source_url":140},2828,"protoc 和 protobuf 版本不兼容导致构建错误如何处理？","这通常是因为系统环境和 Conda 环境中存在多个版本的 Protocol Buffer。请确保在 Conda 环境中执行 `.\u002Fwaf config` 和 `.\u002Fwaf` 命令，并更新 headers 以匹配 protoc 版本。","https:\u002F\u002Fgithub.com\u002Ftkn-tub\u002Fns3-gym\u002Fissues\u002F4",{"id":142,"question_zh":143,"answer_zh":144,"source_url":140},2829,"如何在 Conda 环境中正确配置 ns3-gym 以避免环境冲突？","必须保证 `.\u002Fwaf config` 和 `.\u002Fwaf` 都在同一个 Conda 环境中执行。如果遇到问题，请检查是否同时安装了系统版和 Conda 版的 protobuf，尽量保持环境纯净，必要时离开 Anaconda 环境操作。",{"id":146,"question_zh":147,"answer_zh":148,"source_url":149},2830,"ns-3 和 OpenAI Gym 的安装顺序及依赖关系是什么？","安装流程请参阅项目的 README 文件。通常不需要单独先安装 OpenAI Gym，而是按照 README 步骤依次安装 ns-3 和 ns3-gym 包，并在其中完成 .\u002Fwaf build。","https:\u002F\u002Fgithub.com\u002Ftkn-tub\u002Fns3-gym\u002Fissues\u002F9",[151,156,161],{"id":152,"version":153,"summary_zh":154,"released_at":155},111973,"ns3-gym-1.0.2","Updated to support the new build system (cmake) in ns-3.36.","2022-07-07T08:55:25",{"id":157,"version":158,"summary_zh":159,"released_at":160},111974,"ns3-gym-1.0.1","Updated to support new version of the protobuff and zmq libs.","2022-01-19T09:13:39",{"id":162,"version":163,"summary_zh":164,"released_at":165},111975,"ns3-gym-1.0.0","The first release of ns3-gym.","2018-12-04T21:45:06"]