Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hrtwt opened this issue Dec 16, 2022 · 1 comment · May be fixed by #862
Open

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

hrtwt opened this issue Dec 16, 2022 · 1 comment · May be fixed by #862
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@hrtwt
Copy link
Contributor

hrtwt commented Dec 16, 2022

概要

| `--crossover-type` | Specifies crossover type. (`Random`, `Single`, `Uniform`, `Cascade`). | `Random` |

Single ではなく SinglePoint が正しい.

解決策

READMEが間違っているだけなので,READMEを修正すればよい.
ja版も忘れずに.

| `--crossover-type` | 交叉種別(`Random``Single``Uniform`, `Cascade`| `Random` |

@hrtwt hrtwt added bug Something isn't working good first issue Good for newcomers labels Dec 16, 2022
@hrtwt
Copy link
Contributor Author

hrtwt commented Dec 16, 2022

検証ログ

環境の確認

$ 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

@hrtwt hrtwt linked a pull request Dec 16, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant