Skip to main content

PyCxsim is a framework to simulate computational agents in a confined environment.

Project description

PyCxsim Logo

docs Tests

Note: PyCxsim is still under active development.

Documentation.

Installation

You can install the latest version of PyCxsim directly from the GitHub repository (>=Python 3.8):

pip install git+https://github.com/Aatamte/PyCxsim.git

or directly from pip:

pip install pycxsim

Overview

PyCxsim is a framework to simulate computational agents in a confined environment.

Structure

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

Examples

  1. Simulate a marketplace made up of computational agents, based off experiments in the paper “An Experimental Study of Competitive Market Behavior” by Vernon Smith.
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
    • Agents can trade goods with each other (capital <-> good transactions only)
  • Dialogue
    • Messaging
  • Gridworld
    • Agents can move around the map

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

pycxsim-0.1.5.tar.gz (3.6 MB view details)

Uploaded Source

Built Distribution

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

pycxsim-0.1.5-py3-none-any.whl (80.5 kB view details)

Uploaded Python 3

File details

Details for the file pycxsim-0.1.5.tar.gz.

File metadata

  • Download URL: pycxsim-0.1.5.tar.gz
  • Upload date:
  • Size: 3.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for pycxsim-0.1.5.tar.gz
Algorithm Hash digest
SHA256 f5746dae769bbbf7f651dee7e037fe43ea5c55edf094f70fc837dff315bf6c09
MD5 8ee6ade15d94a69429fef35edc5cc2a4
BLAKE2b-256 c1a109413ce6ea5b638db59f2c276709bf3727f40d594874ce380af5b7ae9856

See more details on using hashes here.

File details

Details for the file pycxsim-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: pycxsim-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 80.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for pycxsim-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 532a689ce3e9722b07720ffc2164f2e02121f2468d8d97f30ebebc42135603df
MD5 c775c3549cf23b1d3a4e0507388f6ae3
BLAKE2b-256 e4205e7a3265218030353ee103dda39bfc7dded0f981705ba60978457f5971b5

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