我正在尝试使用Optaplanner进行基准测试,但我没有看到任何结果。我的目录都已创建,但是,没有文件,也没有html文件供我查看任何图表。以下是我的实施概要,你能帮助我弄清楚我做错了吗?
我将以下内容添加到main()
中的VehicleRoutingApp.classPlannerBenchmarkFactory plannerBenchmarkFactory = PlannerBenchmarkFactory.createFromXmlResource(
"org/optaplanner/examples/vehiclerouting/benchmark/vehicleRoutingBenchmarkConfig.xml");
PlannerBenchmark plannerBenchmark = plannerBenchmarkFactory.buildPlannerBenchmark();
plannerBenchmark.benchmark();
引用的xml如下所示
<?xml version="1.0" encoding="UTF-8"?>
<plannerBenchmark>
<benchmarkDirectory>local/data/report/vehiclerouting</benchmarkDirectory>
<parallelBenchmarkCount>AUTO</parallelBenchmarkCount>
<warmUpSecondsSpentLimit>30</warmUpSecondsSpentLimit>
<inheritedSolverBenchmark>
<problemBenchmarks>
<solutionFileIOClass>org.optaplanner.examples.vehiclerouting.persistence.VehicleRoutingFileIO</solutionFileIOClass>
<!-- Geoffrey datasets -->
<inputSolutionFile>data/vehiclerouting/unsolved/GeoffreyHelpMe.xml</inputSolutionFile>
<!-- Belgium datasets -->
<inputSolutionFile>data/vehiclerouting/import/belgium/basic/air/belgium-n50-k10.vrp</inputSolutionFile>
<inputSolutionFile>data/vehiclerouting/import/belgium/basic/air/belgium-n100-k10.vrp</inputSolutionFile>
<inputSolutionFile>data/vehiclerouting/import/belgium/basic/air/belgium-n500-k20.vrp</inputSolutionFile>
<inputSolutionFile>data/vehiclerouting/import/belgium/basic/air/belgium-n1000-k20.vrp</inputSolutionFile>
<inputSolutionFile>data/vehiclerouting/import/belgium/basic/air/belgium-n2750-k55.vrp</inputSolutionFile>
<inputSolutionFile>data/vehiclerouting/import/belgium/basic/road-km/belgium-road-km-n50-k10.vrp</inputSolutionFile>
<inputSolutionFile>data/vehiclerouting/import/belgium/basic/road-km/belgium-road-km-n100-k10.vrp</inputSolutionFile>
<inputSolutionFile>data/vehiclerouting/import/belgium/basic/road-time/belgium-road-time-n50-k10.vrp</inputSolutionFile>
<inputSolutionFile>data/vehiclerouting/import/belgium/basic/road-time/belgium-road-time-n100-k10.vrp</inputSolutionFile>
<!-- USA datasets -->
<inputSolutionFile>data/vehiclerouting/import/usa/basic/air/usa-n100-k10.vrp</inputSolutionFile>
<inputSolutionFile>data/vehiclerouting/import/usa/basic/air/usa-n500-k20.vrp</inputSolutionFile>
<inputSolutionFile>data/vehiclerouting/import/usa/basic/air/usa-n1000-k20.vrp</inputSolutionFile>
<inputSolutionFile>data/vehiclerouting/import/usa/basic/air/usa-n5000-k100.vrp</inputSolutionFile>
<inputSolutionFile>data/vehiclerouting/import/usa/basic/air/usa-n10000-k100.vrp</inputSolutionFile>
<inputSolutionFile>data/vehiclerouting/import/usa/basic/air/usa-n50000-k500.vrp</inputSolutionFile>
<inputSolutionFile>data/vehiclerouting/import/usa/basic/air/usa-n100000-k500.vrp</inputSolutionFile>
........ <!-- and other datasets that were default -->
<problemStatisticType>BEST_SCORE</problemStatisticType>
<!--<problemStatisticType>STEP_SCORE</problemStatisticType>-->
<!--<problemStatisticType>SCORE_CALCULATION_SPEED</problemStatisticType>-->
<!--<problemStatisticType>BEST_SOLUTION_MUTATION</problemStatisticType>-->
<!--<problemStatisticType>MOVE_COUNT_PER_STEP</problemStatisticType>-->
<!--<problemStatisticType>MEMORY_USE</problemStatisticType>-->
<!--<singleStatisticType>CONSTRAINT_MATCH_TOTAL_BEST_SCORE</singleStatisticType>-->
<!--<singleStatisticType>CONSTRAINT_MATCH_TOTAL_STEP_SCORE</singleStatisticType>-->
<!--<singleStatisticType>PICKED_MOVE_TYPE_BEST_SCORE_DIFF</singleStatisticType>-->
<!--<singleStatisticType>PICKED_MOVE_TYPE_STEP_SCORE_DIFF</singleStatisticType>-->
</problemBenchmarks>
<solver>
<!--<environmentMode>FAST_ASSERT</environmentMode>-->
<solutionClass>org.optaplanner.examples.vehiclerouting.domain.VehicleRoutingSolution</solutionClass>
<entityClass>org.optaplanner.examples.vehiclerouting.domain.Standstill</entityClass>
<entityClass>org.optaplanner.examples.vehiclerouting.domain.Customer</entityClass>
<entityClass>org.optaplanner.examples.vehiclerouting.domain.timewindowed.TimeWindowedCustomer</entityClass>
<scoreDirectorFactory>
<scoreDefinitionType>HARD_SOFT_LONG</scoreDefinitionType>
<incrementalScoreCalculatorClass>org.optaplanner.examples.vehiclerouting.solver.score.VehicleRoutingIncrementalScoreCalculator</incrementalScoreCalculatorClass>
<!--<scoreDrl>org/optaplanner/examples/vehiclerouting/solver/vehicleRoutingScoreRules.drl</scoreDrl>-->
<initializingScoreTrend>ONLY_DOWN</initializingScoreTrend>
</scoreDirectorFactory>
<termination>
<minutesSpentLimit>5</minutesSpentLimit>
</termination>
</solver>
</inheritedSolverBenchmark>
<solverBenchmark>
<name>First Fit</name>
<solver>
<constructionHeuristic>
<constructionHeuristicType>FIRST_FIT</constructionHeuristicType>
</constructionHeuristic>
</solver>
</solverBenchmark>
<solverBenchmark>
<name>First Fit Decreasing</name>
<solver>
<constructionHeuristic>
<constructionHeuristicType>FIRST_FIT_DECREASING</constructionHeuristicType>
</constructionHeuristic>
</solver>
</solverBenchmark>
....... <!-- and other default solverBenchmark tags -->
</plannerBenchmark>
应用程序运行正常。我根据现有的cvrptw-25customers.xml示例建模了一个名为GeoffreyHelpMe.xml的xml文件。它看起来如下:
<!--
multiple vehicles
25 customers
1 dropoff location
-->
<VrpTimeWindowedVehicleRoutingSolution id="1">
<id>0</id>
<name>C101</name>
<distanceType>AIR_DISTANCE</distanceType>
<distanceUnitOfMeasurement>distance</distanceUnitOfMeasurement>
<locationList id="2">
<VrpAirLocation id="3">
<id>0</id>
<latitude>40.0</latitude>
<longitude>50.0</longitude>
</VrpAirLocation>
<VrpAirLocation id="4">
<id>1</id>
<latitude>45.0</latitude>
<longitude>68.0</longitude>
</VrpAirLocation>
<VrpAirLocation id="5">
<id>2</id>
<latitude>15.0</latitude>
<longitude>70.0</longitude>
</VrpAirLocation>
<VrpAirLocation id="6">
<id>3</id>
<latitude>21.0</latitude>
<longitude>66.0</longitude>
</VrpAirLocation>
<VrpAirLocation id="7">
<id>4</id>
<latitude>42.0</latitude>
<longitude>68.0</longitude>
</VrpAirLocation>
<VrpAirLocation id="8">
<id>5</id>
<latitude>25.0</latitude>
<longitude>35.0</longitude>
</VrpAirLocation>
<VrpAirLocation id="9">
<id>6</id>
<latitude>40.0</latitude>
<longitude>69.0</longitude>
</VrpAirLocation>
<VrpAirLocation id="10">
<id>7</id>
<latitude>40.0</latitude>
<longitude>66.0</longitude>
</VrpAirLocation>
<VrpAirLocation id="11">
<id>8</id>
<latitude>38.0</latitude>
<longitude>68.0</longitude>
</VrpAirLocation>
<VrpAirLocation id="12">
<id>9</id>
<latitude>38.0</latitude>
<longitude>70.0</longitude>
</VrpAirLocation>
<VrpAirLocation id="13">
<id>10</id>
<latitude>35.0</latitude>
<longitude>66.0</longitude>
</VrpAirLocation>
<VrpAirLocation id="14">
<id>11</id>
<latitude>35.0</latitude>
<longitude>69.0</longitude>
</VrpAirLocation>
<VrpAirLocation id="15">
<id>12</id>
<latitude>25.0</latitude>
<longitude>85.0</longitude>
</VrpAirLocation>
<VrpAirLocation id="16">
<id>13</id>
<latitude>22.0</latitude>
<longitude>75.0</longitude>
</VrpAirLocation>
<VrpAirLocation id="17">
<id>14</id>
<latitude>22.0</latitude>
<longitude>85.0</longitude>
</VrpAirLocation>
<VrpAirLocation id="18">
<id>15</id>
<latitude>20.0</latitude>
<longitude>80.0</longitude>
</VrpAirLocation>
<VrpAirLocation id="19">
<id>16</id>
<latitude>20.0</latitude>
<longitude>85.0</longitude>
</VrpAirLocation>
<VrpAirLocation id="20">
<id>17</id>
<latitude>18.0</latitude>
<longitude>75.0</longitude>
</VrpAirLocation>
<VrpAirLocation id="21">
<id>18</id>
<latitude>15.0</latitude>
<longitude>75.0</longitude>
</VrpAirLocation>
<VrpAirLocation id="22">
<id>19</id>
<latitude>15.0</latitude>
<longitude>80.0</longitude>
</VrpAirLocation>
<VrpAirLocation id="23">
<id>20</id>
<latitude>30.0</latitude>
<longitude>50.0</longitude>
</VrpAirLocation>
<VrpAirLocation id="24">
<id>21</id>
<latitude>30.0</latitude>
<longitude>52.0</longitude>
</VrpAirLocation>
<VrpAirLocation id="25">
<id>22</id>
<latitude>28.0</latitude>
<longitude>52.0</longitude>
</VrpAirLocation>
<VrpAirLocation id="26">
<id>23</id>
<latitude>28.0</latitude>
<longitude>55.0</longitude>
</VrpAirLocation>
<VrpAirLocation id="27">
<id>24</id>
<latitude>25.0</latitude>
<longitude>50.0</longitude>
</VrpAirLocation>
<VrpAirLocation id="28">
<id>25</id>
<latitude>25.0</latitude>
<longitude>52.0</longitude>
</VrpAirLocation>
</locationList>
<depotList id="29">
<VrpTimeWindowedDepot id="30">
<id>0</id>
<location class="VrpAirLocation" reference="3"/>
<readyTime>0</readyTime>
<dueTime>1236000</dueTime>
</VrpTimeWindowedDepot>
</depotList>
<vehicleList id="31">
<VrpVehicle id="32">
<id>0</id>
<capacity>250</capacity>
<depot class="VrpTimeWindowedDepot" reference="30"/>
</VrpVehicle>
<VrpVehicle id="33">
<id>1</id>
<capacity>250</capacity>
<depot class="VrpTimeWindowedDepot" reference="30"/>
</VrpVehicle>
<VrpVehicle id="34">
<id>2</id>
<capacity>250</capacity>
<depot class="VrpTimeWindowedDepot" reference="30"/>
</VrpVehicle>
<VrpVehicle id="35">
<id>3</id>
<capacity>250</capacity>
<depot class="VrpTimeWindowedDepot" reference="30"/>
</VrpVehicle>
<VrpVehicle id="36">
<id>4</id>
<capacity>250</capacity>
<depot class="VrpTimeWindowedDepot" reference="30"/>
</VrpVehicle>
<VrpVehicle id="37">
<id>5</id>
<capacity>250</capacity>
<depot class="VrpTimeWindowedDepot" reference="30"/>
</VrpVehicle>
<VrpVehicle id="38">
<id>6</id>
<capacity>250</capacity>
<depot class="VrpTimeWindowedDepot" reference="30"/>
</VrpVehicle>
<VrpVehicle id="39">
<id>7</id>
<capacity>250</capacity>
<depot class="VrpTimeWindowedDepot" reference="30"/>
</VrpVehicle>
<VrpVehicle id="40">
<id>8</id>
<capacity>250</capacity>
<depot class="VrpTimeWindowedDepot" reference="30"/>
</VrpVehicle>
<VrpVehicle id="41">
<id>9</id>
<capacity>250</capacity>
<depot class="VrpTimeWindowedDepot" reference="30"/>
</VrpVehicle>
<VrpVehicle id="42">
<id>10</id>
<capacity>250</capacity>
<depot class="VrpTimeWindowedDepot" reference="30"/>
</VrpVehicle>
<VrpVehicle id="43">
<id>11</id>
<capacity>250</capacity>
<depot class="VrpTimeWindowedDepot" reference="30"/>
</VrpVehicle>
<VrpVehicle id="44">
<id>12</id>
<capacity>250</capacity>
<depot class="VrpTimeWindowedDepot" reference="30"/>
</VrpVehicle>
<VrpVehicle id="45">
<id>13</id>
<capacity>250</capacity>
<depot class="VrpTimeWindowedDepot" reference="30"/>
</VrpVehicle>
<VrpVehicle id="46">
<id>14</id>
<capacity>250</capacity>
<depot class="VrpTimeWindowedDepot" reference="30"/>
</VrpVehicle>
<VrpVehicle id="47">
<id>15</id>
<capacity>250</capacity>
<depot class="VrpTimeWindowedDepot" reference="30"/>
</VrpVehicle>
<VrpVehicle id="48">
<id>16</id>
<capacity>250</capacity>
<depot class="VrpTimeWindowedDepot" reference="30"/>
</VrpVehicle>
<VrpVehicle id="49">
<id>17</id>
<capacity>250</capacity>
<depot class="VrpTimeWindowedDepot" reference="30"/>
</VrpVehicle>
<VrpVehicle id="50">
<id>18</id>
<capacity>250</capacity>
<depot class="VrpTimeWindowedDepot" reference="30"/>
</VrpVehicle>
<VrpVehicle id="51">
<id>19</id>
<capacity>250</capacity>
<depot class="VrpTimeWindowedDepot" reference="30"/>
</VrpVehicle>
<VrpVehicle id="52">
<id>20</id>
<capacity>250</capacity>
<depot class="VrpTimeWindowedDepot" reference="30"/>
</VrpVehicle>
<VrpVehicle id="53">
<id>21</id>
<capacity>250</capacity>
<depot class="VrpTimeWindowedDepot" reference="30"/>
</VrpVehicle>
<VrpVehicle id="54">
<id>22</id>
<capacity>250</capacity>
<depot class="VrpTimeWindowedDepot" reference="30"/>
</VrpVehicle>
<VrpVehicle id="55">
<id>23</id>
<capacity>250</capacity>
<depot class="VrpTimeWindowedDepot" reference="30"/>
</VrpVehicle>
<VrpVehicle id="56">
<id>24</id>
<capacity>250</capacity>
<depot class="VrpTimeWindowedDepot" reference="30"/>
</VrpVehicle>
</vehicleList>
<customerList id="57">
<VrpTimeWindowedCustomer id="58">
<id>1</id>
<location class="VrpAirLocation" reference="4"/>
<demand>10</demand>
<readyTime>9000</readyTime>
<dueTime>1967000</dueTime>
<serviceDuration>900000</serviceDuration>
</VrpTimeWindowedCustomer>
<VrpTimeWindowedCustomer id="59">
<id>2</id>
<location class="VrpAirLocation" reference="5"/>
<demand>30</demand>
<readyTime>8000</readyTime>
<dueTime>1870000</dueTime>
<serviceDuration>900000</serviceDuration>
</VrpTimeWindowedCustomer>
<VrpTimeWindowedCustomer id="60">
<id>3</id>
<location class="VrpAirLocation" reference="6"/>
<demand>10</demand>
<readyTime>6000</readyTime>
<dueTime>1146000</dueTime>
<serviceDuration>900000</serviceDuration>
</VrpTimeWindowedCustomer>
<VrpTimeWindowedCustomer id="61">
<id>4</id>
<location class="VrpAirLocation" reference="7"/>
<demand>10</demand>
<readyTime>7000</readyTime>
<dueTime>1782000</dueTime>
<serviceDuration>900000</serviceDuration>
</VrpTimeWindowedCustomer>
<VrpTimeWindowedCustomer id="62">
<id>5</id>
<location class="VrpAirLocation" reference="8"/>
<demand>10</demand>
<readyTime>1000</readyTime>
<dueTime>167000</dueTime>
<serviceDuration>900000</serviceDuration>
</VrpTimeWindowedCustomer>
<VrpTimeWindowedCustomer id="63">
<id>6</id>
<location class="VrpAirLocation" reference="9"/>
<demand>20</demand>
<readyTime>6000</readyTime>
<dueTime>1702000</dueTime>
<serviceDuration>9000</serviceDuration>
</VrpTimeWindowedCustomer>
<VrpTimeWindowedCustomer id="64">
<id>7</id>
<location class="VrpAirLocation" reference="10"/>
<demand>20</demand>
<readyTime>1000</readyTime>
<dueTime>1225000</dueTime>
<serviceDuration>9000</serviceDuration>
</VrpTimeWindowedCustomer>
<VrpTimeWindowedCustomer id="65">
<id>8</id>
<location class="VrpAirLocation" reference="11"/>
<demand>20</demand>
<readyTime>5000</readyTime>
<dueTime>1324000</dueTime>
<serviceDuration>9000</serviceDuration>
</VrpTimeWindowedCustomer>
<VrpTimeWindowedCustomer id="66">
<id>9</id>
<location class="VrpAirLocation" reference="12"/>
<demand>10</demand>
<readyTime>4000</readyTime>
<dueTime>1605000</dueTime>
<serviceDuration>9000</serviceDuration>
</VrpTimeWindowedCustomer>
<VrpTimeWindowedCustomer id="67">
<id>10</id>
<location class="VrpAirLocation" reference="13"/>
<demand>10</demand>
<readyTime>7000</readyTime>
<dueTime>1410000</dueTime>
<serviceDuration>9000</serviceDuration>
</VrpTimeWindowedCustomer>
<VrpTimeWindowedCustomer id="68">
<id>11</id>
<location class="VrpAirLocation" reference="14"/>
<demand>10</demand>
<readyTime>8000</readyTime>
<dueTime>1505000</dueTime>
<serviceDuration>9000</serviceDuration>
</VrpTimeWindowedCustomer>
<VrpTimeWindowedCustomer id="69">
<id>12</id>
<location class="VrpAirLocation" reference="15"/>
<demand>20</demand>
<readyTime>2000</readyTime>
<dueTime>1721000</dueTime>
<serviceDuration>9000</serviceDuration>
</VrpTimeWindowedCustomer>
<VrpTimeWindowedCustomer id="70">
<id>13</id>
<location class="VrpAirLocation" reference="16"/>
<demand>30</demand>
<readyTime>3000</readyTime>
<dueTime>192000</dueTime>
<serviceDuration>9000</serviceDuration>
</VrpTimeWindowedCustomer>
<VrpTimeWindowedCustomer id="71">
<id>14</id>
<location class="VrpAirLocation" reference="17"/>
<demand>10</demand>
<readyTime>7000</readyTime>
<dueTime>1620000</dueTime>
<serviceDuration>9000</serviceDuration>
</VrpTimeWindowedCustomer>
<VrpTimeWindowedCustomer id="72">
<id>15</id>
<location class="VrpAirLocation" reference="18"/>
<demand>40</demand>
<readyTime>4000</readyTime>
<dueTime>1429000</dueTime>
<serviceDuration>9000</serviceDuration>
</VrpTimeWindowedCustomer>
<VrpTimeWindowedCustomer id="73">
<id>16</id>
<location class="VrpAirLocation" reference="19"/>
<demand>40</demand>
<readyTime>5000</readyTime>
<dueTime>1528000</dueTime>
<serviceDuration>9000</serviceDuration>
</VrpTimeWindowedCustomer>
<VrpTimeWindowedCustomer id="74">
<id>17</id>
<location class="VrpAirLocation" reference="20"/>
<demand>20</demand>
<readyTime>9000</readyTime>
<dueTime>1148000</dueTime>
<serviceDuration>9000</serviceDuration>
</VrpTimeWindowedCustomer>
<VrpTimeWindowedCustomer id="75">
<id>18</id>
<location class="VrpAirLocation" reference="21"/>
<demand>20</demand>
<readyTime>9000</readyTime>
<dueTime>1254000</dueTime>
<serviceDuration>9000</serviceDuration>
</VrpTimeWindowedCustomer>
<VrpTimeWindowedCustomer id="76">
<id>19</id>
<location class="VrpAirLocation" reference="22"/>
<demand>10</demand>
<readyTime>8000</readyTime>
<dueTime>1345000</dueTime>
<serviceDuration>9000</serviceDuration>
</VrpTimeWindowedCustomer>
<VrpTimeWindowedCustomer id="77">
<id>20</id>
<location class="VrpAirLocation" reference="23"/>
<demand>10</demand>
<readyTime>1000</readyTime>
<dueTime>173000</dueTime>
<serviceDuration>9000</serviceDuration>
</VrpTimeWindowedCustomer>
<VrpTimeWindowedCustomer id="78">
<id>21</id>
<location class="VrpAirLocation" reference="24"/>
<demand>20</demand>
<readyTime>4000</readyTime>
<dueTime>1965000</dueTime>
<serviceDuration>9000</serviceDuration>
</VrpTimeWindowedCustomer>
<VrpTimeWindowedCustomer id="79">
<id>22</id>
<location class="VrpAirLocation" reference="25"/>
<demand>20</demand>
<readyTime>2000</readyTime>
<dueTime>1083000</dueTime>
<serviceDuration>9000</serviceDuration>
</VrpTimeWindowedCustomer>
<VrpTimeWindowedCustomer id="80">
<id>23</id>
<location class="VrpAirLocation" reference="26"/>
<demand>10</demand>
<readyTime>2000</readyTime>
<dueTime>1077000</dueTime>
<serviceDuration>9000</serviceDuration>
</VrpTimeWindowedCustomer>
<VrpTimeWindowedCustomer id="81">
<id>24</id>
<location class="VrpAirLocation" reference="27"/>
<demand>10</demand>
<readyTime>5000</readyTime>
<dueTime>1144000</dueTime>
<serviceDuration>9000</serviceDuration>
</VrpTimeWindowedCustomer>
<VrpTimeWindowedCustomer id="82">
<id>25</id>
<location class="VrpAirLocation" reference="28"/>
<demand>40</demand>
<readyTime>9000</readyTime>
<dueTime>1024000</dueTime>
<serviceDuration>9000</serviceDuration>
</VrpTimeWindowedCustomer>
</customerList>
</VrpTimeWindowedVehicleRoutingSolution>
我得到的只是文件夹创建,但在“sub0”(例如First Fit&gt; Sub0)内部什么都没有。我错过了什么?如何实施基准测试?
EDIT
我已运行该应用程序并收到反馈说“编译在3s 241ms成功完成”。我所做的就是VehicleRoutingBenchmarkApp.class
。
它没有运行太长时间,我使用项目附带的默认vehicleRoutingBenchmarkConfig.xml
文件将其单独放置了3个小时。没有生成index.html
个文件。如您所见,我已将benchmarkDirectory指向以下路径local/data/report/vehiclerouting
。就文档说,这就是我可以配置如何在本地保存报告的方法。有什么我想念的吗?