pitapy


Namepitapy JSON
Version 1.0.2 PyPI version JSON
download
home_pageNone
SummaryUpdate dependencies in requirements.txt, specifying webcolors 1.13
upload_time2024-12-21 13:29:14
maintainerNone
docs_urlNone
authorMicrocosmAI
requires_python>=3.9
licenseBSD-3-Clause
keywords reinforcement learning rl multi agent reinforcement learning marl randomized world generation mujoco research procedural iterative terrain assembly dm_control
VCS
bugtrack_url
requirements pyyaml dm_control shapely matplotlib sphinx webcolors pillow typer sphinx_rtd_theme importlib_resources
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PITA (Procedural and Iterative Terrain Assembly)
![pixlr_banner](https://raw.githubusercontent.com/microcosmAI/pita/8e2a540ac5aeac5f2d3784c38e6a2a6d32dab7d9/static/banner.png)

Welcome to PITA (Procedural and Iterative Terrain Assembly), a framework designed to generate dynamic and customizable environments for **reinforcement learning (RL) in MuJoCo**. PITA serves as a valuable tool for creating varied simulation environments, helping to mitigate overfitting in AI systems by providing diverse training scenarios.

Introduction
------------
<img align="right" width="150" src="https://raw.githubusercontent.com/microcosmAI/pita/8e2a540ac5aeac5f2d3784c38e6a2a6d32dab7d9/static/pitabot.png">

AI systems require exposure to a variety of environments to develop robust and adaptable behaviors. Static, unchanging environments can lead to overfitting, where AI agents perform well in familiar scenarios but struggle with any variation. PITA addresses this challenge by generating multiple variations of the same environment, in which the properties and positions of objects can be altered. This is achieved through randomization, over which the user has control, allowing for a more dynamic and adaptable testing scenario.

Core Features
---------------

- **YAML Configuration**: Simplifies the environment setup process through YAML configuration files, eliminating the need for direct coding and making the system accessible to users with minimal programming experience.

- **XML Input**: The system uses XML files as inputs, enabling users to supply custom assets by passing the directory of the xmls to PITA.

- **Fine-Grained Configuration Control**: Offers detailed control over the placement and properties of assets with the additional capability to randomize these aspects as required.

- **Property Randomization**: Offers the ability to randomize various properties of every asset, including position, number, colors, sizes, and z-axis rotation.

- **Adjustable Environment Sizes**: Supports static variable dimensions for the base environment while also including the option to randomize length and height which results in different boundary dimensions for every variation of the base environment.

- **Segmented Environmental Areas**: Allows the division of the overall environment into multiple equal-sized areas. Object behavior, such as position randomization, is then based on the area they are positioned in.

- **Distribution-Based Randomization**: Implements position randomization through statistical distributions, providing users with the option to select specific distribution models for each asset to achieve desired randomness effects.

- **Runtime Validation of Asset Positioning**: Ensures that all assets are correctly positioned without overlaps through validation at run-time.

- **Placement Rules**: Allows setting specific rules for asset placement, such as maintaining a minimum distance between objects.

- **Diverse Asset Pool**: Enables the definition of an asset pool, allowing selection from various assets of a similar style (e.g., "Tree.xml", "Tree_Birch.xml", "Tree_Maple.xml").

- **JSON Output**: Generates a JSON file detailing information about the objects within the environment, providing a structured output that can be used for the environment dynamics.


Why PITA?
---------

PITA offers several advantages for the development and training of RL systems:

- **Aimed for RL and MuJoCo**: PITA is specifically designed for reinforcement learning scenarios using the MuJoCo framework, known for its complex interactions. PITA simplifies the use of MuJoCo by allowing users to integrate custom assets and define settings through a straightforward configuration file, effectively streamlining the complexity of the environment setup.
- **Facilitates Generalization**: Mitigates overfitting by generating varied environments of the same setup in order for the agent to develop a deeper understanding of the environment and the task at hand.
- **Fast Multi-Environment Creation**: The easy-to-use configuration system speeds up the process of environment generation.

PITA provides a framework for the procedural and iterative assembly of training environments, designed to support reinforcement learning research. It offers researchers and developers the tools needed to construct diverse and challenging scenarios, aiding in the development of AI agents that can perform well across different tasks or domains.

## 1) Installation
In order to get started, simply install the package

```bash
pip install pitapy
```

## 2) Quick Start

Import the PITA class from the package and run it.

```shell
from pitapy.pita import PITA


PITA().run()
```

This script uses the default values within the package:
```shell
random_seed=None
config_path="examples/config_files/complex-config.yml"
xml_dir="examples/xml_objects"
export_path="export"
```

## 3) Designing the configuration file 

This is an example of a simple configuration file to start with PITA. For further details on 'how to design your own configuration file' please visit our documentation by opening
"docs/build/html/index.html" in your browser.
```
Environment:
  size_range: [100, 100]

  random_seed: 42

  Style:
    - pretty_mode: False

  Borders:
    - xml_name: "Border.xml"
    - place: True
    - tags: ["Border"]

  Objects:
    Tree01:
      - xml_name: "Tree01.xml"
      - amount: [2, 2]

    Agent:
      - xml_name: "BoxAgent.xml"
      - amount: 2
      - coordinates: [ [10, 10, 3], [10, 30, 3] ]

Areas:
  Area1:
    Objects:
      Tree02:
        - xml_name: "Tree02.xml"
        - amount: [2, 2]
        - tags: ["Tree"]
```

## MicrocosmAI
The development of PITA is part of the "Emergent Behaviors in a Multi-Agent System with Reinforcement Learning" study project conducted by the MicrocosmAI research group at the University of Osnabrück, Germany.

## Outlook
As PITA is an active component of the ongoing research project, it will continue to evolve to align with the requirements of specific tasks. The development of additional features will be guided by the insights gained from the research activities associated with the project.

## License
3-Clause BSD

Copyright 2024 MicrocosmAI

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pitapy",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "reinforcement learning, rl, multi agent reinforcement learning, marl, randomized world generation, mujoco, research, procedural iterative terrain assembly, dm_control",
    "author": "MicrocosmAI",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/b0/9a/dc6006dc29f2d44ff38df8922528580833d06717e6dddcb25bdef5146aa0/pitapy-1.0.2.tar.gz",
    "platform": null,
    "description": "# PITA (Procedural and Iterative Terrain Assembly)\r\n![pixlr_banner](https://raw.githubusercontent.com/microcosmAI/pita/8e2a540ac5aeac5f2d3784c38e6a2a6d32dab7d9/static/banner.png)\r\n\r\nWelcome to PITA (Procedural and Iterative Terrain Assembly), a framework designed to generate dynamic and customizable environments for **reinforcement learning (RL) in MuJoCo**. PITA serves as a valuable tool for creating varied simulation environments, helping to mitigate overfitting in AI systems by providing diverse training scenarios.\r\n\r\nIntroduction\r\n------------\r\n<img align=\"right\" width=\"150\" src=\"https://raw.githubusercontent.com/microcosmAI/pita/8e2a540ac5aeac5f2d3784c38e6a2a6d32dab7d9/static/pitabot.png\">\r\n\r\nAI systems require exposure to a variety of environments to develop robust and adaptable behaviors. Static, unchanging environments can lead to overfitting, where AI agents perform well in familiar scenarios but struggle with any variation. PITA addresses this challenge by generating multiple variations of the same environment, in which the properties and positions of objects can be altered. This is achieved through randomization, over which the user has control, allowing for a more dynamic and adaptable testing scenario.\r\n\r\nCore Features\r\n---------------\r\n\r\n- **YAML Configuration**: Simplifies the environment setup process through YAML configuration files, eliminating the need for direct coding and making the system accessible to users with minimal programming experience.\r\n\r\n- **XML Input**: The system uses XML files as inputs, enabling users to supply custom assets by passing the directory of the xmls to PITA.\r\n\r\n- **Fine-Grained Configuration Control**: Offers detailed control over the placement and properties of assets with the additional capability to randomize these aspects as required.\r\n\r\n- **Property Randomization**: Offers the ability to randomize various properties of every asset, including position, number, colors, sizes, and z-axis rotation.\r\n\r\n- **Adjustable Environment Sizes**: Supports static variable dimensions for the base environment while also including the option to randomize length and height which results in different boundary dimensions for every variation of the base environment.\r\n\r\n- **Segmented Environmental Areas**: Allows the division of the overall environment into multiple equal-sized areas. Object behavior, such as position randomization, is then based on the area they are positioned in.\r\n\r\n- **Distribution-Based Randomization**: Implements position randomization through statistical distributions, providing users with the option to select specific distribution models for each asset to achieve desired randomness effects.\r\n\r\n- **Runtime Validation of Asset Positioning**: Ensures that all assets are correctly positioned without overlaps through validation at run-time.\r\n\r\n- **Placement Rules**: Allows setting specific rules for asset placement, such as maintaining a minimum distance between objects.\r\n\r\n- **Diverse Asset Pool**: Enables the definition of an asset pool, allowing selection from various assets of a similar style (e.g., \"Tree.xml\", \"Tree_Birch.xml\", \"Tree_Maple.xml\").\r\n\r\n- **JSON Output**: Generates a JSON file detailing information about the objects within the environment, providing a structured output that can be used for the environment dynamics.\r\n\r\n\r\nWhy PITA?\r\n---------\r\n\r\nPITA offers several advantages for the development and training of RL systems:\r\n\r\n- **Aimed for RL and MuJoCo**: PITA is specifically designed for reinforcement learning scenarios using the MuJoCo framework, known for its complex interactions. PITA simplifies the use of MuJoCo by allowing users to integrate custom assets and define settings through a straightforward configuration file, effectively streamlining the complexity of the environment setup.\r\n- **Facilitates Generalization**: Mitigates overfitting by generating varied environments of the same setup in order for the agent to develop a deeper understanding of the environment and the task at hand.\r\n- **Fast Multi-Environment Creation**: The easy-to-use configuration system speeds up the process of environment generation.\r\n\r\nPITA provides a framework for the procedural and iterative assembly of training environments, designed to support reinforcement learning research. It offers researchers and developers the tools needed to construct diverse and challenging scenarios, aiding in the development of AI agents that can perform well across different tasks or domains.\r\n\r\n## 1) Installation\r\nIn order to get started, simply install the package\r\n\r\n```bash\r\npip install pitapy\r\n```\r\n\r\n## 2) Quick Start\r\n\r\nImport the PITA class from the package and run it.\r\n\r\n```shell\r\nfrom pitapy.pita import PITA\r\n\r\n\r\nPITA().run()\r\n```\r\n\r\nThis script uses the default values within the package:\r\n```shell\r\nrandom_seed=None\r\nconfig_path=\"examples/config_files/complex-config.yml\"\r\nxml_dir=\"examples/xml_objects\"\r\nexport_path=\"export\"\r\n```\r\n\r\n## 3) Designing the configuration file \r\n\r\nThis is an example of a simple configuration file to start with PITA. For further details on 'how to design your own configuration file' please visit our documentation by opening\r\n\"docs/build/html/index.html\" in your browser.\r\n```\r\nEnvironment:\r\n  size_range: [100, 100]\r\n\r\n  random_seed: 42\r\n\r\n  Style:\r\n    - pretty_mode: False\r\n\r\n  Borders:\r\n    - xml_name: \"Border.xml\"\r\n    - place: True\r\n    - tags: [\"Border\"]\r\n\r\n  Objects:\r\n    Tree01:\r\n      - xml_name: \"Tree01.xml\"\r\n      - amount: [2, 2]\r\n\r\n    Agent:\r\n      - xml_name: \"BoxAgent.xml\"\r\n      - amount: 2\r\n      - coordinates: [ [10, 10, 3], [10, 30, 3] ]\r\n\r\nAreas:\r\n  Area1:\r\n    Objects:\r\n      Tree02:\r\n        - xml_name: \"Tree02.xml\"\r\n        - amount: [2, 2]\r\n        - tags: [\"Tree\"]\r\n```\r\n\r\n## MicrocosmAI\r\nThe development of PITA is part of the \"Emergent Behaviors in a Multi-Agent System with Reinforcement Learning\" study project conducted by the MicrocosmAI research group at the University of Osnabr\u00fcck, Germany.\r\n\r\n## Outlook\r\nAs PITA is an active component of the ongoing research project, it will continue to evolve to align with the requirements of specific tasks. The development of additional features will be guided by the insights gained from the research activities associated with the project.\r\n\r\n## License\r\n3-Clause BSD\r\n\r\nCopyright 2024 MicrocosmAI\r\n\r\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\r\n\r\n1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\r\n\r\n2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\r\n\r\n3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\r\n\r\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \u201cAS IS\u201d AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "Update dependencies in requirements.txt, specifying webcolors 1.13",
    "version": "1.0.2",
    "project_urls": {
        "Bug Tracker": "https://github.com/microcosmAI/pita/issues/",
        "Documentation": "https://github.com/microcosmAI/pita/tree/develop/docs/",
        "Source Code": "https://github.com/microcosmAI/pita/"
    },
    "split_keywords": [
        "reinforcement learning",
        " rl",
        " multi agent reinforcement learning",
        " marl",
        " randomized world generation",
        " mujoco",
        " research",
        " procedural iterative terrain assembly",
        " dm_control"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ef1f4003b6596a85d41ea4e9f348aef3703809b4f1a48076ea363988b8b96d39",
                "md5": "69fadd0162c870e897ae7d7a8a2c1564",
                "sha256": "19fa509ffdfe5035dbfe51ee459f941f0d54fcbd4d81644207ab3b90362b0bbc"
            },
            "downloads": -1,
            "filename": "pitapy-1.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "69fadd0162c870e897ae7d7a8a2c1564",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 139123,
            "upload_time": "2024-12-21T13:29:11",
            "upload_time_iso_8601": "2024-12-21T13:29:11.856914Z",
            "url": "https://files.pythonhosted.org/packages/ef/1f/4003b6596a85d41ea4e9f348aef3703809b4f1a48076ea363988b8b96d39/pitapy-1.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b09adc6006dc29f2d44ff38df8922528580833d06717e6dddcb25bdef5146aa0",
                "md5": "ce651f8a81abc39a9131db69b420cb9f",
                "sha256": "8f6f40b9909d2bb14fa2cde17c4d41bc5dd7b01c494ca0f56a9fc0e4632226dc"
            },
            "downloads": -1,
            "filename": "pitapy-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "ce651f8a81abc39a9131db69b420cb9f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 127203,
            "upload_time": "2024-12-21T13:29:14",
            "upload_time_iso_8601": "2024-12-21T13:29:14.492197Z",
            "url": "https://files.pythonhosted.org/packages/b0/9a/dc6006dc29f2d44ff38df8922528580833d06717e6dddcb25bdef5146aa0/pitapy-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-21 13:29:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "microcosmAI",
    "github_project": "pita",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "pyyaml",
            "specs": []
        },
        {
            "name": "dm_control",
            "specs": []
        },
        {
            "name": "shapely",
            "specs": []
        },
        {
            "name": "matplotlib",
            "specs": []
        },
        {
            "name": "sphinx",
            "specs": []
        },
        {
            "name": "webcolors",
            "specs": [
                [
                    "==",
                    "1.13"
                ]
            ]
        },
        {
            "name": "pillow",
            "specs": []
        },
        {
            "name": "typer",
            "specs": []
        },
        {
            "name": "sphinx_rtd_theme",
            "specs": []
        },
        {
            "name": "importlib_resources",
            "specs": []
        }
    ],
    "lcname": "pitapy"
}
        
Elapsed time: 0.69246s