# scml-vis
[![ci](https://github.com/yasserfarouk/scml-vis/actions/workflows/main.yml/badge.svg)](https://github.com/yasserfarouk/scml-vis/actions/workflows/main.yml)
[![documentation](https://img.shields.io/badge/docs-mkdocs%20material-blue.svg?style=flat)](https://scml-vis.github.io/scml-vis/)
[![pypi version](https://img.shields.io/pypi/v/scml-vis.svg)](https://pypi.org/project/scml-vis/)
[![gitter](https://badges.gitter.im/join%20chat.svg)](https://gitter.im/scml-vis/community)
A simple visualiser for SCML worlds and tournaments.
You can watch [a demo on YouTube](https://youtu.be/BCDjnnSmIsk)
[![Alt text](https://img.youtube.com/vi/BCDjnnSmIsk/0.jpg)](https://youtu.be/BCDjnnSmIsk)
<!-- <iframe width="560" height="315" src="https://www.youtube.com/embed/BCDjnnSmIsk" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> -->
<!-- -->
## Screenshots
![Screen Shot 1](docs/shot1.png)
![Screen Shot 2](docs/shot2.png)
## Main Features
- Displays any world/tournament run using the [SCML package](https://www.github.com/yasserfarouk/scml)
- Allows filtering using worlds, agent types, and agent instances
- Shows world statistics, agent type and instance statistics and contract
statistics as functions of simulation step/time
## Requirements
- scml-vis requires Python 3.8 or above.
- scml-vis can visualize worlds created by [scml](https://github.com/yasserfarouk/scml) 0.4.2 or later (simulations created using older versions of scml can be visualized in most cases but are not officially supported).
## Installation
With `pip`:
```bash
python3 -m pip install scml-vis
```
With `pipx`:
```bash
python3 -m pip install --user pipx
pipx install scml-vis
```
## Usage
The visualizer can be run using any of the following commands:
```bash
scmlv
scmlvis
scml-vis
```
Hereafter we will use the shorter version.
- To visualize any of the recently run worlds and tournaments just run:
```bash
scmlv show
```
This will open your browser and allow you to choose a world or a tournament to
display.
![show without parameters](docs/show.png)
- If this is the first time you visualize logs in this folder, you will be asked
to compile visualization data
![compile visualization data](docs/compile.png)
- If visualization data is available (or your pressed the `compile visualization data` button), you can now start visualizing the logs
![compile visualization data](docs/aftercompile.png)
- To visualize the logs in a specific folder, you can directly pass the folder as in:
```bash
scmlv show -f path-to-your-folder
```
- It is also possible to just compile visualization data without running the visualizer using:
```bash
scmlv compile path-to-your-folder
```
- The visualizer creates a database that it uses to create all the figures you see. You can directly explore this database using:
```bash
scmlv explore path-to-your-folder
```
This will open a [datasette](https://docs.datasette.io/en/stable/getting_started.html) page allowing you to explore this database
![datasette](docs/datasette.png)
This dataset will contain 8 tables describing everything that was logged in the world or tournament.
![datasette](docs/datasettelarge.png)
Please consult [datasette documentation](https://docs.datasette.io/en/stable/getting_started.html) for all the ways you can interact with this dataset.
## Available visualizations
To visualize your logs, you need to follow three steps:
1. Filter the dataset using the `Data Selection` section of the sidebar.
2. Choose the **family** of figures you would like to show from the `Figure Selection` dropdown in the sidebar. Currently we provide `Time-series`, `Tables` and `others` that are always available as well as `Networks` that are only available when you visualize a single world or filter the tournament to focus on a single world.
3. Choose the specific graph you want to see from the family selected in the previous step.
You can watch [a demo of this process here](https://youtu.be/BCDjnnSmIsk)
## TODO List (Good Ideas for PRs)
- ~~Show negotiation logs (i.e. negotiation results)~~
- ~~Display all contracts (i.e. in a table) based on selection criteria~~
- ~~Zoom on negotiation details (i.e. exchanged offers)~~
- ~~Add dynamic figures using plotly/altair~~
- ~~Add networkx like graphs of contracts / negotiations / offers~~
- ~~Allow starting the app without specifying a folder.~~
- ~~Add new figure types that do not have time/step in the x-axis.~~
- ~~Correcting the placement of weights on edges in network views.~~
- Adding a graph showing negotiation history in the ufun-space of negotiators (will require a change in the scml package).
- Add saving and loading of the visualizer's state (i.e. what is visible).
- Resolving the strange behavior of CI bands in plotly in some cases.
Raw data
{
"_id": null,
"home_page": "https://github.com/yasserfarouk/negmas",
"name": "scml-vis",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "negotiation, mas, multi-agent, simulation, AI, negmas, scml, scml-agents",
"author": null,
"author_email": "yasserfarouk@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/7f/ce/4424fcb7fcf0d02d3ecfcaeb4b6d96bf8e78d9f322a6e149c8f135efaf94/scml-vis-0.3.2.tar.gz",
"platform": null,
"description": "# scml-vis\n\n[![ci](https://github.com/yasserfarouk/scml-vis/actions/workflows/main.yml/badge.svg)](https://github.com/yasserfarouk/scml-vis/actions/workflows/main.yml)\n[![documentation](https://img.shields.io/badge/docs-mkdocs%20material-blue.svg?style=flat)](https://scml-vis.github.io/scml-vis/)\n[![pypi version](https://img.shields.io/pypi/v/scml-vis.svg)](https://pypi.org/project/scml-vis/)\n[![gitter](https://badges.gitter.im/join%20chat.svg)](https://gitter.im/scml-vis/community)\n\nA simple visualiser for SCML worlds and tournaments.\nYou can watch [a demo on YouTube](https://youtu.be/BCDjnnSmIsk)\n[![Alt text](https://img.youtube.com/vi/BCDjnnSmIsk/0.jpg)](https://youtu.be/BCDjnnSmIsk)\n<!-- <iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/BCDjnnSmIsk\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe> -->\n<!-- -->\n## Screenshots\n![Screen Shot 1](docs/shot1.png)\n![Screen Shot 2](docs/shot2.png)\n\n## Main Features\n\n- Displays any world/tournament run using the [SCML package](https://www.github.com/yasserfarouk/scml)\n- Allows filtering using worlds, agent types, and agent instances\n- Shows world statistics, agent type and instance statistics and contract\n statistics as functions of simulation step/time\n\n\n## Requirements\n\n- scml-vis requires Python 3.8 or above.\n- scml-vis can visualize worlds created by [scml](https://github.com/yasserfarouk/scml) 0.4.2 or later (simulations created using older versions of scml can be visualized in most cases but are not officially supported).\n\n## Installation\n\nWith `pip`:\n```bash\npython3 -m pip install scml-vis\n```\n\nWith `pipx`:\n```bash\npython3 -m pip install --user pipx\npipx install scml-vis\n```\n\n## Usage\n\nThe visualizer can be run using any of the following commands:\n```bash\nscmlv\nscmlvis\nscml-vis\n```\nHereafter we will use the shorter version.\n\n- To visualize any of the recently run worlds and tournaments just run:\n\t```bash\n\tscmlv show\n\t```\n\tThis will open your browser and allow you to choose a world or a tournament to\n\tdisplay.\n\t![show without parameters](docs/show.png)\n\n\t- If this is the first time you visualize logs in this folder, you will be asked\n\t to compile visualization data\n\t ![compile visualization data](docs/compile.png)\n\t- If visualization data is available (or your pressed the `compile visualization data` button), you can now start visualizing the logs\n\t ![compile visualization data](docs/aftercompile.png)\n- To visualize the logs in a specific folder, you can directly pass the folder as in:\n ```bash\n scmlv show -f path-to-your-folder\n ```\n- It is also possible to just compile visualization data without running the visualizer using:\n ```bash\n scmlv compile path-to-your-folder\n ```\n- The visualizer creates a database that it uses to create all the figures you see. You can directly explore this database using:\n ```bash\n scmlv explore path-to-your-folder\n ```\n This will open a [datasette](https://docs.datasette.io/en/stable/getting_started.html) page allowing you to explore this database\n ![datasette](docs/datasette.png)\n This dataset will contain 8 tables describing everything that was logged in the world or tournament. \n ![datasette](docs/datasettelarge.png)\n Please consult [datasette documentation](https://docs.datasette.io/en/stable/getting_started.html) for all the ways you can interact with this dataset.\n\n## Available visualizations\n\nTo visualize your logs, you need to follow three steps:\n\n1. Filter the dataset using the `Data Selection` section of the sidebar.\n2. Choose the **family** of figures you would like to show from the `Figure Selection` dropdown in the sidebar. Currently we provide `Time-series`, `Tables` and `others` that are always available as well as `Networks` that are only available when you visualize a single world or filter the tournament to focus on a single world.\n3. Choose the specific graph you want to see from the family selected in the previous step.\n\nYou can watch [a demo of this process here](https://youtu.be/BCDjnnSmIsk)\n\n## TODO List (Good Ideas for PRs)\n\n- ~~Show negotiation logs (i.e. negotiation results)~~\n- ~~Display all contracts (i.e. in a table) based on selection criteria~~\n- ~~Zoom on negotiation details (i.e. exchanged offers)~~\n- ~~Add dynamic figures using plotly/altair~~\n- ~~Add networkx like graphs of contracts / negotiations / offers~~\n- ~~Allow starting the app without specifying a folder.~~\n- ~~Add new figure types that do not have time/step in the x-axis.~~\n- ~~Correcting the placement of weights on edges in network views.~~\n- Adding a graph showing negotiation history in the ufun-space of negotiators (will require a change in the scml package).\n- Add saving and loading of the visualizer's state (i.e. what is visible).\n- Resolving the strange behavior of CI bands in plotly in some cases.\n\n\n",
"bugtrack_url": null,
"license": "Apache License 2.0",
"summary": "\"A simple visualiser for SCML worlds and tournaments\"",
"version": "0.3.2",
"project_urls": {
"Homepage": "https://github.com/yasserfarouk/negmas"
},
"split_keywords": [
"negotiation",
" mas",
" multi-agent",
" simulation",
" ai",
" negmas",
" scml",
" scml-agents"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7fce4424fcb7fcf0d02d3ecfcaeb4b6d96bf8e78d9f322a6e149c8f135efaf94",
"md5": "39dd16e1348c0850217f871afb96e597",
"sha256": "67271e7556a7a8ea4e7a8d118fa43f5b310a9afd370b31744e6296d1facabc42"
},
"downloads": -1,
"filename": "scml-vis-0.3.2.tar.gz",
"has_sig": false,
"md5_digest": "39dd16e1348c0850217f871afb96e597",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 3243909,
"upload_time": "2024-04-12T04:45:53",
"upload_time_iso_8601": "2024-04-12T04:45:53.082515Z",
"url": "https://files.pythonhosted.org/packages/7f/ce/4424fcb7fcf0d02d3ecfcaeb4b6d96bf8e78d9f322a6e149c8f135efaf94/scml-vis-0.3.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-12 04:45:53",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "yasserfarouk",
"github_project": "negmas",
"travis_ci": true,
"coveralls": true,
"github_actions": true,
"requirements": [
{
"name": "typer",
"specs": []
},
{
"name": "Click",
"specs": [
[
">=",
"6.0"
]
]
},
{
"name": "psutil",
"specs": []
},
{
"name": "PyYAML",
"specs": []
},
{
"name": "click-config-file",
"specs": [
[
">=",
"0.4.5"
]
]
},
{
"name": "colorlog",
"specs": []
},
{
"name": "inflect",
"specs": []
},
{
"name": "matplotlib",
"specs": []
},
{
"name": "numpy",
"specs": [
[
">=",
"1.16"
]
]
},
{
"name": "pandas",
"specs": [
[
">=",
"0.24.1"
]
]
},
{
"name": "progressbar2",
"specs": [
[
">=",
"3.39"
]
]
},
{
"name": "py4j",
"specs": []
},
{
"name": "pytest-runner",
"specs": [
[
">=",
"4.4"
]
]
},
{
"name": "pytest-timeout",
"specs": [
[
">=",
"1.3"
]
]
},
{
"name": "pytest-check",
"specs": []
},
{
"name": "scipy",
"specs": [
[
">=",
"1.2"
]
]
},
{
"name": "stringcase",
"specs": []
},
{
"name": "tabulate",
"specs": []
},
{
"name": "typing",
"specs": []
},
{
"name": "typing_extensions",
"specs": [
[
">=",
"3.7"
]
]
},
{
"name": "dill",
"specs": []
},
{
"name": "seaborn",
"specs": []
},
{
"name": "scikit-learn",
"specs": []
},
{
"name": "networkx",
"specs": []
},
{
"name": "gif",
"specs": []
},
{
"name": "rich",
"specs": []
},
{
"name": "pygments",
"specs": [
[
">=",
"2.7.4"
]
]
},
{
"name": "numba",
"specs": []
},
{
"name": "pillow",
"specs": [
[
">=",
"10.0.1"
]
]
}
],
"tox": true,
"lcname": "scml-vis"
}