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/
Raw data
{
"_id": null,
"home_page": "https://github.com/haleen24/MultiAgentSystems.git",
"name": "multi-agent-systems",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "multi-agent-systems simulating",
"author": "haleen24",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/9d/97/ec96e12b6fc925fcaf7efcaf65b87a056eb9a5c5f28f0f3932dfefa3e31a/multi_agent_systems-1.0.0.tar.gz",
"platform": null,
"description": "This library allows you to simulate multi-agent-system using pm4py representation of Petri nets\r\n\r\n### About conditions:\r\n\r\nThere are several types of conditions in package simulating/conditions.\r\ncondition.py - contains a definition of abstract class. This class contains following methods:\r\n\r\n1. check(self, trace: dict[PetriNet.Transition | str, int]) -> bool. Used for checking conditions by traveled path\r\n2. still_relevant(self, trace: dict[PetriNet.Transition | str, int]) -> bool. Used for checking the conditions for\r\n relevance\r\n3. get_dependent(self) -> Iterable[PetriNet.Transition | str]. Used to get dependent part of condition. See\r\n\r\nLet a and b are transitions in some Petri net, then\r\nthe library provides following types of condition:\r\n\r\n1. a occurs before b (a < b). In case of cyclic interactions after the first 'a' there can be any number of 'b'\r\n2. a occurs before b with cyclic interaction. Provides following opportunity for transitions: for each 'b' in trace\r\n should be\r\n own 'a'. For example, the trace a -> ... -> a -> ... -> b -> ... -> b also satisfies the condition\r\n3. a does not occur before b (a !< b)\r\n4. a set of transitions must be triggered synchronously. This condition also can be used with cycled interactions. By\r\n default, after first trigger of all synchronized transition, the condition become irrelevant. If cycled mod enabled,\r\n the condition is always relevant\r\n\r\n### How to use library for simulating multi-agent-systems:\r\n\r\n1. Import/create Petri nets and initial markings by using pm4py\r\n2. Create iterable object of conditions\r\n3. Create MultiAgentSystems object (pass him Petri nets, marking, time of start logging (optional) and duration of\r\n transition's trigger (optional))\r\n4. Create traces trough method create_traces. You can pass number of traces (by default = 1) and maximal depth (by\r\n default = 2 * sum of number of elements in all nets). This method return list of event logs (\r\n simulating/log/event_log.py)\r\n5. You can export in csv the list from previous step by using method export_csv from simulating/log/export.py\r\n\r\n###### 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/\r\n",
"bugtrack_url": null,
"license": null,
"summary": "Module for simulating multi-agent-systems using Petri nets from pm4py",
"version": "1.0.0",
"project_urls": {
"Documentation": "https://github.com/haleen24/MultiAgentSystems.git",
"Homepage": "https://github.com/haleen24/MultiAgentSystems.git"
},
"split_keywords": [
"multi-agent-systems",
"simulating"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "26583e818ca9946941858e07e3ace951144b43cb2fb9031ce2d8d51076a20924",
"md5": "32599505e28b9fa5abd67fc2172ac3fd",
"sha256": "86a2aa251ba11a0c66cd148d8d623c39e0d1cf7ebad13aeb089c3dc59df47d9f"
},
"downloads": -1,
"filename": "multi_agent_systems-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "32599505e28b9fa5abd67fc2172ac3fd",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 10123,
"upload_time": "2024-07-22T18:44:08",
"upload_time_iso_8601": "2024-07-22T18:44:08.026480Z",
"url": "https://files.pythonhosted.org/packages/26/58/3e818ca9946941858e07e3ace951144b43cb2fb9031ce2d8d51076a20924/multi_agent_systems-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9d97ec96e12b6fc925fcaf7efcaf65b87a056eb9a5c5f28f0f3932dfefa3e31a",
"md5": "b4ee8d93ba329215e3a57498051d395d",
"sha256": "21abf8cd6c2b59aa11da91351117d3cbd90f129e6e55e5be368d23e828850623"
},
"downloads": -1,
"filename": "multi_agent_systems-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "b4ee8d93ba329215e3a57498051d395d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 6565,
"upload_time": "2024-07-22T18:44:09",
"upload_time_iso_8601": "2024-07-22T18:44:09.534357Z",
"url": "https://files.pythonhosted.org/packages/9d/97/ec96e12b6fc925fcaf7efcaf65b87a056eb9a5c5f28f0f3932dfefa3e31a/multi_agent_systems-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-22 18:44:09",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "haleen24",
"github_project": "MultiAgentSystems",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "multi-agent-systems"
}