LGP

LGP: A robust Linear Genetic Programming implementation on the JVM using Kotlin. - Published in JOSS (2019)

https://github.com/jeds6391/lgp

Science Score: 93.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

ai genetic-programming gp jvm kotlin lgp linear-genetic-programming machine-learning
Last synced: 6 months ago · JSON representation

Repository

A robust Linear Genetic Programming implementation on the JVM using Kotlin.

Basic Info
  • Host: GitHub
  • Owner: JedS6391
  • License: mit
  • Language: Kotlin
  • Default Branch: master
  • Homepage:
  • Size: 5.15 MB
Statistics
  • Stars: 18
  • Watchers: 1
  • Forks: 4
  • Open Issues: 5
  • Releases: 14
Topics
ai genetic-programming gp jvm kotlin lgp linear-genetic-programming machine-learning
Created almost 9 years ago · Last pushed over 4 years ago
Metadata Files
Readme Changelog License

README.md

LGP

A robust LGP implementation on the JVM using Kotlin.

license docs build code-coverage maven-core maven-lib DOI

About

An implementation of Linear Genetic Programming that follows that outlined by Linear Genetic Programming (Brameier, M. F. and Banzhaf, W. 2007).

The framework is implemented in Kotlin which allows for easily interoperability with Java (and other JVM languages), while adding the benefit of modern programming language features.

To get started with how to use the framework, see the documentation.

If you find the framework useful or have any queries, please feel free to:

Installation

Note: The LGP framework requires JDK 8 (Java 1.8).

A JAR containing the core API can be downloaded from the releases page. Each version will have its artefact uploaded here.

Alternatively, 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 for a full list). For example, to add to an existing Gradle build script:

```gradle repositories { mavenCentral() }

dependencies { // Core abstractions and components of the LGP framework compile "nz.co.jedsimson.lgp:core:" // To get the full source, include the sources package compile "nz.co.jedsimson.lgp:core::sources"

// Implementations for core LGP framework components
compile "nz.co.jedsimson.lgp:lib:<VERSION>"
// To get the full source, include the sources package
compile "nz.co.jedsimson.lgp:lib:<VERSION>:sources"

} ```

Tests

The test suite for the framework can be run with the following gradle command:

bash ./gradlew test --info --rerun-tasks

Usage

Examples

A set of example usages can be found in the LGP-examples repository. The examples cover a few different problem configurations, including:

  • Programs with a single or multiple outputs
  • Reading dataset from a file
  • Generating a dataset
  • Custom fitness functions
  • Usage from Java

Getting started

The 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 or IntelliJ IDEA.

Here, 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.

Assuming 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 package which provides implementations of core components, particularly BaseProblem which we will use in this example.

Next, create a blank Kotlin file that will contain the problem definition --- typically this would have a filename matching that of the problem:

bash touch MyProblem.kt

We'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.

In MyProblem.kt, enter the following content:

```kotlin import nz.co.jedsimson.lgp.core.environment.config.Configuration import nz.co.jedsimson.lgp.core.evolution.Description import nz.co.jedsimson.lgp.lib.base.BaseProblem import nz.co.jedsimson.lgp.lib.base.BaseProblemParameters

fun main(args: Array) { val parameters = BaseProblemParameters( name = "My Problem", description = Description("A simple example problem definition"), config = Configuration() )

val problem = BaseProblem(parameters)

println(problem.name)
println(problem.description)

} ```

Here, 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).

To compile, we use kotlinc:

bash kotlinc -cp LGP-core.jar:LGP-lib.jar -no-jdk -no-stdlib MyProblem.kt

This will generate a class file in the directory called MyProblemKt.class. To interpret the class file using the Kotlin interpreter is simple:

bash kotlin -cp LGP-core.jar:LGP-lib.jar:. MyProblemKt

You should see the following output:

text My Problem Description(description=A simple example problem definition)

Please refer to the usage guide for instructions on using the API from the context of a Java program.

Owner

  • Name: Jed Simson
  • Login: JedS6391
  • Kind: user
  • Location: New Zealand

JOSS Publication

LGP: A robust Linear Genetic Programming implementation on the JVM using Kotlin.
Published
October 27, 2019
Volume 4, Issue 42, Page 1337
Authors
Jed Simson ORCID
University of Waikato, Waikato, New Zealand
Editor
George K. Thiruvathukal ORCID
Tags
JVM Linear Genetic Programming Genetic Programming Machine Learning

GitHub Events

Total
Last Year

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 433
  • Total Committers: 3
  • Avg Commits per committer: 144.333
  • Development Distribution Score (DDS): 0.005
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Jed Simson j****n@g****m 431
hw168 h****8@s****z 1
Ulrik Guenther h****o@u****s 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 22
  • Total pull requests: 50
  • Average time to close issues: 7 months
  • Average time to close pull requests: about 21 hours
  • Total issue authors: 3
  • Total pull request authors: 3
  • Average comments per issue: 0.68
  • Average comments per pull request: 0.48
  • Merged pull requests: 49
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • JedS6391 (18)
  • homonecloco (3)
  • mmayo888 (1)
Pull Request Authors
  • JedS6391 (48)
  • skalarproduktraum (1)
  • HongyuJerryWang (1)
Top Labels
Issue Labels
enhancement (9) investigation (3) bug (2) help wanted (1)
Pull Request Labels
enhancement (3)

Packages

  • Total packages: 3
  • Total downloads: unknown
  • Total dependent packages: 2
    (may contain duplicates)
  • Total dependent repositories: 3
    (may contain duplicates)
  • Total versions: 9
repo1.maven.org: nz.co.jedsimson.lgp:core

A robust Linear Genetic Programming implementation on the JVM using Kotlin.

  • Versions: 1
  • Dependent Packages: 1
  • Dependent Repositories: 1
Rankings
Dependent repos count: 20.8%
Dependent packages count: 33.0%
Average: 34.4%
Stargazers count: 40.1%
Forks count: 43.8%
Last synced: 6 months ago
repo1.maven.org: nz.co.jedsimson.lgp:LGP

A robust Linear Genetic Programming implementation on the JVM using Kotlin.

  • Versions: 7
  • Dependent Packages: 1
  • Dependent Repositories: 1
Rankings
Dependent repos count: 20.8%
Dependent packages count: 33.0%
Average: 34.4%
Stargazers count: 40.1%
Forks count: 43.8%
Last synced: 6 months ago
repo1.maven.org: nz.co.jedsimson.lgp:lib

A library of implementations for core LGP framework components.

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 1
Rankings
Dependent repos count: 20.8%
Average: 38.7%
Stargazers count: 40.1%
Forks count: 43.8%
Dependent packages count: 50.1%
Last synced: 6 months ago

Dependencies

core/build.gradle.kts maven
  • com.google.code.gson:gson 2.8.8 implementation
  • com.opencsv:opencsv 5.5.2 implementation
  • io.github.microutils:kotlin-logging-jvm 2.0.10 implementation
  • org.jetbrains.kotlin:kotlin-stdlib-jdk8 * implementation
  • org.jetbrains.kotlinx:kotlinx-coroutines-core 1.3.1 implementation
  • org.junit.jupiter:junit-jupiter-api 5.8.1 testCompileOnly
  • org.junit.jupiter:junit-jupiter-params 5.8.1 testCompileOnly
  • com.nhaarman.mockitokotlin2:mockito-kotlin 2.2.0 testImplementation
  • org.spekframework.spek2:spek-dsl-jvm 2.0.17 testImplementation
  • org.junit.jupiter:junit-jupiter-engine 5.8.1 testRuntimeOnly
  • org.spekframework.spek2:spek-runner-junit5 2.0.17 testRuntimeOnly
lib/build.gradle.kts maven
  • com.fasterxml.jackson.core:jackson-databind 2.13.0 implementation
  • com.fasterxml.jackson.dataformat:jackson-dataformat-yaml 2.13.0 implementation
  • com.fasterxml.jackson.module:jackson-module-kotlin 2.13.0 implementation
  • org.jetbrains.kotlin:kotlin-stdlib-jdk8 * implementation