![PyCxsim Logo](docs/assets/pycxsim_full_logo.png)
[![docs](https://github.com/Aatamte/PyCxsim/workflows/docs/badge.svg)](https://Aatamte.github.io/PyCxsim/)
![Tests](https://github.com/Aatamte/PyCxsim/actions/workflows/python-tests.yml/badge.svg)
Note: PyCxsim is still under active development.
[Documentation](https://Aatamte.github.io/PyCxsim/).
## Installation
You can install the latest version of PyCxsim directly from the GitHub repository (>=Python 3.8):
```bash
pip install git+https://github.com/Aatamte/PyCxsim.git
```
or directly from pip:
```bash
pip install pycxsim
```
## Overview
PyCxsim is a framework to simulate computational agents in a confined environment.
### Structure
```Python
from cxsim import Environment
from cxsim.artifacts import Marketplace
from cxsim.agents import Agent
# defining an environment
cxenv = Environment()
# adding an Artifact to the environment
market = Marketplace()
cxenv.add(market)
#adding an agent to the environment
agent = Agent()
cxenv.add(agent)
#the simulation loop
for episode in cxenv.iter_episodes():
# start the next episode
cxenv.reset()
for step in cxenv.iter_steps():
# start the next step
cxenv.step()
```
### GUI
One of the unique (and cool!) features of Pycxsim is the embedded GUI.
![Image Description](./docs/assets/GUI_example.JPG)
## Examples
1. Simulate a marketplace made up of computational agents, based off experiments in the paper [“An Experimental Study of Competitive Market Behavior”](https://digitalcommons.chapman.edu/cgi/viewcontent.cgi?article=1027&context=economics_articles) by Vernon Smith.
```Python
from cxsim.examples import Smith1962Environment
import openai
import os
openai.api_key = os.environ["openai_api_key"]
cxenv = Smith1962Environment(n_agents=10, model_id="gpt-4")
cxenv.test_one(market_depth=10)
```
## Standard Artifacts
Below are the standard artifacts provided with the CAES package:
- [Marketplace](https://github.com/Aatamte/CAES/blob/main/src/caes/artifacts/marketplace.py)
- Agents can trade goods with each other (capital <-> good transactions only)
- [Dialogue](https://github.com/Aatamte/CAES/blob/main/src/caes/artifacts/dialogue.py)
- Messaging
- Gridworld
- Agents can move around the map
Raw data
{
"_id": null,
"home_page": "https://github.com/Aatamte/PyCxsim",
"name": "pycxsim",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "Artificial Intelligence,Simulation",
"author": "Aaron Tamte",
"author_email": "aaron2804@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/c1/a1/09413ce6ea5b638db59f2c276709bf3727f40d594874ce380af5b7ae9856/pycxsim-0.1.5.tar.gz",
"platform": null,
"description": "![PyCxsim Logo](docs/assets/pycxsim_full_logo.png)\r\n\r\n[![docs](https://github.com/Aatamte/PyCxsim/workflows/docs/badge.svg)](https://Aatamte.github.io/PyCxsim/)\r\n![Tests](https://github.com/Aatamte/PyCxsim/actions/workflows/python-tests.yml/badge.svg)\r\n\r\nNote: PyCxsim is still under active development.\r\n\r\n[Documentation](https://Aatamte.github.io/PyCxsim/).\r\n\r\n## Installation\r\n\r\nYou can install the latest version of PyCxsim directly from the GitHub repository (>=Python 3.8):\r\n\r\n```bash\r\npip install git+https://github.com/Aatamte/PyCxsim.git\r\n```\r\n\r\nor directly from pip:\r\n\r\n```bash\r\npip install pycxsim\r\n```\r\n\r\n## Overview\r\n\r\nPyCxsim is a framework to simulate computational agents in a confined environment.\r\n\r\n### Structure\r\n\r\n```Python\r\nfrom cxsim import Environment\r\nfrom cxsim.artifacts import Marketplace\r\nfrom cxsim.agents import Agent\r\n\r\n# defining an environment\r\ncxenv = Environment()\r\n\r\n# adding an Artifact to the environment\r\nmarket = Marketplace()\r\ncxenv.add(market)\r\n\r\n#adding an agent to the environment\r\nagent = Agent()\r\ncxenv.add(agent)\r\n\r\n#the simulation loop\r\nfor episode in cxenv.iter_episodes():\r\n # start the next episode\r\n cxenv.reset()\r\n \r\n for step in cxenv.iter_steps():\r\n # start the next step\r\n cxenv.step()\r\n\r\n```\r\n\r\n\r\n### GUI\r\n\r\nOne of the unique (and cool!) features of Pycxsim is the embedded GUI.\r\n\r\n![Image Description](./docs/assets/GUI_example.JPG)\r\n\r\n## Examples\r\n\r\n1. Simulate a marketplace made up of computational agents, based off experiments in the paper [\u201cAn Experimental Study of Competitive Market Behavior\u201d](https://digitalcommons.chapman.edu/cgi/viewcontent.cgi?article=1027&context=economics_articles) by Vernon Smith.\r\n```Python\r\nfrom cxsim.examples import Smith1962Environment\r\nimport openai\r\nimport os\r\n\r\nopenai.api_key = os.environ[\"openai_api_key\"]\r\n\r\ncxenv = Smith1962Environment(n_agents=10, model_id=\"gpt-4\")\r\ncxenv.test_one(market_depth=10)\r\n```\r\n\r\n## Standard Artifacts\r\n\r\nBelow are the standard artifacts provided with the CAES package:\r\n\r\n- [Marketplace](https://github.com/Aatamte/CAES/blob/main/src/caes/artifacts/marketplace.py)\r\n - Agents can trade goods with each other (capital <-> good transactions only)\r\n- [Dialogue](https://github.com/Aatamte/CAES/blob/main/src/caes/artifacts/dialogue.py)\r\n - Messaging \r\n- Gridworld\r\n - Agents can move around the map\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "PyCxsim is a framework to simulate computational agents in a confined environment.",
"version": "0.1.5",
"project_urls": {
"Homepage": "https://github.com/Aatamte/PyCxsim"
},
"split_keywords": [
"artificial intelligence",
"simulation"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e4205e7a3265218030353ee103dda39bfc7dded0f981705ba60978457f5971b5",
"md5": "c775c3549cf23b1d3a4e0507388f6ae3",
"sha256": "532a689ce3e9722b07720ffc2164f2e02121f2468d8d97f30ebebc42135603df"
},
"downloads": -1,
"filename": "pycxsim-0.1.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c775c3549cf23b1d3a4e0507388f6ae3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 80540,
"upload_time": "2023-10-25T22:45:48",
"upload_time_iso_8601": "2023-10-25T22:45:48.347128Z",
"url": "https://files.pythonhosted.org/packages/e4/20/5e7a3265218030353ee103dda39bfc7dded0f981705ba60978457f5971b5/pycxsim-0.1.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c1a109413ce6ea5b638db59f2c276709bf3727f40d594874ce380af5b7ae9856",
"md5": "8ee6ade15d94a69429fef35edc5cc2a4",
"sha256": "f5746dae769bbbf7f651dee7e037fe43ea5c55edf094f70fc837dff315bf6c09"
},
"downloads": -1,
"filename": "pycxsim-0.1.5.tar.gz",
"has_sig": false,
"md5_digest": "8ee6ade15d94a69429fef35edc5cc2a4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 3558072,
"upload_time": "2023-10-25T22:45:53",
"upload_time_iso_8601": "2023-10-25T22:45:53.601761Z",
"url": "https://files.pythonhosted.org/packages/c1/a1/09413ce6ea5b638db59f2c276709bf3727f40d594874ce380af5b7ae9856/pycxsim-0.1.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-25 22:45:53",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Aatamte",
"github_project": "PyCxsim",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "pycxsim"
}