A toolkit for agent-based modeling of human systems. This framework is designed to be theory-independent, extensible, and very easy to use.
We are actively searching for collaborators and users of this toolkit! If you want to use this toolkit to perform simulations, implement a cognitive/behavioral theory, or test out add your machine-learning model to our collection please contact me (email@example.com) and I will be thrilled to help you. You may also find more information in the wiki page.
This is not the only way to install, but we're going to walk you through the easiest way.
- install python 2.7 (other versions might work)
- install git
- download & install pylab & dependencies
- download behaviorSim using git
- cd into behaviorSim directory & start behaviorSimUI.py
- open a terminal (ctrl+alt+t)
- install python
sudo apt-get install python
- install pylab
sudo apt-get install python-numpy python-scipy python-matplotlib
- install git
sudo apt-get install git
- download behaviorSim source code
git clone https://github.com/PIELab/behaviorSim.git
- enter behaviorSim directory
- start behaviorSim main UI
- download & install Enthought Canopy version of python 2.7 (NOTE: python(x,y) may be a valid alternative.)
- download & install git
- open git bash command prompt
cd Documentsto enter your documents directory
git clone https://github.com/PIELab/behaviorSim.gitto download behaviorSim source code
- open canopy command prompt window
cd Documents/behaviorSimto enter behaviorSim directory
- start behaviorSim main UI by typing
additional troubleshooting stuff:
- test python install by checking version. Type
python -Vin command prompt; if this does not work try something like
these instructions used to be included, but don't really work:
git clone firstname.lastname@example.org:matplotlib/matplotlib.git in cmd prompt to download matplotlib
cd matplotlib in cmd propmt to enter matplotlib directory
python setup.py install (or
C:\Python27\python.exe setup.py install) to install
If you are trying to use some more advanced features of the software, you may need to do some more setup.
The following modules are required to use certain features, but the core software can be run without them.
- The horizonGraph plotter requires an install of the matplotlib add-on from thomaskern/horizongraph_matplotlib.
- viewing informationFlow graphs using requires graphViz. Simply install with "sudo apt-get graphviz".
The following dependencies are packaged into the behaviorSim.__util directory and no setup or worry about them is needed, but they help make this work possible and merit mention here:
- pydot for creating informationFlow graphs. MIT License
- ddeint for solving delay differential equations. Unlicensed, published for public use.
- appdirs - "A small Python module for determining appropriate platform-specific dirs". MIT License.
- progressbar 2.2 - "Text progressbar library for python." GNU LGPL.
If you would like to add functions or data objects to the agent, it is best to keep them nested in their proper location in following package structure. Please try to refrain from changing the existing data objects and only add if absolutely necessary. If you are going to add a piece of information to one of the components, use the dataObject() class in __util/agentData.py. The idea here is to build up a complete data structure for behavior modeling and allow the functions associated with each piece of information to be swapped out easily. myScript.py (run any scripts or start python here) src/ PECSagent/ agent.py settings.py inputs/ inputs.py (implementation packages here) state/ state.py (implementation packages here) motive/ motive.py (implementation packages here) output/ output.py (implementation packages here)
The agent model is split into the following components in an attempt to make flow of information through the agent more organized. Please see the wiki page on information flow for more information, and consider the following descriptions of model components.
Inputs represent the context of the agent. This input comes from the environment exterior to the agent or from past actions of the agent.
This component represents the internal state of the agent. All information here should be a property of the agent. These states are separated into the four componenents which give the PECS model its name: Physical, Emotional, Cognitive, and Social.
The motives of an agent are analagous to the 'dependent variables' of the PECS reference model, and represent the motivations, drives, and intentions of the agent.
The output of the agent shows the agent's behavior as determined from motives, states, and inputs.
Adding to the Model
The PECS model framework is designed to be extended to allow for the exploration of many behavior models. The following steps should be take to add to the model:
- Add your package to the applicable component. For instance, a new input definition, your package should be added to PECSagent/Inputs/.
- Adjust component definition. The contents of the default component definition should be adjusted to use your new package or to add your new variables. For example: if you intend to add a new state variable, you must add the variable to PECSagent/state/state.py. If you are just changing the way an existing state variable is calculated, you can just change the import statement at the top of the file or load your custom function in a script. NOTE: only add to the component definitions; never remove variables. Ideally, your package can use existing variables but all state variables are not yet incorporated. Please add variables with caution and use descriptive names to enable re-use by other packages.