2016-11-25 61 views
0

我想在opta planner教程中使用一个简单的云平衡示例。optaplanner不正确的云平衡输出

我有2台计算机和4个进程(在opta planner文档中说明了相同的例子)。每个进程需要一定数量的RAM和CPU。

最终解决的输出不正确,您可以从下面的日志中看到。严格的规定被违反。

理想情况下,流程1和4应该适合计算机1。 过程2和3应该适合计算机2.

从日志看起来像HeuristicPhase发生但本地搜索没有显示在日志中。

请指导我什么东错了。

After building unsolvedCloudBalance Computers [ Computer [C1][7 CPU][6 RAM], Computer [C2][6 CPU][6 RAM]] Processes [ Process [P1][5 CPU][5 RAM], Process [P2][4 CPU][3 RAM], Process [P3][2 CPU][3 RAM], Process [P4][2 CPU][1 RAM]] Hard Soft Score null 
01:35:57.099 [main] INFO o.o.core.impl.solver.DefaultSolver - Solving started: time spent (3), best score (4uninitialized/0hard/0soft), environment mode (REPRODUCIBLE), random (JDK with seed 0). 
01:35:57.099 [main] INFO o.o.core.impl.solver.DefaultSolver - Solving started: time spent (3), best score (4uninitialized/0hard/0soft), environment mode (REPRODUCIBLE), random (JDK with seed 0). 
01:35:57.104 [main] DEBUG o.o.c.i.c.DefaultConstructionHeuristicPhase -  CH step (0), time spent (9), score (0hard/-800soft), selected move count (2), picked move (Process [P1][5 CPU][5 RAM] {null -> Computer [C2][6 CPU][6 RAM]}). 
01:35:57.104 [main] DEBUG o.o.c.i.c.DefaultConstructionHeuristicPhase -  CH step (0), time spent (9), score (0hard/-800soft), selected move count (2), picked move (Process [P1][5 CPU][5 RAM] {null -> Computer [C2][6 CPU][6 RAM]}). 
01:35:57.104 [main] DEBUG o.o.c.i.c.DefaultConstructionHeuristicPhase -  CH step (1), time spent (9), score (0hard/-1800soft), selected move count (2), picked move (Process [P2][4 CPU][3 RAM] {null -> Computer [C1][7 CPU][6 RAM]}). 
01:35:57.104 [main] DEBUG o.o.c.i.c.DefaultConstructionHeuristicPhase -  CH step (1), time spent (9), score (0hard/-1800soft), selected move count (2), picked move (Process [P2][4 CPU][3 RAM] {null -> Computer [C1][7 CPU][6 RAM]}). 
01:35:57.104 [main] DEBUG o.o.c.i.c.DefaultConstructionHeuristicPhase -  CH step (2), time spent (9), score (0hard/-1800soft), selected move count (1), picked move (Process [P3][2 CPU][3 RAM] {null -> Computer [C1][7 CPU][6 RAM]}). 
01:35:57.104 [main] DEBUG o.o.c.i.c.DefaultConstructionHeuristicPhase -  CH step (2), time spent (9), score (0hard/-1800soft), selected move count (1), picked move (Process [P3][2 CPU][3 RAM] {null -> Computer [C1][7 CPU][6 RAM]}). 
01:35:57.105 [main] DEBUG o.o.c.i.c.DefaultConstructionHeuristicPhase -  CH step (3), time spent (10), score (-1hard/-1800soft), selected move count (2), picked move (Process [P4][2 CPU][1 RAM] {null -> Computer [C2][6 CPU][6 RAM]}). 
01:35:57.105 [main] DEBUG o.o.c.i.c.DefaultConstructionHeuristicPhase -  CH step (3), time spent (10), score (-1hard/-1800soft), selected move count (2), picked move (Process [P4][2 CPU][1 RAM] {null -> Computer [C2][6 CPU][6 RAM]}). 
01:35:57.106 [main] INFO o.o.c.i.c.DefaultConstructionHeuristicPhase - Construction Heuristic phase (0) ended: step total (4), time spent (11), best score (-1hard/-1800soft). 
01:35:57.106 [main] INFO o.o.c.i.c.DefaultConstructionHeuristicPhase - Construction Heuristic phase (0) ended: step total (4), time spent (11), best score (-1hard/-1800soft). 
01:36:07.095 [main] DEBUG o.o.c.i.l.DefaultLocalSearchPhase -  LS step (0), time spent (10000), score (-2hard/-1800soft),  best score (-1hard/-1800soft), accepted/selected move count (0/9152031), picked move (Process [P4][2 CPU][1 RAM] { Computer [C2][6 CPU][6 RAM] -> Computer [C1][7 CPU][6 RAM]}). 
01:36:07.095 [main] DEBUG o.o.c.i.l.DefaultLocalSearchPhase -  LS step (0), time spent (10000), score (-2hard/-1800soft),  best score (-1hard/-1800soft), accepted/selected move count (0/9152031), picked move (Process [P4][2 CPU][1 RAM] { Computer [C2][6 CPU][6 RAM] -> Computer [C1][7 CPU][6 RAM]}). 
01:36:07.096 [main] INFO o.o.c.i.l.DefaultLocalSearchPhase - Local Search phase (1) ended: step total (1), time spent (10001), best score (-1hard/-1800soft). 
01:36:07.096 [main] INFO o.o.c.i.l.DefaultLocalSearchPhase - Local Search phase (1) ended: step total (1), time spent (10001), best score (-1hard/-1800soft). 
01:36:07.096 [main] INFO o.o.core.impl.solver.DefaultSolver - Solving ended: time spent (10001), best score (-1hard/-1800soft), average calculate count per second (915112), environment mode (REPRODUCIBLE). 
01:36:07.096 [main] INFO o.o.core.impl.solver.DefaultSolver - Solving ended: time spent (10001), best score (-1hard/-1800soft), average calculate count per second (915112), environment mode (REPRODUCIBLE). 
time taken 10 sec 

回答

0

它在我把难度补充类添加到@PlanningEntity注释后按预期工作。