{"id":23391373,"url":"https://github.com/hugcis/rust_ca","last_synced_at":"2025-04-11T09:59:20.825Z","repository":{"id":57664924,"uuid":"331421445","full_name":"hugcis/rust_ca","owner":"hugcis","description":"A Rust cellular automata simulator that can output GIF animations.","archived":false,"fork":false,"pushed_at":"2023-01-05T15:05:39.000Z","size":1321,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T06:51:12.434Z","etag":null,"topics":["cellular-automata","cellular-automaton","rust","rust-lang"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/hugcis.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-01-20T20:18:52.000Z","updated_at":"2025-02-01T01:06:46.000Z","dependencies_parsed_at":"2023-02-04T06:32:25.971Z","dependency_job_id":null,"html_url":"https://github.com/hugcis/rust_ca","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/hugcis%2Frust_ca","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugcis%2Frust_ca/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugcis%2Frust_ca/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugcis%2Frust_ca/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hugcis","download_url":"https://codeload.github.com/hugcis/rust_ca/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248371965,"owners_count":21093132,"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":["cellular-automata","cellular-automaton","rust","rust-lang"],"created_at":"2024-12-22T04:16:01.243Z","updated_at":"2025-04-11T09:59:20.799Z","avatar_url":"https://github.com/hugcis.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust Cellular Automata\n[![Crates.io](https://img.shields.io/crates/v/rust_ca)](https://crates.io/crates/rust_ca)\n[![Rust](https://github.com/hugcis/rust_ca/actions/workflows/rust.yml/badge.svg)](https://github.com/hugcis/rust_ca/actions/workflows/rust.yml)\n\nThis is a command-line tool and a library to simulate and search the space of simple cellular\nautomata (with smallish neighborhoods).\n\nThe tool outputs CA simulations in the form of GIF files.\n\n## Install the tool \n\nRun the following command to install on your system:\n```\ncargo install rust_ca\n```\n\nTo use the library in another Rust project add the following to your `Cargo.toml` dependencies:\n```toml\n[dependencies]\nrust_ca = \"0.2.1\"\n```\n\n## Example\n\nThe following command will run a CA with a rule numbered `16855021099980290151`\n(you can find it in this repository).\n\nThe initial configuration is specified  in `exploding.pat` (the initial\nconfiguration is random by default). The CA has 3 states and is 128x128 cells.\nWe want the output GIF file to represent 2400 time steps, but displaying only 1\nin 10. \n```\nrust_ca -n 3 -f rules/3_states/16855021099980290151.map.comp \\\n-p patterns/exploding.pat -k 10 -s 128 --delay 0 -t 2400 \n```\nThis results in the following `test.gif` file: \n\n![Example CA GIF](assets/test.gif)\n\n### Generate random CA GIFs\n\nThis generates 200 distinct CA ran for 2400 steps (only showing one in 10) with\n4 states.\n\n**Warning:** This command creates 200 GIFs for a total size of ~500MB.\n``` sh\ncargo build --release\nmkdir rgen\nfor i in $(seq 0 200); do\nrust_ca -n 4 -k 10 -s 128 --delay 0 -t 2400 --rotate 1 --symmetric \\\n    \u003e rgen/test_$i.gif\ndone;\n\n```\n\n\n## CLI usage\nThe CLI usage is: \n```\nRust CA 0.2.2\nHugo Cisneros \u003chmj.cisneros@gmail.com\u003e\nA CLI CA simulator. With no options, this runs a randomly sampled CA rule with 2 states for 50 steps\nand outputs it as a gif file `test.gif`\n\nUSAGE:\n    rust_ca [OPTIONS]\n\nOPTIONS:\n        --delay \u003cDELAY\u003e\n            [default: 10]\n\n    -f, --file \u003cFILE\u003e\n            File to read a rule from or write to. The file must contain a valid rule for the\n            corresponding number of states\n\n    -h, --help\n            Print help information\n\n        --horizon \u003cHORIZON\u003e\n            [default: 1]\n\n    -k, --skip \u003cSKIP\u003e\n            Steps to skip at every time step for the output [default: 1]\n\n    -n, --states \u003cSTATES\u003e\n            Number of states of the CA [default: 2]\n\n    -o, --output \u003cOUTPUT\u003e\n            A file to write the GIF to. Defaults to standard output\n\n    -p, --pattern \u003cPATTERN\u003e\n\n\n    -r, --rule \u003cRULE\u003e\n            Specify one of the implemented CA rule [possible values: GOL]\n\n        --rotate \u003cROTATE\u003e\n            [default: 0]\n\n        --rule-sampling \u003cRULE_SAMPLING\u003e\n            [default: dirichlet] [possible values: uniform, dirichlet]\n\n    -s, --size \u003cSIZE\u003e\n            The size of the 2D CA grid [default: 128]\n\n        --symmetric\n            Make the rule symmetric (this will also apply to rules passed as files)\n\n    -t, --steps \u003cSTEPS\u003e\n            Simulation time [default: 50]\n\n        --use-tiled\n            Use a tiled CA (defaults to true when the size is a multiple of TILE_SIZE)\n\n    -V, --version\n            Print version information\n\n    -w, --write-rule \u003cWRITE_RULE\u003e\n            File to read a rule from or write to. The file must contain a valid rule for the\n            corresponding number of states\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugcis%2Frust_ca","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhugcis%2Frust_ca","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugcis%2Frust_ca/lists"}