Package: vlinder
Model: the Responsible Business SimulatorWelcome to the open-source GitHub repository of the Responsible Business Simulator (tRBS) model based on the book. This model is available in Python package vlinder.
This repo allows users to understand the framework and interact with the model, providing the opportunity to experiment,
evaluate, and collaborate. The tRBS model is designed to simulate the impact of business decisions on sustainability
and social responsibility. By open-sourcing the code, we promote transparency and invite contributions from
researchers and practitioners.In this repositoryThis repository containsAJupyter notebookto work with the model in an interactive wayThecore functionsof the tRBS modelThe following demo cases: beerwiser, DSM, IZZ and refugee caseLocal set-upStep 1:Connect with the repository. If you either need to set-up git and/or
authenticate with GitHub, seeGitHub's manual.git clone https://github.com/responsible-business-decision-making/trbs.gitStep 2:Move inside thetrbs-folder and install all required dependencies withpipenv. You might need to installpipenvif you have
not used this before.cd trbs
pip install pipenv
pipenv install
pipenv shellStep 3:Configure the pre-commit file. This file helps you adhere to a clean coding style and checks
amongst others for PEP8 violations.pre-commit installStep 4:Open the Jupyter notebook.jupyter notebookStep 5:Import Path in Jupyter notebook to retrieve input data of the cases.from pathlib import PathStep 6:Import theResponsibleBusinessSimulator model from the core folder.from core.trbs import TheResponsibleBusinessSimulatorStep 7:Retrieve the path of the data folder. This folder contains the input data of the cases.path = Path.cwd() / 'data'Step 8:Specify the file format of the input data and the case you want to investigate. By default we use Beerwiser case in xlsx format.file_format = 'xlsx'
name = 'beerwiser'Step 9:Call the Responsible Business Simulator to investigate the case.case = TheResponsibleBusinessSimulator(path, file_format, name)(optional) A1:Create a new branch if you want to work on a new feature, bug or case.git checkout -b 'NAME-OF-YOUR-BRANCH'(optional) A2:Run allpytesttests in the/modelfolder.cd model
python -m pytestVlinder package set-upStep 1:Install required dependencies via pip install.pip install pandas
pip install numpy
pip install openpyxl
pip install matplotlib
pip install xlsxwriterStep 2:Install package vlinder.pip install vlinderStep 3:Install Jupyter notebook to work with the model in an interactive way.pip install notebookStep 4:Open the Jupyter notebook.jupyter notebookStep 5:Import required packages in Jupyter notebook to retrieve input data of the cases.import os
from pathlib import PathStep 6:Import package vlinder (abbreviated as vl) in Jupyter notebook.import vlinder as vl
from vlinder import *Step 7:Retrieve the path of the data folder from the package. This folder contains the input data of the cases.path = Path(os.path.dirname(vlinder.__file__)) / 'data'Step 8:Specify the file format of the input data and the case you want to investigate. By default we use Beerwiser case in xlsx format.file_format = 'xlsx'
name = 'beerwiser'Step 9:Call the Responsible Business Simulator to investigate the case.case = TheResponsibleBusinessSimulator(path, file_format, name)Code of ConductBe kindBe welcomingDon't be a jerk