{"id":15765490,"url":"https://github.com/cicirello/jpt-examples","last_synced_at":"2025-05-07T13:45:29.208Z","repository":{"id":38242726,"uuid":"333189072","full_name":"cicirello/jpt-examples","owner":"cicirello","description":"Example programs for the JavaPermutationTools (JPT) library","archived":false,"fork":false,"pushed_at":"2025-05-06T11:26:01.000Z","size":299,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-06T12:48:25.983Z","etag":null,"topics":["distance","permutation-distance","permutations","sequences","string-distance"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cicirello.png","metadata":{"funding":{"github":"cicirello","patreon":null,"open_collective":null,"ko_fi":"cicirello","tidelift":null,"community_bridge":null,"liberapay":"cicirello","issuehunt":null,"otechie":null,"custom":null},"files":{"readme":"README.md","changelog":null,"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":"2021-01-26T19:10:36.000Z","updated_at":"2025-05-06T11:25:59.000Z","dependencies_parsed_at":"2023-11-07T13:28:25.234Z","dependency_job_id":"789dca73-608a-4b0c-a4af-3cf07333b53a","html_url":"https://github.com/cicirello/jpt-examples","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cicirello%2Fjpt-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cicirello%2Fjpt-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cicirello%2Fjpt-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cicirello%2Fjpt-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cicirello","download_url":"https://codeload.github.com/cicirello/jpt-examples/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252889693,"owners_count":21820228,"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","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":["distance","permutation-distance","permutations","sequences","string-distance"],"created_at":"2024-10-04T12:42:11.264Z","updated_at":"2025-05-07T13:45:29.189Z","avatar_url":"https://github.com/cicirello.png","language":"Java","readme":"# Example Programs for the JavaPermutationTools (JPT) Library\n\nCopyright (C) 2018-2024 Vincent A. Cicirello. https://www.cicirello.org/\n\n| __Packages and Releases__ | [![Maven Central](https://img.shields.io/maven-central/v/org.cicirello/jpt-examples.svg?label=Maven%20Central\u0026logo=apachemaven)](https://central.sonatype.com/artifact/org.cicirello/jpt-examples/) [![GitHub release (latest by date)](https://img.shields.io/github/v/release/cicirello/jpt-examples?logo=GitHub)](https://github.com/cicirello/jpt-examples/releases) |\n| :--- | :--- |\n| __Build Status__ | [![build](https://github.com/cicirello/jpt-examples/workflows/build/badge.svg)](https://github.com/cicirello/jpt-examples/actions/workflows/build.yml) [![CodeQL](https://github.com/cicirello/jpt-examples/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/cicirello/jpt-examples/actions/workflows/codeql-analysis.yml) |\n| __Security__ | [![Snyk security score](https://snyk-widget.herokuapp.com/badge/mvn/org.cicirello/jpt-examples/badge.svg)](https://snyk.io/vuln/maven%3Aorg.cicirello%3Ajpt-examples) [![Snyk Known Vulnerabilities](https://snyk.io/test/github/cicirello/jpt-examples/badge.svg)](https://snyk.io/test/github/cicirello/jpt-examples) |\n| __Other Information__ | [![GitHub](https://img.shields.io/github/license/cicirello/jpt-examples)](https://github.com/cicirello/jpt-examples/blob/main/LICENSE) [![style](https://img.shields.io/badge/style-Google%20Java%20Style-informational)](https://google.github.io/styleguide/javaguide.html) |\n| __Support__ | [![GitHub Sponsors](https://img.shields.io/badge/sponsor-30363D?logo=GitHub-Sponsors\u0026logoColor=#EA4AAA)](https://github.com/sponsors/cicirello) [![Liberapay](https://img.shields.io/badge/Liberapay-F6C915?logo=liberapay\u0026logoColor=black)](https://liberapay.com/cicirello) [![Ko-Fi](https://img.shields.io/badge/Ko--fi-F16061?logo=ko-fi\u0026logoColor=white)](https://ko-fi.com/cicirello) |\n\nThis repository contains several example programs of the \nusage of the [JavaPermutationTools (JPT)](https://jpt.cicirello.org) \nlibrary. The JavaPermutationTools (JPT) library provides Java classes \nand interfaces, etc that enable representing and generating permutations \nand sequences, as well as performing computation on permutations and \nsequences. It includes implementations of a variety of permutation \ndistance metrics as well as distance metrics on sequences (i.e., \nStrings, arrays, and other ordered data \ntypes). [JPT's source code](https://github.com/cicirello/JavaPermutationTools) is \nmaintained on GitHub, and the prebuilt jars of the library can be imported \nfrom [Maven Central](https://central.sonatype.com/artifact/org.cicirello/jpt/) \nusing maven or other build tools. The purpose of this repository is to \ndemonstrate usage of the major functionality of the JPT library.\n\n## The Example Programs\n\nThe source for several example programs is contained in this repository.\nRead the comments in the source code of the example programs \nfor a description of what they demonstrate, etc. Running the \nexamples without reading the source code, and comments, \nis not advised, since the output of the example programs \nrequires the context of the code samples to be meaningful.\n\n__Basic Functionality Examples__: The following \nexamples are of basic usage of various functionality of the library:\n* org.cicirello.examples.jpt.AverageDistance\n* org.cicirello.examples.jpt.TableOfDistances\n* org.cicirello.examples.jpt.PermutationExamples\n* org.cicirello.examples.jpt.SimpleDistanceExamples\n* org.cicirello.examples.jpt.SequenceDistanceExamples\n* org.cicirello.examples.jpt.PermutationHashCodes\n* org.cicirello.examples.jpt.RandomIndexerTimes\n\n__org.cicirello.replication.arxiv2019may__: There are four programs in this package that\nreplicate the data from the paper that defined the Kendall Tau Sequence Distance, along with\ndescriptions of the two algorithms for computing it used in the JPT.  Kendall Tau Sequence Distance\nis an extension of the well-known Kendall Tau Distance for permutations to be applicable to\nStrings and other sequences.  The data generated by these programs is that of the paper:\nV.A. Cicirello, \"Kendall Tau Sequence Distance: Extending Kendall Tau from Ranks to Sequences,\" \narXiv preprint arXiv:1905.02752 [cs.DM]. May 2019. https://www.cicirello.org/publications/cicirello2019arXiv.html.\nThese four programs are as follows:\n* org.cicirello.replication.arxiv2019may.CompareKendallTauSequenceDistAlgsDoubles\n* org.cicirello.replication.arxiv2019may.CompareKendallTauSequenceDistAlgsInts\n* org.cicirello.replication.arxiv2019may.CompareKendallTauSequenceDistAlgsStrings\n* org.cicirello.replication.arxiv2019may.CompareKendallTauSequenceDistAlgsStringArray\n\n__org.cicirello.replication.bict2019.BICT2019__: This program generates the data for the\nprincipal component analysis, as well as the fitness distance correlation data,\nfrom the paper:\nV. A. Cicirello, \"Classification of Permutation Distance Metrics for Fitness Landscape Analysis,\" \nin Proceedings of the 11th International Conference on Bio-inspired Information and \nCommunications Technologies.  March 2019. https://www.cicirello.org/publications/cicirello2019bict.html.\n\n__org.cicirello.replication.flairs2013.Flairs2013__: This program generates the correlation\ndata that appears in Tables 1 and 2, as well as the data necessary to generate the\ngraphs in Figures 1, 2, 3, 4, and 5 of the paper:\nV. A. Cicirello and R. Cernera, \"Profiling the distance characteristics \nof mutation operators for permutation-based genetic algorithms,\" \nin Proceedings of the 26th FLAIRS Conference. AAAI Press, \nMay 2013, pp. 46–51. https://www.cicirello.org/publications/cicirello2013flairs.html.\n\n__org.cicirello.replication.ieeetevc2016.FDC__: This program generates the fitness \ndistance correlations for the \"Permutation in a Haystack\" fitness landscapes \nfound in Table II of the paper:\nV.A. Cicirello, \"The Permutation in a Haystack Problem and the Calculus of Search Landscapes,\" \nIEEE Transactions on Evolutionary Computation, 20(3):434-446, \nJune 2016. https://www.cicirello.org/publications/cicirello2016evc.html.\n\n## Versioning Scheme\n\nThe version numbers for the example programs mirror the versions of\n[JavaPermutationTools (JPT)](https://jpt.cicirello.org). The version may \nor may not be incremented upon every new release of the JPT library. The \nversion number of the examples corresponds to the version of the JPT \nlibrary used in that release.  The examples should run against newer \nversions of the JPT library provided the MAJOR portion of the version \nnumber is the same.  \n\nThe JPT library uses [Semantic Versioning](https://semver.org/) with \nversion numbers of the form: MAJOR.MINOR.PATCH, where differences \nin MAJOR correspond to incompatible API changes, differences in MINOR \ncorrespond to introduction of backwards compatible new functionality, \nand PATCH corresponds to backwards compatible bug fixes.\n\n## Prebuilt Jars of the Examples\n\nSince the purpose of the example programs is to demonstrate usage of the\nJPT library, you will most likely want to build the examples\ndirectly from the source (see the sections that follow).  However, we\nalso provide jars of the compiled examples, as well as of the source and javadocs, \nin a variety of ways:\n* [GitHub releases](https://github.com/cicirello/jpt-examples/releases)\n* [Maven Central](https://central.sonatype.com/artifact/org.cicirello/jpt-examples/)\n* [GitHub Packages](https://github.com/cicirello?tab=packages\u0026repo_name=jpt-examples)\n\nIf you use the example programs in precompiled form, you will also need\na compatible version of the JPT library, and its dependencies. If you\nbuild the examples from the source, the build process will take care of downloading these\nfor you. But if you choose to use the prebuilt jars, you can find the jars\nof the [JPT library](https://github.com/cicirello/JavaPermutationTools) \nlikewise in Maven Central, GitHub Releases, and GitHub Packages.\n\n## Requirements to Build and Run the Example Programs from the Source\n\nTo build and run the examples on your own machine, you will need the following:\n* __JDK 17__: Beginning with v4.0.0, the minimum supported Java version for the \n  JavaPermutationTools library is Java 17, so you will need Java 17+ for the example programs. \n* __Apache Maven__: In the root of the repository, there is a pom.xml for building the example programs. Using this pom.xml, Maven will take care of downloading the most recent version of the [JavaPermutationTools](https://jpt.cicirello.org/) library for which the examples have been tested, as well as JPT's dependencies. The examples should also work with more recent versions of the library.\n* __Make__ (optional): The repository also contains a Makefile to simplify running the build, and running the example programs. If you are familiar with using the Maven build tool, then you can just run these directly, although the Makefile may be useful to see the specific commands needed, such as the main classes to execute for the example programs.\n\n## Building the Example Programs with Maven\n\nThe source code of the example programs are\nin the [src/main/java](src/main/java) directory.  You can build the example \nprograms in one of the following ways:\n* Execute `mvn package` at the root of the repository (`mvn compile` should also be sufficient, but only generates `class` files, while `mvn package` generates `jar` files).\n* Execute `make` or `make build` at the root of the repository (which simply executes a `mvn package`). \n\nThis build process follows the usual Maven directory structure, so \nthe `.class` files, `.jar` files, etc will be found in a `target` \ndirectory that is created by the build process.\n\nTo run various static analysis tools (e.g., SpotBugs, FindSecBugs, etc) during\nthe build, run: `mvn clean package -Panalysis`.\n\n## Running the Example Programs with Maven\n\nOnce you have successfully executed the build above, you can run the \nexamples of basic library functionality by executing `make examples` \nat the root of the repository. This will run each of the example \nprograms in sequence. Be aware that the examples are intended to \nillustrate how to use the JPT library, so will be most meaningful \nif you read the source code, which includes comments explaining what \nthey are doing. If you would rather run them one at a time, see \nthe `examples` target in the `Makefile` for the main classes to execute.\n\nThere are additional examples (see list in earlier section above) that\nare based on the experiments of a few published papers that either used \nthe library, or which led to the code of the library (i.e., originally \nused preliminary versions of some of the library code). There are \ntargets in the makefile for each of these, so you can run those by \nexecuting the following: `make arxiv2019`, `make bict2019`, \n`make flairs2013`, and `make tevc2016`.\n\n## License\n\nThe example programs in this repository are licensed under \nthe [GNU General Public License 3.0](https://www.gnu.org/licenses/gpl-3.0.en.html).\n\n","funding_links":["https://github.com/sponsors/cicirello","https://ko-fi.com/cicirello","https://liberapay.com/cicirello"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcicirello%2Fjpt-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcicirello%2Fjpt-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcicirello%2Fjpt-examples/lists"}