Skip to main content

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:

  1. Create an event with lambda expression

     Actor(action = lambda: print("All hail dragonborn!"))
    
  2. 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!")
    
  3. Create an event by subclass:

      class Myevent(Actor):
    
         def action(self):
             print("All hail dragonborn!")
    
      Myevent()
    
  4. 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

Akatosh-1.6.9.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Akatosh-1.6.9-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

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

Hashes for Akatosh-1.6.9.tar.gz
Algorithm Hash digest
SHA256 360c428ccf18aa1db3bbc21870abf5284bdca0286a69539984bf6590579bc810
MD5 686fecd32012877cba1b4c2b230a64cc
BLAKE2b-256 b88f5cb0aace7b3cd3ab8b20f1be73cf70eede4ad47e1df1dc08ba9ca3ad3bf7

See more details on using hashes here.

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

Hashes for Akatosh-1.6.9-py3-none-any.whl
Algorithm Hash digest
SHA256 f680504dfbc982f94081beaf52aa174ca8cf8df373de4bf138e3b1e60b5dc1d9
MD5 7926d39ae88c47b2d1b004b14b71ad27
BLAKE2b-256 9de2c0c2f11060cb7a2361852448c2d1438e45029ab306008865179c3fb0c740

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page