关于「档期装箱:首次适应递减与碎片空置」,《空间租赁收益管理与档期装箱》给出的定量结论是什么?

结论:第四章把弹性日期的短订用首次适应递减装进最少的天数,每周多收 3401.1 元的整天订单收入。

数据口径:书中的棚日、价格、需求与到达概率均为示意;全部计算由书中程序生成;本书是非个人化经营建议,所有价格明码标价,稀缺提示只来自真实档期,小工具给出的价格表须经营者人工复核后发布。 第一章在一个 20 个棚日的示意月份里,用精确期望算出保护 10 个棚日可使月收入从 47323.9 元升到 57432.1 元,多 21.36 %,但模拟显示保护在 0.1900 的月份里少收钱。

English version

对照数据表

下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 3401.1

weeks simulated 1997 (skipped, not placeable: 3)
rulefree daysorphan daysfull-day yuangain vs preferred
preferred1.3160.3362213.70.0 +/- 0.0
first-fit3.3290.8325511.53297.7 +/- 188.8
FFD3.3920.5735614.83401.1 +/- 189.5
FFD reached the lower bound ceil(hours/12) in 0.9765 of weeks
查看完整验算程序
# Chapter 4. p42: what packing is worth over 2000 simulated weeks.
# Each week: short flexible requests ~ Poisson(11), lengths drawn from
# {2, 2, 3, 3, 4, 4, 6} hours, each with a named preferred day; then
# full-day shoots ~ Poisson(3), each naming one specific day and paying
# 4800 yuan if that day is still wholly free (one shoot per day). Short
# revenue is the same under every rule, so only full-day revenue and
# idle hours differ. Rules as in p41. Seeded; parameters are 示意.
import math
import random
import statistics

H, DAYS, MIN_LEN, F_DAY = 12, 7, 2, 4800
LENS = (2, 2, 3, 3, 4, 4, 6)


def draw(rng, mean):
    lim, k, p = math.exp(-mean), 0, 1.0
    while True:
        p *= rng.random()
        if p < lim:
            return k
        k += 1


def place(items, start_pref):
    load = [0] * DAYS
    for h, pref in items:
        first = pref if start_pref else 0
        for k in range(DAYS):
            d = (first + k) % DAYS
            if load[d] + h <= H:
                load[d] += h  # step: integer hours
                break
        else:
            return None
    return load


rng = random.Random(20261113)
keys = ("preferred", "first-fit", "FFD")
rev = {k: [] for k in keys}
free = {k: [] for k in keys}
orph = {k: [] for k in keys}
at_bound = skipped = 0
for _ in range(2000):
    req = [(rng.choice(LENS), rng.randrange(DAYS))
           for _ in range(draw(rng, 11.0))]
    want = {rng.randrange(DAYS) for _ in range(draw(rng, 3.0))}
    loads = {"preferred": place(req, True), "first-fit": place(req, False),
             "FFD": place(sorted(req, key=lambda r: -r[0]), False)}
    if None in loads.values():
        skipped += 1
        continue
    hours = int(math.fsum(h for h, _ in req))
    used = len([x for x in loads["FFD"] if x])
    at_bound += used == math.ceil(hours / H)  # step: count
    for k in keys:
        ld = loads[k]
        free[k].append(len([x for x in ld if x == 0]))
        rev[k].append(F_DAY * len([d for d in want if ld[d] == 0]))
        orph[k].append(len([x for x in ld if 0 < H - x < MIN_LEN]))
n = 2000 - skipped
print("weeks simulated %d (skipped, not placeable: %d)" % (n, skipped))
print("rule        free days  orphan days  full-day yuan  gain vs preferred")
for k in keys:
    d = [a - b for a, b in zip(rev[k], rev["preferred"])]
    m = statistics.fmean(d)
    h = 1.96 * statistics.stdev(d) / math.sqrt(n) if any(d) else 0.0
    print("%-10s  %9.3f  %11.3f  %13.1f  %7.1f +/- %.1f"
          % (k, statistics.fmean(free[k]), statistics.fmean(orph[k]),
             statistics.fmean(rev[k]), m, h))
print("FFD reached the lower bound ceil(hours/12) in %.4f of weeks"
      % (at_bound / n))

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《空间租赁动态收益管理与档期装箱、舱位控制嵌套保护水平与碎片空置消除母典》第 4 章「档期装箱:首次适应递减与碎片空置」(版本 1.0.0). 5D Library. DOI 待发布

DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-282 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026282,
  author    = {Fan, Yafu},
  title     = {Dynamic Revenue Management and Slot Packing for Space Rentals: Nested Protection Levels and the Elimination of Fragmented Idle Time},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

本书其他章节结论