This repository contains a discrete event simulator to evaluate trust-based interactions between agents with limited memory.
Memory is represented via four buffers with fixed sizes:
- Cryptographic
- Trust
- Reputation
- Stereotypes
Different buffer eviction strategies are implemented to evaluate which produces the highest utility of information contained in those buffers.
Install dependencies
sudo apt-get install python3 cm-super graphviz graphviz-devSet up a venv
python3 -m venv .venv
source .venv/bin/activateInstall Python dependencies:
python -m pip install matplotlib numpy scipy hmmlearn tqdm pygraphviz seaborn more_itertools frozenlist typing_extensions cuckoopyor alternatively, install from requirements.txt:
python -m pip install -r requirements.txtrun.sh defines running multiple eviction strategies and agent behaviours for different sized buffers.
run_multiple.py can be used to obtain a large number of repeats and run-graphics.sh can be used to obtain graph results for an individual run.
python3 run_multiple.pyTo perform a run with a specific seed call run.sh or run-graphics.sh such as:
SEED=10 ./run.sh./analyse_individual.py create graphs for a single simulation.
./graph_individual.py <Behaviour>/<Eviction Strategy>/<buffer size>-metrics.<seed>.pickle.bz2Individual results need to be combined for them to be graphed
./combine_results.py VeryGoodBehaviour/* AlwaysGoodBehaviour/* UnstableBehaviour/* GoodBehaviour/*./graph_multiple.py VeryGoodBehaviour/* AlwaysGoodBehaviour/* UnstableBehaviour/* GoodBehaviour/*Trust models with different sizes will consume different amounts of space. The following script can be used to visualise this.
./graph_space.py VeryGoodBehaviour/* AlwaysGoodBehaviour/* UnstableBehaviour/* GoodBehaviour/*The following script can be used to visualise the evolution of buffer content over time.
mkdir -p "<out-dir>/"
./graph_buffers.py <Behaviour>/<Eviction Strategy>/<buffer size>-metrics.<seed>.pickle.bz2 --path-prefix "<out-dir>/"