Skip to main content

Module for simulating multi-agent-systems using Petri nets from pm4py

Project description

This library allows you to simulate multi-agent-system using pm4py representation of Petri nets

About conditions:

There are several types of conditions in package simulating/conditions. condition.py - contains a definition of abstract class. This class contains following methods:

  1. check(self, trace: dict[PetriNet.Transition | str, int]) -> bool. Used for checking conditions by traveled path
  2. still_relevant(self, trace: dict[PetriNet.Transition | str, int]) -> bool. Used for checking the conditions for relevance
  3. get_dependent(self) -> Iterable[PetriNet.Transition | str]. Used to get dependent part of condition. See

Let a and b are transitions in some Petri net, then the library provides following types of condition:

  1. a occurs before b (a < b). In case of cyclic interactions after the first 'a' there can be any number of 'b'
  2. a occurs before b with cyclic interaction. Provides following opportunity for transitions: for each 'b' in trace should be own 'a'. For example, the trace a -> ... -> a -> ... -> b -> ... -> b also satisfies the condition
  3. a does not occur before b (a !< b)
  4. a set of transitions must be triggered synchronously. This condition also can be used with cycled interactions. By default, after first trigger of all synchronized transition, the condition become irrelevant. If cycled mod enabled, the condition is always relevant

How to use library for simulating multi-agent-systems:

  1. Import/create Petri nets and initial markings by using pm4py
  2. Create iterable object of conditions
  3. Create MultiAgentSystems object (pass him Petri nets, marking, time of start logging (optional) and duration of transition's trigger (optional))
  4. Create traces trough method create_traces. You can pass number of traces (by default = 1) and maximal depth (by default = 2 * sum of number of elements in all nets). This method return list of event logs ( simulating/log/event_log.py)
  5. You can export in csv the list from previous step by using method export_csv from simulating/log/export.py
In case of deadlock at least in one of simulated traces the create_traces method returns only trace that reached the deadlock. See example in ~/examples/1/

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

multi_agent_systems-1.0.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

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

multi_agent_systems-1.0.0-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file multi_agent_systems-1.0.0.tar.gz.

File metadata

  • Download URL: multi_agent_systems-1.0.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.0

File hashes

Hashes for multi_agent_systems-1.0.0.tar.gz
Algorithm Hash digest
SHA256 21abf8cd6c2b59aa11da91351117d3cbd90f129e6e55e5be368d23e828850623
MD5 b4ee8d93ba329215e3a57498051d395d
BLAKE2b-256 9d97ec96e12b6fc925fcaf7efcaf65b87a056eb9a5c5f28f0f3932dfefa3e31a

See more details on using hashes here.

File details

Details for the file multi_agent_systems-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for multi_agent_systems-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 86a2aa251ba11a0c66cd148d8d623c39e0d1cf7ebad13aeb089c3dc59df47d9f
MD5 32599505e28b9fa5abd67fc2172ac3fd
BLAKE2b-256 26583e818ca9946941858e07e3ace951144b43cb2fb9031ce2d8d51076a20924

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