This project integrates a CPN-Tools model with Python to generate an object-centric event log (OCEL) enriched with sustainability data.
- Install CPN-Tools.
- Get Climatiq API key and insert it in
config.py
(renameconfig.py.default
) - Run
pip install -r requirements.txt
. - Run
cpn_api_start.py
to start the local API. - Run simulation in CPN-Tools. Preconfigured, it needs to run for 60000 cycles. After that the API connection needs to be closed manually in CPN-Tools by trigering the close transition.
The sOCEL (csvs and xml) can be analyzed using analyse_socel_csvs.ipynb and analyse_socel_xml.ipynb.
- In CPN-Tools under
declarations
, setAPI_ENABLED
tofalse
in the SML code and don't start thecpn_api
tool for simulation.
/cpn
: Contains the CPN-Tools model and the necessary SML code. SetAPI_ENABLED
tofalse
in the SML code to run in dummy mode without a backend./cpn_api
: Contains a Python tool that connects to CPN-Tools via socket. Usecpn_api_frontend.ipynb
for configuring calls to include sustainability data./data
: Stores the sOCEL in CSV and XML formats, along with configuration files forcpn_api
.
If CPN Tools displays a "Compile error when generating code", use /misc/remap_cpn_tools_ids.py
on an uncompromised file to remap the IDs of the CPN model.
Based on/using: