Metadata-Version: 2.1
Name: chasing_targets_gym
Version: 0.0.9
Summary: Simple gym environment for multiple agents to chase multiple (dumb) targets
Author-Email: Bryce Ferenczi <frenzi@hotmail.com.au>
License: MIT License
        
        Copyright (c) 2023 Bryce Ferenczi
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Natural Language :: English
Project-URL: Homepage, https://github.com/5had3z/chasing-targets-gym
Project-URL: Bug tracker, https://github.com/5had3z/chasing-targets-gym/issues
Requires-Python: >=3.10
Requires-Dist: numpy
Requires-Dist: gymnasium>=0.28.1
Requires-Dist: pygame
Description-Content-Type: text/x-rst

===================
Chasing Targets Gym
===================

|version| |python| |license| |codestyle|

.. |version| image:: https://img.shields.io/pypi/v/chasing-targets-gym
    :target: https://pypi.org/project/chasing-targets-gym/
    :alt: PyPI - Package Version
.. |python| image:: https://img.shields.io/pypi/pyversions/chasing-targets-gym
    :target: https://pypi.org/project/chasing-targets-gym/
    :alt: PyPI - Python Version
.. |license| image:: https://img.shields.io/pypi/l/chasing-targets-gym
    :target: https://github.com/5had3z/chasing-targets-gym/blob/main/LICENSE
    :alt: PyPI - License
.. |codestyle| image:: https://img.shields.io/badge/code%20style-black-000000.svg
    :target: https://github.com/psf/black


Introduction
------------

This is a simple gym environment that sets up a set of robots and targets for them to chase.
These targets are dumb, they simply move at a constant speed and bounce off the "limits" of 
the simulation environment. The intention is that the robots will chase after these targets,
and switch to a new target after catching their current one. The targets are "transparent" and
robots are free to ignore "avoiding them", the intention is that they avoid each other. An
example of a simulation with robot controller is shown below.

.. image:: misc/example_sim.gif


Usage
-----

Since this uses the gymnasium, you can spin an environment up same as any other env, and you can use our optimized planner. A script is included that shows of this planner and environment when you install this library ```chasing-targets-example --max-step=500```.

.. code:: python
    
    from gymnasium import Env, make
    from chasing_targets_gym.planner import Planner

    env: Env = make(
        "ChasingTargets-v0",
        render_mode="human",
        n_robots=10,
        n_targets=3,
        robot_radius=0.1,
        max_velocity=0.5,
        target_velocity_std=0.5,
        max_episode_steps=1000,
    )

    planner = Planner(
        env.get_wrapper_attr("robot_radius"),
        env.get_wrapper_attr("dt"),
        env.get_wrapper_attr("max_velocity"),
    )



Installation
------------

Either you can clone and pip install the source, or you can install via pypi.
If installing from source seems to stall for no apparent reason, try --no-build-isolation.

.. code:: bash

    git clone https://github.com/5had3z/chasing-targets-gym && cd chasing-targets-gym && pip3 install -e .

Otherwise install pypi package

.. code:: bash

    pip3 install chasing-targets-gym


Some Credit
-----------

I was pointed to a basic environment `here <https://github.com/riiswa/planning-multi-robot-gym>`_ but it didn't
really match what I wanted, so I made my own based off this.
