{"id":20905999,"url":"https://github.com/objectprofile/geneticalgorithm","last_synced_at":"2026-03-15T09:06:57.721Z","repository":{"id":52426703,"uuid":"355914282","full_name":"ObjectProfile/GeneticAlgorithm","owner":"ObjectProfile","description":null,"archived":false,"fork":false,"pushed_at":"2021-04-29T16:33:11.000Z","size":99,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-26T20:58:05.692Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"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/ObjectProfile.png","metadata":{"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}},"created_at":"2021-04-08T13:16:21.000Z","updated_at":"2021-04-29T16:33:14.000Z","dependencies_parsed_at":"2022-08-17T23:05:32.561Z","dependency_job_id":null,"html_url":"https://github.com/ObjectProfile/GeneticAlgorithm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ObjectProfile/GeneticAlgorithm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ObjectProfile%2FGeneticAlgorithm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ObjectProfile%2FGeneticAlgorithm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ObjectProfile%2FGeneticAlgorithm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ObjectProfile%2FGeneticAlgorithm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ObjectProfile","download_url":"https://codeload.github.com/ObjectProfile/GeneticAlgorithm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ObjectProfile%2FGeneticAlgorithm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30539543,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-15T07:17:37.589Z","status":"ssl_error","status_checked_at":"2026-03-15T07:17:31.738Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-18T13:28:35.366Z","updated_at":"2026-03-15T09:06:57.688Z","avatar_url":"https://github.com/ObjectProfile.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# GeneticAlgorithm\n\nThis repository contains the parcels for VisualWorks 7.4 and 8.x from the pharo project GeneticAlgorithm, use parcel manager to install it.\n\n\n# Examples\n\nThe following example uses a sudoku board, and It finds the correct position for each cell in a matrix of 3x3 where the sum of each row, column diagonal should be 30.\n\n```Smalltalk\n| list sums g |\nlist := #(2 4 6 8 10 12 14 16 18).\n\n\"The different combinations to sum.\nE.g., the three first cells could be summed (#(1 2 3))\n\t  the diagonal top-left to bottom-right (#1 5 9))\"\nsums := #( \n\t#(1 2 3)\n\t#(4 5 6)\n\t#(7 8 9)\n\t\n\t#(1 5 9)\n\t#(7 5 3)\n\t\n\t#(1 4 7)\n\t#(2 5 8)\n\t#(3 6 9) ).\ng := GAEngine new.\ng populationSize: 400.\ng endIfFitnessIsAbove: 9.\ng mutationRate: 0.01.\ng numberOfGenes: 9.\ng createGeneBlock: [ :rand :index | list atRandom: rand. ].\ng fitnessBlock: [ :genes |\n\t| score penalty |\n\tscore := (sums collect: [ :arr |\n\t\t\t(arr collect: [ :index | genes at: index]) sum ]) \n\t\t\t\tinject: 0 into: [ :a :b | a + (b - 30) abs ].\n\tpenalty := (genes size - genes asSet size) * 3.\n\t9 - (score + penalty) ].\ng run.\ng inspect.\n```\n\n# Depedencies\nhttps://github.com/Apress/agile-ai-in-pharo\nhttps://github.com/ObjectProfile/Pharo2VW\n\n# Exporting steps\n\nExport code snipped\n\n```Smalltalk\nPharo2VW exporter\n\t\"directory: '.' asFileReference;\"\n\tnamespace: 'GeneticAlgorithm';\n\tmethodsBlacklist: {};\n\taddNewInitializerToSuperclasses: true;\n\tpackages: {'GeneticAlgorithm-Core'. 'GeneticAlgorithm-Tests'};\n\tclassNameMapperDo: [ :m |\n\t\tm \n\t\t\tat: AssertionFailure putName: 'Error' namespace: 'Core';\n\t\t\tat: DateAndTime putName: 'Timestamp' namespace: 'Core';\n\t\t\tat: AssertionFailure putName: 'Error' namespace: 'Core'.\n\t\t];\n\texport.\n```\n\nThe result should print some thing like this\n\n![ga result](https://github.com/akevalion/GeneticAlgorithm/raw/main/img/ga%20result.jpg?raw=true)\n\n\n\nThen in VW execute to sort\n\n```Smalltalk\n| main classes cat pkg packages |\nmain := Registry bundleNamed: 'GeneticAlgorithm'.\nclasses := main allClasses.\npackages := Dictionary new.\nclasses do: [ :cls |  \n\tcat := cls myClass category asString.\n\tpkg := packages at: cat ifAbsentPut: [ | p |\n\t\tp := Registry packageNamedOrCreate: cat.\n\t\tmain addItem: p.\n\t\tp ].\n\tXChangeSet current moveWholeClass: cls toPackage: pkg\n\t]\n```\nAfter that you will need to create extension for vw\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobjectprofile%2Fgeneticalgorithm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobjectprofile%2Fgeneticalgorithm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobjectprofile%2Fgeneticalgorithm/lists"}