首页 > 解决方案 > 基准测试多个难度ComparatorClass?

问题描述

我想比较在此ConstructionHeuristic阶段订购我的实体的各种选项。

我已经写了好几篇了difficultyComparatorClasses

但是由于类与实体的关联是通过实体类上的注释进行的,因此我无法在 Benchmarker 的配置中更改它。

您将如何对多个进行基准测试difficultyComparatorClass

标签: benchmarkingcomparatoroptaplanner

解决方案


It seems this is not possible with difficulty (which is a shame), however as an alternative you can configure a sorter comparator class on your entity selector instead of configuring difficulty, as shown in the docs here: https://docs.optaplanner.org/7.9.0.Final/optaplanner-docs/html_single/index.html#sortedSelectionByComparator.

As a second alternative, you can run separate benchmarks and merge them together in one benchmark report (https://docs.optaplanner.org/7.9.0.Final/optaplanner-docs/html_single/index.html#benchmarkReportAggregation)


推荐阅读