Skip to main content

A simple implement for discrete events simulation.

Project description

#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 for telemetries collection 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.

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/.

import logging

from Akatosh import event, Mundus

# create two instant event at simulation time 1.0 and 5.0
@event(at=5)
def hellow_world_again():
    print(f"{Mundus.now}:\tHello World! Again!")


@event(at=1)
def hellow_world():
    print(f"{Mundus.now}:\tHello World!")

# enable debug message
Mundus.set_logger(logging.DEBUG)

# run simulation for 6s
Mundus.simulate(6)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Akatosh-2.2.3.tar.gz (10.4 kB view hashes)

Uploaded Source

Built Distribution

Akatosh-2.2.3-py3-none-any.whl (12.7 kB view hashes)

Uploaded Python 3

Supported by

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