Knihovna pro diskrétní simulaci v C++
Loading...
Date
Authors
Beňuš, Alexej
Advisor
Peringer, Petr
Referee
Hrubý, Martin
Mark
D
Journal Title
Journal ISSN
Volume Title
Publisher
Vysoké učení technické v Brně. Fakulta informačních technologií
ORCID
Abstract
Tato práce se zabývá návrhem a implementací knihovny pro diskrétně-událostní simulaci v jazyce C++. Knihovna podporuje procesně i událostně orientované modelování a využívá korutiny jazyka C++20 pro implementaci odlehčených simulačních procesů, které lze pozastavit a později obnovit bez použití systémových vláken. Implementace obsahuje sdílené prostředky, pravděpodobnostní rozdělení, sběr statistik a výměnné struktury kalendářů událostí. Zvláštní pozornost je věnována množině budoucích událostí, která patří mezi klíčové datové struktury diskrétně-událostního simulátoru. Knihovna obsahuje několik implementací kalendářů, včetně jednoduchých variant založených na datových strukturách standardní knihovny jazyka C++ a specializovaných struktur, jako jsou Calendar Queue, SNOOPy Calendar Queue a FELT Calendar. Knihovna je vyhodnocena pomocí testů korektnosti, benchmarků kalendářů, testů přenositelnosti a porovnání s knihovnou SIMLIB/C++. Výsledky ukazují, že vhodnost konkrétní kalendářové struktury závisí na velikosti zátěže a rozložení časových razítek. Porovnání se SIMLIB také ukazuje, že čas běhu výrazně závisí na zvoleném benchmarku: SIMLIB je rychlejší v benchmarku se sdíleným prostředkem, zatímco implementovaný simulátor dosahuje lepších výsledků v benchmarku se zpožděnými procesy a rozloženými příchody. V testovaných úlohách s velkým počtem procesů měl implementovaný simulátor také nižší spotřebu paměti než SIMLIB.
This thesis presents the design and implementation of a C++ library for discrete-event simulation. The library supports both process-oriented and event-oriented modelling and uses C++20 coroutines to implement lightweight simulation processes that can be suspended and resumed without using operating-system threads. The implementation includes resources, probability distributions, statistics collection, and interchangeable event calendar structures. Special attention is given to the pending event set, which is one of the central data structures in a discrete-event simulator. Several calendar implementations are provided, including simple structures based on standard C++ containers and specialized structures such as Calendar Queue, SNOOPy Calendar Queue, and FELT Calendar. The library is evaluated using correctness tests, calendar benchmarks, portability tests, and comparisons with SIMLIB/C++. The results show that the suitability of a calendar structure depends on the workload size and timestamp distribution. The comparison with SIMLIB also shows that runtime performance depends strongly on the selected benchmark: SIMLIB is faster in the resource-contention benchmark, while the implemented simulator performs better in the process-delay benchmark with distributed arrivals. In the tested large-process workloads, the implemented simulator also used less memory than SIMLIB.
This thesis presents the design and implementation of a C++ library for discrete-event simulation. The library supports both process-oriented and event-oriented modelling and uses C++20 coroutines to implement lightweight simulation processes that can be suspended and resumed without using operating-system threads. The implementation includes resources, probability distributions, statistics collection, and interchangeable event calendar structures. Special attention is given to the pending event set, which is one of the central data structures in a discrete-event simulator. Several calendar implementations are provided, including simple structures based on standard C++ containers and specialized structures such as Calendar Queue, SNOOPy Calendar Queue, and FELT Calendar. The library is evaluated using correctness tests, calendar benchmarks, portability tests, and comparisons with SIMLIB/C++. The results show that the suitability of a calendar structure depends on the workload size and timestamp distribution. The comparison with SIMLIB also shows that runtime performance depends strongly on the selected benchmark: SIMLIB is faster in the resource-contention benchmark, while the implemented simulator performs better in the process-delay benchmark with distributed arrivals. In the tested large-process workloads, the implemented simulator also used less memory than SIMLIB.
Description
Keywords
C++ , diskrétní simulace , simulační knihovna , simulace založená na procesech , korutiny , kalendář událostí , Calendar Queue , SNOOPy , FELT , SIMLIB , C++ , discrete-event simulation , simulation library , process-oriented simulation , coroutines , event calendar , Calendar Queue , SNOOPy , FELT , SIMLIB
Citation
BEŇUŠ, A. Knihovna pro diskrétní simulaci v C++ [online]. Brno: Vysoké učení technické v Brně. Fakulta informačních technologií. 2026.
Document type
Document version
Date of access to the full text
Language of document
en
Study field
Inteligentní zařízení
Comittee
doc. Ing. František Zbořil, CSc. (předseda)
doc. Ing. Vladimír Janoušek, Ph.D. (místopředseda)
Ing. Martin Hrubý, Ph.D. (člen)
Ing. Jaroslav Rozman, Ph.D. (člen)
Dr. Ing. Petr Peringer (člen)
Ing. Tomáš Goldmann, Ph.D. (člen)
Date of acceptance
2026-06-25
Defence
Student nejprve prezentoval výsledky, kterých dosáhl v rámci své práce. Komise se poté seznámila s hodnocením vedoucího a posudkem oponenta práce. Student následně odpověděl na otázky přítomných, např. k obsahu některých slajdů prezentace u SZZ, začlenění korutin do výsledného řešení či formátu zápisu maker. Komise se na základě posudku oponenta, hodnocení vedoucího, přednesené prezentace a odpovědí studenta na položené otázky rozhodla práci hodnotit stupněm D - uspokojivě.
Result of defence
práce byla úspěšně obhájena
