{"id":19006168,"url":"https://github.com/atothey/terrarium","last_synced_at":"2025-08-20T12:45:48.459Z","repository":{"id":124236338,"uuid":"64419105","full_name":"AtotheY/terrarium","owner":"AtotheY","description":null,"archived":false,"fork":false,"pushed_at":"2016-08-13T03:53:27.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-01T19:44:08.099Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AtotheY.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2016-07-28T18:33:24.000Z","updated_at":"2016-07-28T18:34:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"6a62bd1f-2e87-4e2c-9bb4-d6f601b60746","html_url":"https://github.com/AtotheY/terrarium","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtotheY%2Fterrarium","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtotheY%2Fterrarium/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtotheY%2Fterrarium/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtotheY%2Fterrarium/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AtotheY","download_url":"https://codeload.github.com/AtotheY/terrarium/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240028136,"owners_count":19736344,"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":[],"created_at":"2024-11-08T18:30:52.962Z","updated_at":"2025-02-21T14:22:11.023Z","avatar_url":"https://github.com/AtotheY.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# terrarium\n\n\nThis program uses genetic programming to train \"critters\" to play a very simple game.\n\nThe game is structured as follows. You are givena 2D map which contains 4 elements -- Your character, Water, Food, and free spaces.\nf - food\n1 - water\n0 - free space\nX - character\n\n1 1 1 1 1  \n1 0 0 f 1  \n1 f 0 0 1  \n1 0 X 0 1  \n1 1 1 1 1  \n\nYou can choose to move either up, down, left, or right. \n\nThe objective of the game is to die of old age, by moving a fixed amount of steps without falling into water or dying of starvation.\n\n# Genetic Programming\nIf you run  \n```python genetic_terrarium.py```\n\nyou can see the game play itself. 64 Critters are initially spawned, and use a coefficient system to play the game.\n\nEach critter judges the strength of moving in a direction using the equation Strength = C1X1 + C2X2 + C3*(1/d)\nwhere c1,c2, and c3 are randomly generated coefficients specific to the critter, x1 and x2 correspond to the closest non empty tile type, and d corresponds to the distance that tile is from the critter.\n\nAfter 64 critters play a specific map, the top 7 have \"mate\" (they reproduce a new critter with a mix of both parents coefficients) and the game is played again with the new critters. (the remaining 15 spots are newly generated critters)\n\nEach epoch should have an increasingly larger average score, however, due to the limitations of the 2D 4-move system, the difference between each epoch is too volitile.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatothey%2Fterrarium","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatothey%2Fterrarium","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatothey%2Fterrarium/lists"}