{ "info": { "author": "Richard Feistenauer", "author_email": "r.feistenauer@web.de", "bugtrack_url": null, "classifiers": [], "description": "# Cellular Automaton\nThis package provides an cellular automaton for [Python 3](https://www.python.org/)\n\nA cellular automaton defines a grid of cells and a set of rules.\nAll cells then evolve their state depending on their neighbours state simultaneously.\n\nFor further information on cellular automatons consult e.g. [mathworld.wolfram.com](http://mathworld.wolfram.com/CellularAutomaton.html)\n\n## Yet another cellular automaton module?\nIt is not the first python module to provide a cellular automaton, \nbut it is to my best knowledge the first that provides all of the following features:\n - easy to use\n - n dimensional\n - multi process capable\n - speed optimized\n - documented\n - tested\n\nI originally did not plan to write a new cellular automaton module, \nbut when searching for one, I just found some that had little or no documentation with an API that really did not fit my requirements\nand/or Code that was desperately asking for some refactoring.\n\nSo I started to write my own module with the goal to provide an user friendly API\nand acceptable documentation. During the implementation I figured, why not just provide \nn dimensional support and with reading Clean Code from Robert C. Martin the urge\nto have a clean and tested code with a decent coverage added some more requirements.\nThe speed optimization and multi process capability was more of challenge for myself.\nIMHO the module now reached an acceptable speed, but there is still room for improvements (e.g. with Numba?).\n\n## Usage\nTo start and use the automaton you will have to define three things:\n- The neighborhood\n- The dimensions of the grid\n- The evolution rule\n\n`````python\nneighborhood = MooreNeighborhood(EdgeRule.IGNORE_EDGE_CELLS)\nca = CAFactory.make_single_process_cellular_automaton(dimension=[100, 100],\n neighborhood=neighborhood,\n rule=MyRule)\n``````\n\n### Neighbourhood\nThe Neighborhood defines for a cell neighbours in relative coordinates.\nThe evolution of a cell will depend solely on those neighbours.\n\nThe Edge Rule passed as parameter to the Neighborhood defines, how cells on the edge of the grid will be handled.\nThere are three options:\n- Ignore edge cells: Edge cells will have no neighbours and thus not evolve.\n- Ignore missing neighbours: Edge cells will add the neighbours that exist. This results in varying count of neighbours on edge cells.\n- First and last cell of each dimension are neighbours: All cells will have the same neighbour count and no edge exists.\n\n### Dimension\nA list or Tuple which states each dimensions size.\nThe example above defines a two dimensional grid with 100 x 100 cells.\n\nThere is no limitation in how many dimensions you choose but your memory and processor power.\n\n### Rule\nThe Rule has three tasks:\n- Set the initial value for all cells.\n- Evolve a cell in respect to its neighbours.\n- (optional) define how the cell should be drawn.\n\n`````python\nclass MyRule(Rule):\n\n def init_state(self, cell_coordinate):\n return (1, 1)\n\n def evolve_cell(self, last_cell_state, neighbors_last_states):\n return self._get_neighbor_by_relative_coordinate(neighbors_last_states, (-1, -1))\n\n def get_state_draw_color(self, current_state):\n return [255 if current_state[0] else 0, 0, 0]\n`````\n\nJust inherit from `cellular_automaton.rule:Rule` and define the evolution rule and initial state.\n\n## Visualisation\nThe package provides a module for visualization in a pygame window for common two dimensional automatons.\n\nTo add another kind of display option e.g. for other dimensions or hexagonal grids you can extrend the provided implementation or build your own.\nThe visual part of this module is fully decoupled and thus should be easily replaceable.\n\n## Examples\nThe package contains two examples:\n- [simple_star_fall](./examples/simple_star_fall.py)\n- [conways_game_of_life](./examples/conways_game_of_life.py)\n\nThose example automaton implementations should provide a good start for your own project.\n\n## Getting Involved\nFeel free to open pull requests, send me feature requests or even join as developer.\nThere ist still quite some work to do.\n\nAnd for all others, don't hesitate to open issues when you have problems!\n\n## Dependencies\nFor direct usage of the cellular automaton ther is no dependency.\nIf you want to use the display option however or execute the examples you will have to install \n[pygame](https://www.pygame.org/news) for visualisation.\nIf you do for some reason not want to use this engine simply inherit from display.DrawEngine and overwrite the \nnecessary methods. (for an example of how to do so see ./test/test_display.py)\n\n## Licence\nThis package is distributed under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0), see [LICENSE.txt](./LICENSE.txt)\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://gitlab.com/DamKoVosh/cellular_automaton", "keywords": "", "license": "Apache License 2.0", "maintainer": "", "maintainer_email": "", "name": "cellular-automaton", "package_url": "https://pypi.org/project/cellular-automaton/", "platform": "", "project_url": "https://pypi.org/project/cellular-automaton/", "project_urls": { "Homepage": "https://gitlab.com/DamKoVosh/cellular_automaton" }, "release_url": "https://pypi.org/project/cellular-automaton/0.2.0/", "requires_dist": null, "requires_python": ">3.6.1", "summary": "N dimensional cellular automaton with multi processing capability.", "version": "0.2.0" }, "last_serial": 5140329, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "82c7faab4c64c7a38bdf7e89c67083e9", "sha256": "a23498590f27be7877f0977318e58c6f6b9748bfa9aa35a4751d1e2937a177c6" }, "downloads": -1, "filename": "cellular_automaton-0.1.0.tar.gz", "has_sig": false, "md5_digest": "82c7faab4c64c7a38bdf7e89c67083e9", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.6.1", "size": 17944, "upload_time": "2019-03-03T07:25:50", "url": "https://files.pythonhosted.org/packages/19/24/40c8851aa9221824369c03a86638dff8f1150886ee727f1e070b50b5922f/cellular_automaton-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "81ab9a745808e4feee9f73eeae5a3d98", "sha256": "67f7de754dfe5d0e1abb17286f941dc0f78d0b42a0a7d9d9e6a6200e998e807d" }, "downloads": -1, "filename": "cellular_automaton-0.1.1.tar.gz", "has_sig": false, "md5_digest": "81ab9a745808e4feee9f73eeae5a3d98", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14451, "upload_time": "2019-04-14T09:38:44", "url": "https://files.pythonhosted.org/packages/39/f6/64ced1eaa1e186bb93e8add2f61d752979d479fc555da475fe9589ced2f2/cellular_automaton-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "4c6a92dc1531ebc61c8ac6abab60ce3b", "sha256": "fe37b86396cded543fdfaf3324e3a9f952a321f6f7264394a3290eb1260f7ded" }, "downloads": -1, "filename": "cellular_automaton-0.1.2.tar.gz", "has_sig": false, "md5_digest": "4c6a92dc1531ebc61c8ac6abab60ce3b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14479, "upload_time": "2019-04-14T09:38:46", "url": "https://files.pythonhosted.org/packages/70/e3/41cc54bb67b1eb6aff33fa977a09a1ddef53eb597068dc31de3a97d08e5e/cellular_automaton-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "1ba7c564a1207f58fc409e42898843a9", "sha256": "390fd31ed4edfafba2b827fc0d7bd4a7435c5361a7820c1812ca6518a261ed00" }, "downloads": -1, "filename": "cellular_automaton-0.1.3.tar.gz", "has_sig": false, "md5_digest": "1ba7c564a1207f58fc409e42898843a9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15055, "upload_time": "2019-04-14T09:38:47", "url": "https://files.pythonhosted.org/packages/86/a9/c5a6d8a5b1ee1659e55af29ec20e00d9b0df93cf484ce671a261f074e2d7/cellular_automaton-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "2236db308af95f2fa10302d43b739007", "sha256": "15036d7e13b5eb29098e5fe923bc3318e5cc032f5db7b5836d49c3daefd28f48" }, "downloads": -1, "filename": "cellular_automaton-0.1.4.tar.gz", "has_sig": false, "md5_digest": "2236db308af95f2fa10302d43b739007", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14879, "upload_time": "2019-04-14T09:38:49", "url": "https://files.pythonhosted.org/packages/de/7d/e6f8556c1a40e2a31eb971fa9e2323fd9e664f41e9ec53ee323526489442/cellular_automaton-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "6551c003164158990680fc7cd4783d2b", "sha256": "ced2a28d395e952724e2d1caba327a6d63ca1eeda6a903737fc344ffc8e3591c" }, "downloads": -1, "filename": "cellular_automaton-0.1.5.tar.gz", "has_sig": false, "md5_digest": "6551c003164158990680fc7cd4783d2b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17124, "upload_time": "2019-04-14T09:38:50", "url": "https://files.pythonhosted.org/packages/4a/b1/8993b5a36b556aabd38631db1d99a3c5d439179fb0a46dc336e2e72c2e64/cellular_automaton-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "de6c2971ae5db92185e2d40554373f38", "sha256": "94451395af5d5b30e0c8b20ea060de2849cbf812362e5e2c0ca1e4ca5764fbca" }, "downloads": -1, "filename": "cellular_automaton-0.1.6.tar.gz", "has_sig": false, "md5_digest": "de6c2971ae5db92185e2d40554373f38", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17119, "upload_time": "2019-04-14T09:38:51", "url": "https://files.pythonhosted.org/packages/50/f5/b4ff308a05122cec8da9fc0be40be9db245d63d2ed83375b9f0445f3ce31/cellular_automaton-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "33b63357a90e4d7c408c564ccb9f62ed", "sha256": "617370cd8488bfa7f1cab6bff2e9ab96766588900d6fc79fd3a4dbd10a4cea8d" }, "downloads": -1, "filename": "cellular_automaton-0.1.7-py3.7.egg", "has_sig": false, "md5_digest": "33b63357a90e4d7c408c564ccb9f62ed", "packagetype": "bdist_egg", "python_version": "3.7", "requires_python": ">3.6.1", "size": 33447, "upload_time": "2019-04-14T09:38:53", "url": "https://files.pythonhosted.org/packages/bc/cc/a9f7fd6a22bb56d265fdae3ae17b2eec97b41896eea10977f968f9d28a3d/cellular_automaton-0.1.7-py3.7.egg" }, { "comment_text": "", "digests": { "md5": "354448a0dbd0b7a3f6c24628ea036864", "sha256": "25ef3f498701b0a3a1223fdef054eb22b7f67036f0b14f700964f7f7d9b9035f" }, "downloads": -1, "filename": "cellular_automaton-0.1.7.tar.gz", "has_sig": false, "md5_digest": "354448a0dbd0b7a3f6c24628ea036864", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.6.1", "size": 17936, "upload_time": "2019-04-14T09:38:54", "url": "https://files.pythonhosted.org/packages/92/11/56c9c93a348183c0f954ce3285329dfdf49f5c1e1c83409bf350652e4658/cellular_automaton-0.1.7.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "1f74b273453844c9305bfe33d12643dc", "sha256": "782de1bb0a1ebc48ccf0b7a9ecc4fd3e219a6ca88b01f69d0d89b510e912f0c0" }, "downloads": -1, "filename": "cellular_automaton-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "1f74b273453844c9305bfe33d12643dc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">3.6.1", "size": 19295, "upload_time": "2019-04-14T09:38:42", "url": "https://files.pythonhosted.org/packages/71/4a/0799e13401179caded87f05bfc62e6a459e01ea61600511d61339db57bbf/cellular_automaton-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6882f5620f74329b526ed60726659b17", "sha256": "1dcaa7ccf77b4dfb82859bfc6aafb6288b1d16c0e557832390bbd6c72421dea9" }, "downloads": -1, "filename": "cellular_automaton-0.2.0.tar.gz", "has_sig": false, "md5_digest": "6882f5620f74329b526ed60726659b17", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.6.1", "size": 19115, "upload_time": "2019-04-14T09:38:55", "url": "https://files.pythonhosted.org/packages/94/53/af82ec1b6312d336de721bd4dd445696c4cd3c5ff3ea1a00dcd7f29ac678/cellular_automaton-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1f74b273453844c9305bfe33d12643dc", "sha256": "782de1bb0a1ebc48ccf0b7a9ecc4fd3e219a6ca88b01f69d0d89b510e912f0c0" }, "downloads": -1, "filename": "cellular_automaton-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "1f74b273453844c9305bfe33d12643dc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">3.6.1", "size": 19295, "upload_time": "2019-04-14T09:38:42", "url": "https://files.pythonhosted.org/packages/71/4a/0799e13401179caded87f05bfc62e6a459e01ea61600511d61339db57bbf/cellular_automaton-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6882f5620f74329b526ed60726659b17", "sha256": "1dcaa7ccf77b4dfb82859bfc6aafb6288b1d16c0e557832390bbd6c72421dea9" }, "downloads": -1, "filename": "cellular_automaton-0.2.0.tar.gz", "has_sig": false, "md5_digest": "6882f5620f74329b526ed60726659b17", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.6.1", "size": 19115, "upload_time": "2019-04-14T09:38:55", "url": "https://files.pythonhosted.org/packages/94/53/af82ec1b6312d336de721bd4dd445696c4cd3c5ff3ea1a00dcd7f29ac678/cellular_automaton-0.2.0.tar.gz" } ] }