kusumotolab / kGenProg

A High-performance, High-extensibility and High-portability APR System
MIT License
48 stars 13 forks source link

READMEのcrossover-typeが間違っている #861

Open hrtwt opened 1 year ago

hrtwt commented 1 year ago

概要

https://github.com/kusumotolab/kGenProg/blob/7f59a4358b0e9022873249a2adaf72272b4c2ff0/README.md?plain=1#L112 Single ではなく SinglePoint が正しい.

解決策

READMEが間違っているだけなので,READMEを修正すればよい. ja版も忘れずに. https://github.com/kusumotolab/kGenProg/blob/7f59a4358b0e9022873249a2adaf72272b4c2ff0/docs/ja/README.md?plain=1#L112

hrtwt commented 1 year ago

検証ログ

環境の確認

$ java -version
openjdk version "11.0.16" 2022-07-19 LTS
OpenJDK Runtime Environment Corretto-11.0.16.8.1 (build 11.0.16+8-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.16.8.1 (build 11.0.16+8-LTS, mixed mode)

Singleでは動作しない

$ ./gradlew build
example/CloseToZero01$ java -jar ../../build/libs/kGenProg-1.8.2.jar --config kgenprog.toml --crossover-type Single

2022-12-16 21:16:50 [main] [ERROR] CUILauncher - "Single" is not a valid value for "--crossover-type"
java.lang.IllegalArgumentException: "Single" is not a valid value for "--crossover-type"
        at jp.kusumotolab.kgenprog.Configuration$Builder.createFromCmdLineArgs(Configuration.java:385)
        at jp.kusumotolab.kgenprog.Configuration$Builder.buildFromCmdLineArgs(Configuration.java:352)
        at jp.kusumotolab.kgenprog.CUILauncher.main(CUILauncher.java:30)

SinglePointでは動作する

example/CloseToZero01$ java -jar ../../build/libs/kGenProg-1.8.2.jar --config kgenprog.toml --crossover-type SinglePoint
2022-12-16 21:16:55 [main] [INFO]  KGenProgMain -
==================== kGenProg Configuration ====================
configPath = kgenprog.toml (set by command line)
rootDir =  (set in config file)
productPaths = [src/example/CloseToZero.java] (set in config file)
testPaths = [src/example/CloseToZeroTest.java] (set in config file)
classPaths = []
executionTests = []
outDir = kgenprog-out
logLevel = INFO (set in config file)
mutationGeneratingCount = 10
crossoverGeneratingCount = 10
headcount = 10
maxGeneration = 10
timeLimit = PT1M
testTimeLimit = PT10S
requiredSolutionsCount = 1
randomSeed = 0
scope = PACKAGE
faultLocalization = Ochiai
mutationType = Simple
crossoverType = SinglePoint (set by command line)
firstVariantSelectionStrategy = Random
secondVariantSelectionStrategy = Random
isPatchOutput = false
isHistoryRecord = false
currentDirectory = /mnt/c/Users/h-watanb/Downloads/kGenProg-master/example/CloseToZero01
version = 1.8.2+
================================================================
2022-12-16 21:16:56 [main] [INFO]  KGenProgMain - initial failed tests (1/4)
example.CloseToZeroTest.test03: expected:<0> but was:<1>

2022-12-16 21:16:56 [main] [INFO]  KGenProgMain - GA started
2022-12-16 21:16:56 [main] [INFO]  KGenProgMain - entered the era of 1st generation.
2022-12-16 21:16:56 [main] [INFO]  KGenProgMain -
----------------------------------------------------------------
Elapsed time: 0 seconds
Variants: generated 7, build-succeeded 3, build-failed 1, syntax-invalid 0, redundant 3
Fitness: max 1(1), min 0.75(2), ave 0.833
Test execution time: sum 21 ms, max 8 ms, min 6 ms
----------------------------------------------------------------

2022-12-16 21:16:56 [main] [INFO]  KGenProgMain - GA stopped
2022-12-16 21:16:56 [main] [INFO]  PatchLogExporter - patch (v7)
--- example.CloseToZero
+++ example.CloseToZero
@@ -16,7 +16,6 @@
    */
   public int close_to_zero(int n) {
     if (n == 0) {
-      n++; // bug here
     } else if (n > 0) {
       n--;
     } else {
2022-12-16 21:16:56 [main] [INFO]  KGenProgMain - Summary
Reached generation = 1
Generated variants = 7
Syntax valid variants = 7
Build succeeded variants = 3
Time elapsed = 0 seconds
Exit status = SUCCESS