仓配网络优化器

v2.7.0

基于整数规划(MILP)的仓配网络优化系统,支持时效计算(含等待时间)、中转链路、供应关系到区县等。

0· 72·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for jinqianfei/warehouse-network-optimizer-skills.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "仓配网络优化器" (jinqianfei/warehouse-network-optimizer-skills) from ClawHub.
Skill page: https://clawhub.ai/jinqianfei/warehouse-network-optimizer-skills
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install warehouse-network-optimizer-skills

ClawHub CLI

Package manager switcher

npx clawhub@latest install warehouse-network-optimizer-skills
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description (MILP warehouse network optimizer) matches the included scripts (convert_data.py, run_optimization.py) and JSON data; required inputs are Excel/data files and the solver libraries named in SKILL.md, so requested capabilities are proportionate.
Instruction Scope
SKILL.md tells the agent to convert Excel → JSON and run the optimizer to produce an Excel report. The runtime instructions reference only the provided scripts and user data files; there are no instructions to read unrelated system files, access environment secrets, or post data externally.
Install Mechanism
No install spec is included (instruction-only). SKILL.md recommends installing standard Python packages (pulp, pandas, openpyxl) via pip — expected for this workload and not excessive. No downloads from untrusted URLs or archive extraction are present.
Credentials
The skill declares no required environment variables, credentials, or config paths and the code does not attempt to read environment secrets — access requested is minimal and appropriate for a local data-processing optimizer.
Persistence & Privilege
The skill is not always-enabled and does not modify other skills or global agent configuration. It runs locally and generates output files only, so its persistence/privilege footprint is minimal.
Assessment
This package appears coherent and runs entirely on local inputs (Excel/JSON) using Python + PuLP/CBC. Before installing or running it: (1) review the included scripts (convert_data.py, run_optimization.py) if you have sensitive data in your spreadsheets, (2) run in a controlled environment (venv or sandbox) and install dependencies via pip, (3) be aware the package author/source is unknown (no homepage) — if provenance matters, validate or re-generate the data files yourself, and (4) large instances may incur heavy solver time/memory usage, so test with a small sample first.

Like a lobster shell, security has layers — review code before you run it.

latestvk97b8de1pa5nkdqsf60q6d6fwx84fh86
72downloads
0stars
1versions
Updated 2w ago
v2.7.0
MIT-0

仓配网络规划优化器 Skill v2.7

概述

基于整数规划(MILP)的仓配网络优化系统,使用 PuLP+CBC 求解器,支持多约束优化。

版本历史

版本日期更新内容
v2.72026-04-08RDC数量改为上限(<=N), 新增参数引导流程, 支持必选/禁止仓库
v2.62026-04-07智能单位检测 + 加权平均时效指标
v2.52026-04-07优化门店匹配逻辑(城市优先,省份备选)
v2.42026-04-07新增等待时间计算(考虑发车日)

📋 完整使用流程

Step 1: 准备数据文件
    ↓
Step 2: 转换数据(Excel → JSON)
    ↓
Step 3: 配置优化参数 ⭐【新增引导流程】
    ↓
Step 4: 运行优化 → 生成 Excel 报告

🎯 Step 3: 参数配置(重要更新 v2.7)

参数引导清单

1. 基本参数

参数说明格式
RDC数量上限最多选择的RDC数量数字(如5)

2. 约束条件(可选)

参数说明格式
必选仓库必须包含的RDC仓库仓库名列表
禁止仓库不能作为RDC的仓库仓库名列表

⚠️ 重要:RDC数量含义

  • 旧逻辑:== N(恰好N个)
  • 新逻辑:<= N(最多N个,由优化器自动选择最优数量)

🔴 v2.7 重要变更

1. RDC数量改为上限

变更前:

设置 RDC=5 → 必须恰好选择5个RDC

变更后:

设置 RDC<=5 → 最多选择5个RDC,优化器自动选择最优数量
优点:更灵活,避免过度建设

2. 参数引导流程

优化前必须确认的参数:

1. RDC数量上限(N)
2. 必选仓库(如有)
3. 禁止仓库(如有)

🚀 快速开始

1. 安装依赖

pip install pulp pandas openpyxl

2. 准备数据文件

数据类型格式说明
门店数据Excel省份、城市、区县、详细地址
干线数据Excel仓库间调拨线路和时效
共配数据Excel(多Sheet)各基地报货周期表

3. 转换数据

# 转换干线数据(自动检测单位并转换)
python3 convert_data.py --trunk 干线数据.xlsx --output-dir .

# 转换共配数据
python3 convert_data.py --distribution 共配报货周期表.xlsx --output-dir .

4. 配置参数并运行

python3 run_optimization.py \
    --store-file 门店数据.xlsx \
    --rdc-count 5 \        # 最多5个RDC
    --output result.xlsx

📊 优化算法逻辑

1. 目标函数

最小化:Σ(门店数 × 线路时效) 加权和

2. 约束条件

1. 每个省份必须分配给1个RDC
2. RDC数量 <= 指定上限
3. 必选仓库(如果有)必须被选中
4. 禁止仓库(如果有)不能被选中

3. 时效计算

总时效 = 等待时间 + 干线时效 + 等待时间 + 配送时效

时效类型单位说明
干线时效由小时转换或直接使用
配送时效共配表原始数据
等待时间因发车日导致的等待

4. 链路类型判断

链路类型判断条件
直达RDC = 配送基地
调拨一次RDC ≠ FSL,有直达干线
中转需要经过TC中转仓

5. 门店匹配逻辑

1. 优先城市精确匹配
2. 其次省份模糊匹配
3. 城市推断省份

📊 输出Excel结构

Sheet名称内容
执行摘要关键指标、RDC数量、覆盖区域、加权平均时效
RDC选址选中的RDC仓库
供应关系完整链路信息(含时效分解)
调拨中转仓涉及的中转链路
省份分布各省归属

执行摘要字段

字段说明
RDC数量实际选中的RDC数量(≤上限)
覆盖区域省-市-区组合数
总门店数有效门店总数
时效单位
加权平均时效Σ(门店数×时效)/总门店数

📝 代码示例

方式1:命令行

python3 run_optimization.py \
    --store-file 门店数据.xlsx \
    --rdc-count 5 \
    --required 成都仓 广州仓 \
    --forbidden 北京仓 \
    --output result.xlsx

参数说明:

参数说明示例
--store-file门店数据Excel必填
--rdc-countRDC数量上限(默认3)5
--required必选仓库(空格分隔)成都仓 广州仓
--forbidden禁止仓库(空格分隔)北京仓 上海仓
--output输出文件result.xlsx

方式2:Python调用

from run_optimization import optimize_and_generate_excel

optimize_and_generate_excel(
    store_file='门店数据.xlsx',
    num_rdc=5,  # 最多5个RDC
    output_file='result.xlsx'
)

✅ 检查清单

  • RDC数量改为上限(<= N)
  • 参数引导流程
  • 智能单位检测
  • 加权平均时效指标
  • 时效计算(含等待时间)
  • 链路类型判断
  • 供应关系展示到区县级别
  • 门店匹配逻辑(城市优先,省份备选)

📁 文件结构

warehouse-network-optimizer.skills/
├── SKILL.md               # 本文档
├── convert_data.py         # 数据转换脚本
├── run_optimization.py     # 核心优化脚本
├── trunk_lines.json        # 干线数据
└── distribution_cycles.json # 共配数据

Status: 生产可用 ✅
Version: 2.7.0
核心功能: 整数规划优化 + 智能单位检测 + 加权平均时效

Comments

Loading comments...