{"id":19138075,"url":"https://github.com/lemonpi/gack","last_synced_at":"2025-10-24T08:52:50.888Z","repository":{"id":73435510,"uuid":"55314597","full_name":"LemonPi/GACK","owner":"LemonPi","description":"GArden Creation Kit using max-csp","archived":false,"fork":false,"pushed_at":"2016-04-11T02:07:16.000Z","size":3421,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-03T13:52:25.332Z","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/LemonPi.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}},"created_at":"2016-04-02T20:25:27.000Z","updated_at":"2018-07-15T03:19:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"35e80736-c4e1-4137-8124-11a7c7be4eb5","html_url":"https://github.com/LemonPi/GACK","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/LemonPi%2FGACK","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LemonPi%2FGACK/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LemonPi%2FGACK/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LemonPi%2FGACK/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LemonPi","download_url":"https://codeload.github.com/LemonPi/GACK/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240217228,"owners_count":19766732,"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-09T06:41:39.278Z","updated_at":"2025-10-24T08:52:45.853Z","avatar_url":"https://github.com/LemonPi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## GaCK: Garden Creation Kit\n\n![example \nsolution](screenshots/sample_2/sample_screenshot_no-red-yellow_fall_spring.png)\n\n\n### Supported constraints\n\nThese are the constraints implemented in Prototype2.\n\nAlways active:\n\n- Colour variety constrant: adjacent cells should have different colour\n- Moisture constraint: adjacent cells should have similar moisture requirements\n- Height constrant: cells closer to the edge should be shorter than neighbours \nfurther from the edge\n- Traffic: do not choose plants that can only handle low traffic for border \ncells\n- Spread: do not choose plants that requires more room than the cell can provide\n- Availability: cell properties must match at least one plant from the \nperennial.com database of perennials\n\nUser-configurable:\n\n- User-configurable priority for seasons (which season should have more colour \nvariation)\n- User-configurable priority for colour choices (which colours are picked first \nin the solution)\n- User can choose to force a cell to a certain colour/certain colours\n- User can specify to avoid two colours from being placed next to each other\n- User can specify a preference to have two colours adjacent to each other\n\n### Setup\n\nToulbar2 is required to run this program. Run\n\n`./setup_toulbar.sh`\n\nto download and install Toulbar2 in the current directory.\n\n### Running GaCK\n\nThere are two versions of the program: Prototype1 (older and simpler version, \nused as baseline to compare the newer Prototype2 against) and Prototype2 \n(latest version). To use:\n\n```\ncd prototype2\n./toulbar_run.sh\n```\n\nreplace prototype2 with prototype1 to run prototype1.\n\nPrototype2 can be configured with the prototype2/user_prefs.txt file \n(documented in the next section). Prototype1 is not configurable and has a \nhardcoded constraint for cell 3 to be red in summer.\n\nThis produces a list of variable assignments and possible plants for each\ncell, as well as an html page you can open to visualize the garden.\nClick \"Spring\", \"Summer\", or \"Fall\" to visualize the \ncolours of the garden in each respective season, and click on the cells\nthemselves to bring up a list of candidate plants and their links.\n\n### User configuration (Prototype2 only)\n\nThe configuration file, prototype2/user_prefs.txt, has the following format:\nEdit the file to change the preferences.\n\n```\nkey space separated values\n```\n\nMandatory keys:\n\n- color_rank: order that the colours are chosen.\n\nColours: 0 - red, 1 - orange, 2 - yellow, 3 - green, 4 - blue, 5 - violet\n\ne.g. to specify preference of violet, then blue, then orange, yellow, green, \nred:\n\ncolor_rank 5 4 1 2 3 0\n\n- season_rank: order of preference for colour diversity for each season.\n\nSeasons: spring, summer, fall\n\ne.g. to specify that highest colour diversity should be in summer, then fall, \nthe spring:\n\nseason_rank summer fall spring\n\nOptional keys:\n\n- cell_force_(index)_(season) (color1) (color2)..\n\nwhere index is the cell index (1-39), season is one of the seasons, and colour \nis one of the integers for color as specified above:\n\nForce a cell to have one of the specified colours during a season.\n\nFor example, to force cell 3 to be red in summer:\n\ncell_force_3_summer 0\n\nYou can also have disjunctive constraints - forcing cell 3 to be red or blue in \nspring:\n\ncell_force_3_spring 0 4\n\n- colorclash (weight) (color1) (color2)\n\nSpecifies that those two colours shouldn't be placed next to each other. \nColor1, color2 are in the same integer format as above.\n\nLowest weight is 1; weight of 10 means this is just as important as colour \nvariety.\n\nYou can specify multiple colorclash preferences and they will all be taken into \nconsideration according to their weights.\n\nFor example, to prevent red and blue from being placed together:\n\ncolorclash 5 0 4\n\n- coloradj (weight) (color1) (color2)\n\nOpposite of colorclash: this is for colours that should be adjacent. Usage is \nsame as colorclash.\n\n### Example solutions\n\nSeveral gardens were produced with various user constraints, and can be\nfound inside the screenshots/ folder.\n\n\n### Other experiments\n\nWe developed our own weighted CSP solver; this is located in cspbase.py. \nUnfortunately the performance was not sufficient for this assignment, so \nToulbar2 was used instead. More information can be found in our report.\n\nThree benchmarks of this solver is included:\n\n- ourcsp_warehouse.py: port of Toulbar2's validation/default/warehouse.cp\n\nTo run ourcsp_warehouse.py:\n\n`python3 ourcsp_warehouse.py`\n\nTo run the equivalent test using Toulbar2:\n\n`time ./toulbar_translateandrun.sh \ntoulbar2-0.9.8-x86_64/share/doc/validation/default/warehouse.cp`\n\n- ourcsp_warehouse_allsoft.py: warehouse with all hard constraints converted to \nsoft constraints of 10000 weight each\n\nTo run ourcsp_warehouse_allsoft.py:\n\n`python3 ourcsp_warehouse_allsoft.py`\n\nTo better exercise the heuristics, run ourcsp_warehouse_varyingsoft.py:\n\n`python3 ourcsp_warehouse_varyingsoft.py`\n\nTo run the equivalent test using Toulbar2:\n\n`time ./toulbar_translateandrun.sh warehouse_allsoft.cp`\n\n- ourcsp_celar.py: port of Toulbar2's validation/default/celar6sub0.cp\n\nTo run ourcsp_celar.py:\n\n`python3 ourcsp_celar.py`\n\nTo run the equivalent test using Toulbar2:\n\n`time ./toulbar_translateandrun.sh \ntoulbar2-0.9.8-x86_64/share/doc/validation/default/celar6sub0.cp`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flemonpi%2Fgack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flemonpi%2Fgack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flemonpi%2Fgack/lists"}