{"id":29659344,"url":"https://github.com/jeds6391/lgp","last_synced_at":"2025-10-12T20:50:41.527Z","repository":{"id":53843375,"uuid":"88687241","full_name":"JedS6391/LGP","owner":"JedS6391","description":"A robust Linear Genetic Programming implementation on the JVM using Kotlin.","archived":false,"fork":false,"pushed_at":"2021-10-25T05:46:17.000Z","size":5404,"stargazers_count":18,"open_issues_count":5,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-10T18:06:44.047Z","etag":null,"topics":["ai","genetic-programming","gp","jvm","kotlin","lgp","linear-genetic-programming","machine-learning"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JedS6391.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-04-19T01:37:49.000Z","updated_at":"2024-07-03T05:11:35.000Z","dependencies_parsed_at":"2022-08-22T20:51:05.801Z","dependency_job_id":null,"html_url":"https://github.com/JedS6391/LGP","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/JedS6391/LGP","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JedS6391%2FLGP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JedS6391%2FLGP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JedS6391%2FLGP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JedS6391%2FLGP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JedS6391","download_url":"https://codeload.github.com/JedS6391/LGP/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JedS6391%2FLGP/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279012807,"owners_count":26085191,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","genetic-programming","gp","jvm","kotlin","lgp","linear-genetic-programming","machine-learning"],"created_at":"2025-07-22T09:10:47.022Z","updated_at":"2025-10-12T20:50:41.499Z","avatar_url":"https://github.com/JedS6391.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LGP\n\n\u003e *A robust LGP implementation on the JVM using Kotlin.*\n\n[![license][license-image]][license-url]\n[![docs][docs-image]][docs-url]\n[![build][build-image]][build-url]\n[![code-coverage][code-coverage-image]][code-coverage-url]\n[![maven-core][maven-image-core]][maven-url-core]\n[![maven-lib][maven-image-lib]][maven-url-lib]\n[![DOI][doi-image]][doi-url]\n\n## About\n\nAn implementation of [Linear Genetic Programming](https://en.wikipedia.org/wiki/Linear_genetic_programming) that follows that outlined by *Linear Genetic Programming* (Brameier, M. F. and Banzhaf, W. 2007).\n\nThe framework is implemented in [Kotlin](https://kotlinlang.org) which allows for easily interoperability with Java (and other JVM languages), while adding the benefit of modern programming language features.\n\nTo get started with how to use the framework, see the [documentation](http://lgp.readthedocs.io/en/latest/).\n\nIf you find the framework useful or have any queries, please feel free to:\n\n- Create a [new issue](https://github.com/JedS6391/LGP/issues/new)\n- Contact me via my [website](http://www.jedsimson.co.nz/contact)\n- Send me an [email](mailto:jed.simson@gmail.com?Subject=LGP)\n\n## Installation\n\n\u003csmall\u003e*Note: The LGP framework requires JDK 8 (Java 1.8).*\u003c/small\u003e\n\nA JAR containing the core API can be downloaded from the [releases](https://github.com/JedS6391/LGP/releases/) page. Each version will have its artefact uploaded here.\n\nAlternatively, the package is available on Maven central, so you can reference the package as a dependency using the format appropriate for your package manager (see [here](https://search.maven.org/artifact/nz.co.jedsimson.lgp/LGP) for a full list). For example, to add to an existing Gradle build script:\n\n```gradle\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    // Core abstractions and components of the LGP framework\n    compile \"nz.co.jedsimson.lgp:core:\u003cVERSION\u003e\"\n    // To get the full source, include the sources package\n    compile \"nz.co.jedsimson.lgp:core:\u003cVERSION\u003e:sources\"\n    \n    // Implementations for core LGP framework components\n    compile \"nz.co.jedsimson.lgp:lib:\u003cVERSION\u003e\"\n    // To get the full source, include the sources package\n    compile \"nz.co.jedsimson.lgp:lib:\u003cVERSION\u003e:sources\"\n}\n```\n\n## Tests\n\nThe test suite for the framework can be run with the following gradle command:\n\n```bash\n./gradlew test --info --rerun-tasks\n```\n\n## Usage\n\n### Examples\n\nA set of example usages can be found in the [LGP-examples](https://github.com/JedS6391/LGP-examples) repository. The examples cover a few different problem configurations, including:\n\n- Programs with a single or multiple outputs\n- Reading dataset from a file\n- Generating a dataset\n- Custom fitness functions\n- Usage from Java\n\n### Getting started\n\nThe framework is built using Kotlin and the easiest way to use it is through the Kotlin API. Instructions for installation and usage of the Kotlin compiler, `kotlinc`, can be found for the [Command Line](https://kotlinlang.org/docs/tutorials/command-line.html) or [IntelliJ IDEA](https://kotlinlang.org/docs/tutorials/getting-started.html). \n\nHere, we'll focus on how to use the framework through Kotlin (particularly from the command line) but documentation is provided for using the API through Java. This guide assumes you want to directly use the JAR file and not through another build system.\n\nAssuming that `kotlinc` is installed and available at the command line, the first step is to download the core API JAR file as described in the *Installation* section. You will also want to download the [LGP-lib](https://github.com/JedS6391/LGP-lib/releases) package which provides implementations of core components, particularly `BaseProblem` which we will use in this example.\n\nNext, create a blank Kotlin file that will contain the problem definition --- typically this would have a filename matching that of the problem:\n\n```bash\ntouch MyProblem.kt\n```\n\nWe're not going to fully define the problem as that would be a needlessly extensive exercise, so we'll simply show how to import classes from the API and build against the imported classes.\n\nIn `MyProblem.kt`, enter the following content:\n\n```kotlin\nimport nz.co.jedsimson.lgp.core.environment.config.Configuration\nimport nz.co.jedsimson.lgp.core.evolution.Description\nimport nz.co.jedsimson.lgp.lib.base.BaseProblem\nimport nz.co.jedsimson.lgp.lib.base.BaseProblemParameters\n\nfun main(args: Array\u003cString\u003e) {\n    val parameters = BaseProblemParameters(\n        name = \"My Problem\",\n        description = Description(\"A simple example problem definition\"),\n        config = Configuration()\n    )\n\n    val problem = BaseProblem(parameters)\n\n    println(problem.name)\n    println(problem.description)\n}\n```\n\nHere, we use the `BaseProblem` implementation to use a default set of parameters that we can quickly test against using a data set (which is omitted here).\n\nTo compile, we use `kotlinc`:\n\n```bash\nkotlinc -cp LGP-core.jar:LGP-lib.jar -no-jdk -no-stdlib MyProblem.kt\n```\n\nThis will generate a class file in the directory called `MyProblemKt.class`. To interpret the class file using the Kotlin interpreter is simple:\n\n```bash\nkotlin -cp LGP-core.jar:LGP-lib.jar:. MyProblemKt\n```\n\nYou should see the following output:\n\n```text\nMy Problem\nDescription(description=A simple example problem definition)\n```\n\nPlease refer to the [usage guide](http://lgp.readthedocs.io/en/latest/guide/usage.html#with-java) for instructions on using the API from the context of a Java program.\n\n[license-image]: https://img.shields.io/github/license/mashape/apistatus.svg?style=flat\n[license-url]: https://github.com/JedS6391/LGP/blob/master/LICENSE\n[docs-image]: https://readthedocs.org/projects/lgp/badge/?version=stable\u0026style=flat\n[docs-url]: http://lgp.readthedocs.io/en/latest/\n[build-image]: https://img.shields.io/github/workflow/status/JedS6391/LGP/Release\n[build-url]: https://github.com/JedS6391/LGP/actions/workflows/release.yml\n[maven-image-core]: https://img.shields.io/maven-central/v/nz.co.jedsimson.lgp/core.svg?label=core\u0026style=flat\n[maven-url-core]: https://search.maven.org/search?q=g:%22nz.co.jedsimson.lgp%22%20AND%20a:%22core%22\n[maven-image-lib]: https://img.shields.io/maven-central/v/nz.co.jedsimson.lgp/lib.svg?label=lib\u0026style=flat\n[maven-url-lib]: https://search.maven.org/search?q=g:%22nz.co.jedsimson.lgp%22%20AND%20a:%22lib%22\n[code-coverage-image]:https://img.shields.io/codecov/c/github/JedS6391/LGP.svg\n[code-coverage-url]:https://codecov.io/gh/JedS6391/LGP/branch/develop/\n[doi-image]:https://joss.theoj.org/papers/10.21105/joss.01337/status.svg\n[doi-url]:https://doi.org/10.21105/joss.01337\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeds6391%2Flgp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeds6391%2Flgp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeds6391%2Flgp/lists"}