【问题标题】:Construction Heuristic leaves 2 variables uninitialized构造启发式使 2 个变量未初始化
【发布时间】:2018-04-17 14:12:38
【问题描述】:

我正在使用时间粒度模式创建求解器。它类似于会议安排。它确实具有不可移动的实体,以支持用户的固定时间表。
在启动求解器时,构造启发式结束,留下 -2 初始分数。终止标准为 30 秒。在此之后,解决方案在没有适当解决方案的情况下终止,如下面的日志所示。

我哪里错了?

19:23:25.587 [main] INFO o.o.core.impl.solver.DefaultSolver - Solving started: time spent (22), best score (-4init/0hard/0soft), environment mode (REPRODUCIBLE), random (JDK with seed 0). 19:23:25.613 [main] DEBUG o.o.c.i.c.DefaultConstructionHeuristicPhase - CH step (0), time spent (50), score (-3init/1522656532800hard/12soft), selected move count (96), picked move (com.atomiton.vopak.activities.Activity@762ef0ea {null -> TimeGrain - 95 [1524180600000]}). 19:23:25.620 [main] DEBUG o.o.c.i.c.DefaultConstructionHeuristicPhase - CH step (1), time spent (57), score (-2init/3045313098000hard/24soft), selected move count (96), picked move (com.atomiton.vopak.activities.Activity@31f9b85e {null -> TimeGrain - 95 [1524180600000]}). 19:23:25.621 [main] INFO o.o.c.i.c.DefaultConstructionHeuristicPhase - Construction Heuristic phase (0) ended: time spent (58), best score (-2init/3045313098000hard/24soft), score calculation speed (6655/sec), step total (2). 19:23:55.563 [main] DEBUG o.o.c.i.l.DefaultLocalSearchPhase - LS step (0), time spent (30000), score (-2init/3045311298000hard/24soft), best score (-2init/3045313098000hard/24soft), accepted/selected move count (0/6961207), picked move (com.atomiton.vopak.activities.Activity@76ed1b7c {TimeGrain - 95 [1524180600000] -> TimeGrain - 94 [1524178800000]}). 19:23:55.563 [main] INFO o.o.c.i.l.DefaultLocalSearchPhase - Local Search phase (1) ended: time spent (30000), best score (-2init/3045313098000hard/24soft), score calculation speed (232497/sec), step total (1). 19:23:55.564 [main] INFO o.o.core.impl.solver.DefaultSolver - Solving ended: time spent (30001), best score (-2init/3045313098000hard/24soft), score calculation speed (232038/sec), phase total (2), environment mode (REPRODUCIBLE).

【问题讨论】:

  • 从日志输出中删除类名,这样缩进就可以解决了

标签: java solver optaplanner heuristics uninitialized-constant


【解决方案1】:
Construction Heuristic phase (0) ended:
    time spent (58),
    best score (-2init/3045313098000hard/24soft),
    score calculation speed (6655/sec),
    step total (2).

2 步,因此只有 2 个实体是可移动的。 其余部分必须是不动的,包括导致-2init 的部分。

PS:硬分数有问题。要么它溢出(使用长分数变体),要么它的约束符号是错误的。

CH step (1), time spent (57), score (-2init/3045313098000hard/24soft),
    selected move count (96),
    picked move (...Activity@31f9b85e {null -> TimeGrain - 95 [1524180600000]})

选择的移动似乎是一个简单的ChangeMove,因此只有 1 个计划变量。

【讨论】:

  • 谢谢杰弗里。我已经在使用长分数变体。将检查标志。但是为什么 LS 等待 30 秒(我的终止标准)然后只进行 2 次移动并结束?
  • 延迟接受(默认算法)将停留在全局或局部最优。这只发生在非常小的数据集上。打开 TRACE 日志记录以查看实际情况。
  • 打开了 TRACE 日志记录并在编程时陷入了最常见的陷阱。比较毫秒和秒! Java DateTime API 确实需要一些改进。感谢@Geoffrey 的帮助。
猜你喜欢
  • 2021-12-06
  • 1970-01-01
  • 2014-05-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-09-27
  • 2015-02-19
  • 1970-01-01
相关资源
最近更新 更多