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:
- check(self, trace: dict[PetriNet.Transition | str, int]) -> bool. Used for checking conditions by traveled path
- still_relevant(self, trace: dict[PetriNet.Transition | str, int]) -> bool. Used for checking the conditions for relevance
- 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:
- a occurs before b (a < b). In case of cyclic interactions after the first 'a' there can be any number of 'b'
- 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
- a does not occur before b (a !< b)
- 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:
- Import/create Petri nets and initial markings by using pm4py
- Create iterable object of conditions
- Create MultiAgentSystems object (pass him Petri nets, marking, time of start logging (optional) and duration of transition's trigger (optional))
- 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)
- 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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21abf8cd6c2b59aa11da91351117d3cbd90f129e6e55e5be368d23e828850623
|
|
| MD5 |
b4ee8d93ba329215e3a57498051d395d
|
|
| BLAKE2b-256 |
9d97ec96e12b6fc925fcaf7efcaf65b87a056eb9a5c5f28f0f3932dfefa3e31a
|
File details
Details for the file multi_agent_systems-1.0.0-py3-none-any.whl.
File metadata
- Download URL: multi_agent_systems-1.0.0-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86a2aa251ba11a0c66cd148d8d623c39e0d1cf7ebad13aeb089c3dc59df47d9f
|
|
| MD5 |
32599505e28b9fa5abd67fc2172ac3fd
|
|
| BLAKE2b-256 |
26583e818ca9946941858e07e3ace951144b43cb2fb9031ce2d8d51076a20924
|