2016-07-01 2 views
0

OptaPlanner를 사용한 벤치마킹에 대한 도움이 필요합니다. 내가 겪고있는 두 가지 문제가 있습니다. 첫 번째는 제공된 예제를 벤치마킹 한 결과입니다. 나는 vehiclerouting 예가 2 개의 응용을 가지고있는 것을 안다. 그 중 하나는 "VehicleRoutingBenchmarkApp"입니다. 나는이 응용 프로그램을 돌렸지 만 index.html이 생성 될 것이라고 생각했지만 그렇지 않았습니다. 그래서 나는 이것을하는 방법에 대해 명확하지 않습니다.optaplanner에서 Benchmark를 실행/구현하는 방법은 무엇입니까?

두 번째 문제는 구현입니다. 나는 실험하고있는 중이다. 그래서 VehicleRoutingApp main()의 문서에서 지시 한대로 코드 스 니펫을 추가 했으므로 어떤 일이 일어날 지 알 수있다.

문서 링크 : https://docs.jboss.org/drools/release/6.0.0.CR3/optaplanner-docs/html/benchmarkingAndTweaking.html

System.out.println("-------------- benchmark stuff --------------"); 
     PlannerBenchmarkFactory plannerBenchmarkFactory = PlannerBenchmarkFactory.createFromXmlResource(
       "org/optaplanner/examples/vehiclerouting/benchmark/vehicleRoutingBenchmarkConfig.xml"); 
     PlannerBenchmark plannerBenchmark = plannerBenchmarkFactory.buildPlannerBenchmark(); 
     plannerBenchmark.benchmark(); 

이 결과를 출력 로그의 일정한 흐름이다. 그것이 전달되는 것을 따라하기가 어렵습니다. index.html이 할 수 있다고 생각하는 것처럼 멋진 GUI로 번역 된 모든 것을 어떻게 얻을 수 있습니까? 미리 감사드립니다. 이 솔루션은 사용자의 참조 benchmarkConfig.xml 파일에, optaplanner을 배우려고 노력 분들을 위해

Exception in thread "main" java.lang.IllegalStateException: The directory dataDir (C:\Intellij\Workspace\optaplanner-developer\data\vehiclerouting) does not exist. 
Either the working directory should be set to the directory that contains the data directory (which is not the data directory itself), or the system property org.optaplanner.examples.dataDir should be set properly. 
The data directory is different in a git clone (optaplanner/optaplanner-examples/data) and in a release zip (examples/sources/data). 
In an IDE (IntelliJ, Eclipse, NetBeans), open the "Run configuration" to change "Working directory" (or add the system property in "VM options"). 
    at org.optaplanner.examples.common.persistence.AbstractSolutionDao.<init>(AbstractSolutionDao.java:46) 
    at org.optaplanner.examples.common.persistence.XStreamSolutionDao.<init>(XStreamSolutionDao.java:32) 
    at org.optaplanner.examples.vehiclerouting.persistence.VehicleRoutingDao.<init>(VehicleRoutingDao.java:25) 
    at org.optaplanner.examples.vehiclerouting.persistence.VehicleRoutingImporter.<init>(VehicleRoutingImporter.java:57) 
    at org.optaplanner.examples.vehiclerouting.persistence.VehicleRoutingFileIO.<init>(VehicleRoutingFileIO.java:28) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) 
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423) 
    at java.lang.Class.newInstance(Class.java:442) 
    at org.optaplanner.core.config.util.ConfigUtils.newInstance(ConfigUtils.java:46) 
    at org.optaplanner.benchmark.config.ProblemBenchmarksConfig.buildSolutionFileIO(ProblemBenchmarksConfig.java:149) 
    at org.optaplanner.benchmark.config.ProblemBenchmarksConfig.buildProblemBenchmarkList(ProblemBenchmarksConfig.java:111) 
    at org.optaplanner.benchmark.config.SolverBenchmarkConfig.buildSolverBenchmark(SolverBenchmarkConfig.java:88) 
    at org.optaplanner.benchmark.config.PlannerBenchmarkConfig.buildPlannerBenchmark(PlannerBenchmarkConfig.java:210) 
    at org.optaplanner.benchmark.impl.XStreamXmlPlannerBenchmarkFactory.buildPlannerBenchmark(XStreamXmlPlannerBenchmarkFactory.java:156) 
    at org.optaplanner.examples.common.app.CommonBenchmarkApp.buildAndBenchmark(CommonBenchmarkApp.java:68) 
    at org.optaplanner.examples.vehiclerouting.app.VehicleRoutingBenchmarkApp.main(VehicleRoutingBenchmarkApp.java:24) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:498) 
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144) 
+1

'VehicleRoutingBenchmarkApp'가 상자 밖으로 작동합니다

은 다음과 유사 보일 것이다. 'optaplanner-examples'로 설정된 작업 디렉토리로 실행되는지 확인하십시오 (IntelliJ에서는 기본값이지만 Eclipse에서는 그렇지 않습니다). 스택 트레이스가 없으면 복사를 여기에 붙여 넣으십시오. –

답변

1

과 같은 질문이 있습니다

내가 점점 오전 tracestack은 다음과 같다. 루트 <plannerBenchmark> 태그가있는 xml을 만들어야합니다. 이 안에 <benchmarkDiretory>이라는 또 다른 태그를 추가 할 수 있습니다. 여기에서 보고서를 생성 할 위치를 지정할 수 있습니다. <inputSolutionFile>을 올바른 데이터 세트 (.xml 또는 .vrp)를 가리 키도록 설정하십시오. 나머지는 마술처럼 작동합니다.

<plannerBenchmark> 
    <benchmarkDirectory>local/data/report/vehiclerouting</benchmarkDirectory> 
    ..... 
    <inputSolutionFile>data/vehiclerouting/unsolved/TestCase_1.xml</inputSolutionFile> 
    ..... 
</plannerBenchmark> 
관련 문제