A simple implement for discrete events simulation.
Project description
Akatosh
This is a light weighted disceret event simulation library. The name is from the Dragon God of Time in Elder Scroll. :)
Install
pip install --upgrade Akatosh
How to use
Import modules:
from Akatosh import Mundus, Actor
create actors, aka event:
There are serveral ways that you can create an event:
-
Create an event with lambda expression
Actor(action = lambda: print("All hail dragonborn!")) -
Create an event with defined functions:
#funtion without arguments def hail(): print("All hail dragonborn!") Actor(action = hail) #function with arguments def hail(message: str): print(message) Actor(action = hail, message = "All hail dragonborn!") -
Create an event by subclass:
class Myevent(Actor): def action(self): print("All hail dragonborn!") Myevent() -
Create with decorator (new!)
#directly create an event with a function: @event() def hail(): print(f"{Mundus.now}:\tHail Akatosh!") #create a on call event, that is the decorated function must be called to actually make the event @event(on_call=True) def dragon_shout(msg:str="Ros Fu Da!"): print(f"{Mundus.now}:\t{msg}")
To start the simulation,
Mundus.simulate(till=inf)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file Akatosh-1.6.9.tar.gz.
File metadata
- Download URL: Akatosh-1.6.9.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
360c428ccf18aa1db3bbc21870abf5284bdca0286a69539984bf6590579bc810
|
|
| MD5 |
686fecd32012877cba1b4c2b230a64cc
|
|
| BLAKE2b-256 |
b88f5cb0aace7b3cd3ab8b20f1be73cf70eede4ad47e1df1dc08ba9ca3ad3bf7
|
File details
Details for the file Akatosh-1.6.9-py3-none-any.whl.
File metadata
- Download URL: Akatosh-1.6.9-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f680504dfbc982f94081beaf52aa174ca8cf8df373de4bf138e3b1e60b5dc1d9
|
|
| MD5 |
7926d39ae88c47b2d1b004b14b71ad27
|
|
| BLAKE2b-256 |
9de2c0c2f11060cb7a2361852448c2d1438e45029ab306008865179c3fb0c740
|