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:
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/.
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.
Metadata
Release files for Akatosh 3.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| akatosh-3.1.7.tar.gz | 13.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| akatosh-3.1.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.3 kB
Release files / akatosh-3.1.7.tar.gz
| Download URL | akatosh-3.1.7.tar.gz |
|---|---|
| Size | 13.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
afb6532fb39596f8c14562b943ee635bd369d1b95f7bfb5027e13cffea482aa8
|
|
BLAKE2b-256 checksum How to use checksums |
554dd43bf4b1407b9e2faef909fab63ee142fcbd020e4e7fa50c449fd5d69d7e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.6 Windows/11
|
Release files / akatosh-3.1.7-py3-none-any.whl
| Download URL | akatosh-3.1.7-py3-none-any.whl |
|---|---|
| Size | 15.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f279a10dea6358bf807cef1263a4ebfdc72cffbf62d71e840dd4c7aec9dfac88
|
|
BLAKE2b-256 checksum How to use checksums |
0cc2df07c848a3689b2cfa156cd9746278bf907c05b8fb9969c60109faf48172
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.6 Windows/11
|