Akatosh


NameAkatosh JSON
Version 3.1.7 PyPI version JSON
download
home_pagehttps://ulfaric.github.io/Akatosh/
SummaryDiscrete event simulation framework supports real-time simulation without time step!
upload_time2024-10-01 03:27:39
maintainerNone
docs_urlNone
authorulfaric
requires_python<4.0,>=3.7
licenseCC-BY-NC-ND-4.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Akatosh

`Akatosh` is a light-weighted disceret event simulation library. Unlike popular library `Simpy` which is progress-oriented and you have to write generator function for simulated events or events interaction, `Akatosh` is fully object-oriented that events are encapsulated as `InstantEvent`/`ContinousEvent` with states, priority and a life-cycle. The actual impact of events are simply regular python functions. You could create events all at once, or create event within event. In addition, `Akatosh` is async which means event that are happening at the same simulated time will be executed simultaneously for real, unless they have different priority.

`Akatosh` also support `Resource`, provide all functionalities as it is in `Simpy` with extra utilities and interaction with `Entity`. The `Entity` is unique to `Akatosh` which represents a abstract entity with a life-cycle, for example a follower. The `Entity` supports utility functions to interact with `Resource` and automatically releases all its occupied resources upon termination.

You probably already noticed that `Akatosh` is the name of "Dragon God of Time" in elder scroll serie, therefore the singleton class `Mundus` is the core of the simulation. The `Mundus` will schedule the events, move forward time and engage async execution.

This work is licensed under CC BY-NC-ND 4.0. To view a copy of this license, visit <https://creativecommons.org/licenses/by-nc-nd/4.0/>

To use `Akatosh`:

```bash
pip install -U Akatosh
```

A basic example is showing below, for more information please look at *Examples* and *API Reference*, full documentation is available at https://ulfaric.github.io/Akatosh/.

```py
from Akatosh.universe import universe
from Akatosh.resource import Resource
from Akatosh.entity import Entity
from Akatosh.event import Event

# create a resource with capacity of 100 and current level 50
res = Resource(100.0, 50.0)

# create a instance event happens at 0.9s
lock = Event(0.9,0.9, lambda: print("Unlocked!"))

# indicate a user entity should be created after lock event ended, wait till 1.1s.
user = Entity(lock, 1.1, "User")

# indicate user entity engage a event at 1.2s
@user.event(1.2,1.2, "Use Resource")
def user_event():
    if res.distribute(user, 1):
        print(res.level)
    else:
        print("Not enough resource")


# run simulation for 1.2s
universe.simulate(1.2)
```

## Update Log
### 3.1.5
- Fix the entity event creation bug.

### 3.1.4
- Fix the logger format.

### 3.1.3
- Remove time scale feature due to its complexity and issue for causing time desynchronization.
- Rewrite the Mundus time property for better reliability in real-time mode.
- Change to IEC 61131-3 standard implementation:
  - Event will default to stop if deadline is exceeded and no watchdog function is provided.
  - Event will not stop if watchdog function is provided, unless the watchdog cancel or end the event.

            

Raw data

            {
    "_id": null,
    "home_page": "https://ulfaric.github.io/Akatosh/",
    "name": "Akatosh",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.7",
    "maintainer_email": null,
    "keywords": null,
    "author": "ulfaric",
    "author_email": "ryf0510@live.com",
    "download_url": "https://files.pythonhosted.org/packages/55/4d/d43bf4b1407b9e2faef909fab63ee142fcbd020e4e7fa50c449fd5d69d7e/akatosh-3.1.7.tar.gz",
    "platform": null,
    "description": "# Akatosh\n\n`Akatosh` is a light-weighted disceret event simulation library. Unlike popular library `Simpy` which is progress-oriented and you have to write generator function for simulated events or events interaction, `Akatosh` is fully object-oriented that events are encapsulated as `InstantEvent`/`ContinousEvent` with states, priority and a life-cycle. The actual impact of events are simply regular python functions. You could create events all at once, or create event within event. In addition, `Akatosh` is async which means event that are happening at the same simulated time will be executed simultaneously for real, unless they have different priority.\n\n`Akatosh` also support `Resource`, provide all functionalities as it is in `Simpy` with extra utilities and interaction with `Entity`. The `Entity` is unique to `Akatosh` which represents a abstract entity with a life-cycle, for example a follower. The `Entity` supports utility functions to interact with `Resource` and automatically releases all its occupied resources upon termination.\n\nYou probably already noticed that `Akatosh` is the name of \"Dragon God of Time\" in elder scroll serie, therefore the singleton class `Mundus` is the core of the simulation. The `Mundus` will schedule the events, move forward time and engage async execution.\n\nThis work is licensed under CC BY-NC-ND 4.0. To view a copy of this license, visit <https://creativecommons.org/licenses/by-nc-nd/4.0/>\n\nTo use `Akatosh`:\n\n```bash\npip install -U Akatosh\n```\n\nA basic example is showing below, for more information please look at *Examples* and *API Reference*, full documentation is available at https://ulfaric.github.io/Akatosh/.\n\n```py\nfrom Akatosh.universe import universe\nfrom Akatosh.resource import Resource\nfrom Akatosh.entity import Entity\nfrom Akatosh.event import Event\n\n# create a resource with capacity of 100 and current level 50\nres = Resource(100.0, 50.0)\n\n# create a instance event happens at 0.9s\nlock = Event(0.9,0.9, lambda: print(\"Unlocked!\"))\n\n# indicate a user entity should be created after lock event ended, wait till 1.1s.\nuser = Entity(lock, 1.1, \"User\")\n\n# indicate user entity engage a event at 1.2s\n@user.event(1.2,1.2, \"Use Resource\")\ndef user_event():\n    if res.distribute(user, 1):\n        print(res.level)\n    else:\n        print(\"Not enough resource\")\n\n\n# run simulation for 1.2s\nuniverse.simulate(1.2)\n```\n\n## Update Log\n### 3.1.5\n- Fix the entity event creation bug.\n\n### 3.1.4\n- Fix the logger format.\n\n### 3.1.3\n- Remove time scale feature due to its complexity and issue for causing time desynchronization.\n- Rewrite the Mundus time property for better reliability in real-time mode.\n- Change to IEC 61131-3 standard implementation:\n  - Event will default to stop if deadline is exceeded and no watchdog function is provided.\n  - Event will not stop if watchdog function is provided, unless the watchdog cancel or end the event.\n",
    "bugtrack_url": null,
    "license": "CC-BY-NC-ND-4.0",
    "summary": "Discrete event simulation framework supports real-time simulation without time step!",
    "version": "3.1.7",
    "project_urls": {
        "Homepage": "https://ulfaric.github.io/Akatosh/",
        "Repository": "https://github.com/ulfaric/Akatosh"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0cc2df07c848a3689b2cfa156cd9746278bf907c05b8fb9969c60109faf48172",
                "md5": "9ed63fc9c20692df798710062edb96ed",
                "sha256": "f279a10dea6358bf807cef1263a4ebfdc72cffbf62d71e840dd4c7aec9dfac88"
            },
            "downloads": -1,
            "filename": "akatosh-3.1.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9ed63fc9c20692df798710062edb96ed",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.7",
            "size": 15151,
            "upload_time": "2024-10-01T03:27:36",
            "upload_time_iso_8601": "2024-10-01T03:27:36.540247Z",
            "url": "https://files.pythonhosted.org/packages/0c/c2/df07c848a3689b2cfa156cd9746278bf907c05b8fb9969c60109faf48172/akatosh-3.1.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "554dd43bf4b1407b9e2faef909fab63ee142fcbd020e4e7fa50c449fd5d69d7e",
                "md5": "7a95006688b6810c46c857e1dcce04b8",
                "sha256": "afb6532fb39596f8c14562b943ee635bd369d1b95f7bfb5027e13cffea482aa8"
            },
            "downloads": -1,
            "filename": "akatosh-3.1.7.tar.gz",
            "has_sig": false,
            "md5_digest": "7a95006688b6810c46c857e1dcce04b8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.7",
            "size": 13160,
            "upload_time": "2024-10-01T03:27:39",
            "upload_time_iso_8601": "2024-10-01T03:27:39.436040Z",
            "url": "https://files.pythonhosted.org/packages/55/4d/d43bf4b1407b9e2faef909fab63ee142fcbd020e4e7fa50c449fd5d69d7e/akatosh-3.1.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-01 03:27:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ulfaric",
    "github_project": "Akatosh",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "akatosh"
}
        
Elapsed time: 0.87197s