CBD.realtime.threadingGameLoop.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  1. <!DOCTYPE html>
  2. <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
  3. <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
  4. <head>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>CBD.realtime.threadingGameLoop module &mdash; CBD Simulation Development Kit documentation</title>
  8. <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  9. <!-- <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> -->
  10. <link rel="stylesheet" href="_static/style.css" type="text/css" />
  11. <link rel="index" title="Index" href="genindex.html" />
  12. <link rel="search" title="Search" href="search.html" />
  13. <link rel="next" title="CBD.realtime.threadingPython module" href="CBD.realtime.threadingPython.html" />
  14. <link rel="prev" title="CBD.realtime.threadingBackend module" href="CBD.realtime.threadingBackend.html" />
  15. <script async src="https://www.googletagmanager.com/gtag/js?id=UA-167094275-1"></script>
  16. <script src="_static/js/googleanalytics.min.js"></script>
  17. <script src="_static/js/modernizr.min.js"></script>
  18. <!-- Preload the theme fonts -->
  19. <link rel="preload" href="_static/fonts/FreightSans/freight-sans-book.woff2" as="font" type="font/woff2" crossorigin="anonymous">
  20. <link rel="preload" href="_static/fonts/FreightSans/freight-sans-medium.woff2" as="font" type="font/woff2" crossorigin="anonymous">
  21. <link rel="preload" href="_static/fonts/IBMPlexMono/IBMPlexMono-Medium.woff2" as="font" type="font/woff2" crossorigin="anonymous">
  22. <link rel="preload" href="_static/fonts/FreightSans/freight-sans-bold.woff2" as="font" type="font/woff2" crossorigin="anonymous">
  23. <link rel="preload" href="_static/fonts/FreightSans/freight-sans-medium-italic.woff2" as="font" type="font/woff2" crossorigin="anonymous">
  24. <link rel="preload" href="_static/fonts/IBMPlexMono/IBMPlexMono-SemiBold.woff2" as="font" type="font/woff2" crossorigin="anonymous">
  25. <!-- Preload the katex fonts -->
  26. <link rel="preload" href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/fonts/KaTeX_Math-Italic.woff2" as="font" type="font/woff2" crossorigin="anonymous">
  27. <link rel="preload" href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/fonts/KaTeX_Main-Regular.woff2" as="font" type="font/woff2" crossorigin="anonymous">
  28. <link rel="preload" href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/fonts/KaTeX_Main-Bold.woff2" as="font" type="font/woff2" crossorigin="anonymous">
  29. <link rel="preload" href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/fonts/KaTeX_Size1-Regular.woff2" as="font" type="font/woff2" crossorigin="anonymous">
  30. <link rel="preload" href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/fonts/KaTeX_Size4-Regular.woff2" as="font" type="font/woff2" crossorigin="anonymous">
  31. <link rel="preload" href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/fonts/KaTeX_Size2-Regular.woff2" as="font" type="font/woff2" crossorigin="anonymous">
  32. <link rel="preload" href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/fonts/KaTeX_Size3-Regular.woff2" as="font" type="font/woff2" crossorigin="anonymous">
  33. <link rel="preload" href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/fonts/KaTeX_Caligraphic-Regular.woff2" as="font" type="font/woff2" crossorigin="anonymous">
  34. </head>
  35. <div class="container-fluid header-holder tutorials-header" id="header-holder">
  36. <div class="container">
  37. <div class="header-container">
  38. <a class="header-logo" href="https://catalyst-team.com/" aria-label="Catalyst"></a>
  39. <div class="main-menu">
  40. <ul>
  41. <li>
  42. <div class="ecosystem-dropdown">
  43. <a id="dropdownMenuButtonEcosystem" data-toggle="ecosystem-dropdown">
  44. Ecosystem
  45. </a>
  46. <div class="ecosystem-dropdown-menu">
  47. <a class="nav-dropdown-item" href="https://alchemy.host">
  48. <span class=dropdown-title>Alchemy</span>
  49. <p>Experiments logging & visualization</p>
  50. </a>
  51. <a class="nav-dropdown-item" href="https://github.com/catalyst-team/catalyst">
  52. <span class=dropdown-title>Catalyst</span>
  53. <p>Accelerated deep learning R&D</p>
  54. </a>
  55. <a class="nav-dropdown-item" href="https://github.com/catalyst-team/reaction">
  56. <span class=dropdown-title>Reaction</span>
  57. <p>Convenient deep learning models serving</p>
  58. </a>
  59. </div>
  60. </div>
  61. </li>
  62. <li>
  63. <div class="projects-dropdown">
  64. <a id="dropdownMenuButtonProjects" data-toggle="projects-dropdown">
  65. Projects
  66. </a>
  67. <div class="projects-dropdown-menu">
  68. <a class="nav-dropdown-item" href="https://github.com/catalyst-team/codestyle">
  69. <span class=dropdown-title>Codestyle</span>
  70. <p>Joint R&D codestyle</p>
  71. </a>
  72. <a class="nav-dropdown-item" href="https://github.com/catalyst-team/neuro">
  73. <span class=dropdown-title>Catalyst.Neuro</span>
  74. <p>Catalyst.Team and TReNDS collaborative project</p>
  75. </a>
  76. <a class="nav-dropdown-item" href="https://github.com/catalyst-team/classification">
  77. <span class=dropdown-title>Classification</span>
  78. <p>Image classification pipeline with transfer learning</p>
  79. </a>
  80. <a class="nav-dropdown-item" href="https://github.com/catalyst-team/detection">
  81. <span class=dropdown-title>Detection</span>
  82. <p>Object detection pipeline</p>
  83. </a>
  84. <a class="nav-dropdown-item" href="https://github.com/catalyst-team/segmentation">
  85. <span class=dropdown-title>Segmentation</span>
  86. <p>Image semantic segmentation pipeline</p>
  87. </a>
  88. <a class="nav-dropdown-item" href="https://github.com/catalyst-team/gan">
  89. <span class=dropdown-title>Catalyst.GAN</span>
  90. <p>GAN pipelines</p>
  91. </a>
  92. </div>
  93. </div>
  94. </li>
  95. <li>
  96. <a href="https://github.com/catalyst-team/dl-course">Deep learning course</a>
  97. </li>
  98. </ul>
  99. </div>
  100. <a class="main-menu-open-button" href="#" data-behavior="open-mobile-menu"></a>
  101. </div>
  102. </div>
  103. </div>
  104. <body class="catalyst-body">
  105. <div class="table-of-contents-link-wrapper">
  106. <span>Table of Contents</span>
  107. <a href="#" class="toggle-table-of-contents" data-behavior="toggle-table-of-contents"></a>
  108. </div>
  109. <nav data-toggle="wy-nav-shift" class="catalyst-left-menu" id="catalyst-left-menu">
  110. <div class="catalyst-side-scroll">
  111. <div class="catalyst-menu catalyst-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
  112. <div class="catalyst-left-menu-search">
  113. <div role="search">
  114. <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
  115. <input type="text" name="q" placeholder="Search Docs" />
  116. <input type="hidden" name="check_keywords" value="yes" />
  117. <input type="hidden" name="area" value="default" />
  118. </form>
  119. </div>
  120. </div>
  121. <p class="caption"><span class="caption-text">Setup</span></p>
  122. <ul class="current">
  123. <li class="toctree-l1 current"><a class="reference internal" href="install.html">How to install the CBD framework?</a></li>
  124. <li class="toctree-l1"><a class="reference internal" href="running.html">How to run a CBD simulation?</a></li>
  125. <li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a></li>
  126. </ul>
  127. <p class="caption"><span class="caption-text">Simple Examples</span></p>
  128. <ul>
  129. <li class="toctree-l1"><a class="reference internal" href="examples/SinGen.html">Sine Generator</a></li>
  130. <li class="toctree-l1"><a class="reference internal" href="examples/EvenNumberGen.html">Hierarchical Even Number Generator</a></li>
  131. <li class="toctree-l1"><a class="reference internal" href="examples/Fibonacci.html">Fibonacci Sequence Generator</a></li>
  132. <li class="toctree-l1"><a class="reference internal" href="examples/LCG.html">Linear Congruential Generator</a></li>
  133. </ul>
  134. <p class="caption"><span class="caption-text">Advanced Examples</span></p>
  135. <ul>
  136. <li class="toctree-l1"><a class="reference internal" href="examples/RealTime.html">Realtime Simulation</a></li>
  137. <li class="toctree-l1"><a class="reference internal" href="examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
  138. <li class="toctree-l1"><a class="reference internal" href="examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
  139. </ul>
  140. <p class="caption"><span class="caption-text">Internal Documentation</span></p>
  141. <ul>
  142. <li class="toctree-l1"><a class="reference internal" href="CBD.html">CBD package</a></li>
  143. </ul>
  144. </div>
  145. </div>
  146. </nav>
  147. <div class="catalyst-container">
  148. <div class="catalyst-page-level-bar" id="catalyst-page-level-bar">
  149. <div class="catalyst-breadcrumbs-wrapper">
  150. <div role="navigation" aria-label="breadcrumbs navigation">
  151. <ul class="catalyst-breadcrumbs">
  152. <li>
  153. <a href="index.html">
  154. Docs
  155. </a> &gt;
  156. </li>
  157. <li><a href="install.html">How to install the CBD framework?</a> &gt;</li>
  158. <li><a href="CBD.realtime.html">CBD.realtime package</a> &gt;</li>
  159. <li>CBD.realtime.threadingGameLoop module</li>
  160. <li class="catalyst-breadcrumbs-aside">
  161. </li>
  162. </ul>
  163. </div>
  164. </div>
  165. <div class="catalyst-shortcuts-wrapper" id="catalyst-shortcuts-wrapper">
  166. Shortcuts
  167. </div>
  168. </div>
  169. <section data-toggle="wy-nav-shift" id="catalyst-content-wrap" class="catalyst-content-wrap">
  170. <div class="catalyst-content-left">
  171. <div class="rst-content">
  172. <div role="main" class="main-content" itemscope="itemscope" itemtype="http://schema.org/Article">
  173. <article itemprop="articleBody" id="catalyst-article" class="catalyst-article">
  174. <div class="section" id="module-CBD.realtime.threadingGameLoop">
  175. <span id="cbd-realtime-threadinggameloop-module"></span><h1>CBD.realtime.threadingGameLoop module<a class="headerlink" href="#module-CBD.realtime.threadingGameLoop" title="Permalink to this headline">¶</a></h1>
  176. <dl class="class">
  177. <dt id="CBD.realtime.threadingGameLoop.ThreadingGameLoop">
  178. <em class="property">class </em><code class="descclassname">CBD.realtime.threadingGameLoop.</code><code class="descname">ThreadingGameLoop</code><a class="reference internal" href="_modules/CBD/realtime/threadingGameLoop.html#ThreadingGameLoop"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#CBD.realtime.threadingGameLoop.ThreadingGameLoop" title="Permalink to this definition">¶</a></dt>
  179. <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
  180. <p>Game loop subsystem for realtime simulation.
  181. Time will only progress when a <a class="reference internal" href="#CBD.realtime.threadingGameLoop.ThreadingGameLoop.step" title="CBD.realtime.threadingGameLoop.ThreadingGameLoop.step"><code class="xref py py-func docutils literal notranslate"><span class="pre">step()</span></code></a> call is made.</p>
  182. <dl class="method">
  183. <dt id="CBD.realtime.threadingGameLoop.ThreadingGameLoop.step">
  184. <code class="descname">step</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/CBD/realtime/threadingGameLoop.html#ThreadingGameLoop.step"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#CBD.realtime.threadingGameLoop.ThreadingGameLoop.step" title="Permalink to this definition">¶</a></dt>
  185. <dd><p>Perform a step in the simulation. Actual processing is done in a seperate thread.</p>
  186. </dd></dl>
  187. <dl class="method">
  188. <dt id="CBD.realtime.threadingGameLoop.ThreadingGameLoop.wait">
  189. <code class="descname">wait</code><span class="sig-paren">(</span><em>delay</em>, <em>func</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/CBD/realtime/threadingGameLoop.html#ThreadingGameLoop.wait"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#CBD.realtime.threadingGameLoop.ThreadingGameLoop.wait" title="Permalink to this definition">¶</a></dt>
  190. <dd><p>Wait for the specified time, or faster if interrupted</p>
  191. <table class="docutils field-list" frame="void" rules="none">
  192. <col class="field-name" />
  193. <col class="field-body" />
  194. <tbody valign="top">
  195. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
  196. <li><strong>delay</strong> – time to wait</li>
  197. <li><strong>func</strong> – the function to call</li>
  198. </ul>
  199. </td>
  200. </tr>
  201. </tbody>
  202. </table>
  203. </dd></dl>
  204. <dl class="method">
  205. <dt id="CBD.realtime.threadingGameLoop.ThreadingGameLoop.interrupt">
  206. <code class="descname">interrupt</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/CBD/realtime/threadingGameLoop.html#ThreadingGameLoop.interrupt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#CBD.realtime.threadingGameLoop.ThreadingGameLoop.interrupt" title="Permalink to this definition">¶</a></dt>
  207. <dd><p>Interrupt the waiting thread</p>
  208. </dd></dl>
  209. </dd></dl>
  210. </div>
  211. </article>
  212. </div>
  213. <footer>
  214. <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
  215. <a href="CBD.realtime.threadingPython.html" class="btn btn-neutral float-right" title="CBD.realtime.threadingPython module" accesskey="n" rel="next">Next <img src="_static/images/chevron-right-orange.svg" class="next-page"></a>
  216. <a href="CBD.realtime.threadingBackend.html" class="btn btn-neutral" title="CBD.realtime.threadingBackend module" accesskey="p" rel="prev"><img src="_static/images/chevron-right-orange.svg" class="previous-page"> Previous</a>
  217. </div>
  218. <hr>
  219. <div role="contentinfo">
  220. <p>
  221. &copy; Copyright 2020, Randy Paredis.
  222. </p>
  223. </div>
  224. <div>
  225. Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
  226. </div>
  227. </footer>
  228. </div>
  229. </div>
  230. <div class="catalyst-content-right" id="catalyst-content-right">
  231. <div class="catalyst-right-menu" id="catalyst-right-menu">
  232. <div class="catalyst-side-scroll" id="catalyst-side-scroll-right">
  233. <ul>
  234. <li><a class="reference internal" href="#">CBD.realtime.threadingGameLoop module</a></li>
  235. </ul>
  236. </div>
  237. </div>
  238. </div>
  239. </section>
  240. </div>
  241. <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
  242. <script type="text/javascript" src="_static/jquery.js"></script>
  243. <script type="text/javascript" src="_static/underscore.js"></script>
  244. <script type="text/javascript" src="_static/doctools.js"></script>
  245. <script type="text/javascript" src="_static/language_data.js"></script>
  246. <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
  247. <script type="text/javascript" src="_static/js/vendor/popper.min.js"></script>
  248. <script type="text/javascript" src="_static/js/vendor/bootstrap.min.js"></script>
  249. <script type="text/javascript" src="_static/js/theme.js"></script>
  250. <script type="text/javascript">
  251. jQuery(function () {
  252. SphinxRtdTheme.Navigation.enable(true);
  253. });
  254. </script>
  255. <!-- Begin Footer -->
  256. <footer class="site-footer" id="site-footer">
  257. <div class="container footer-container">
  258. <div class="footer-logo-wrapper">
  259. <a href="https://catalyst-team.com/" class="footer-logo"></a>
  260. </div>
  261. <div class="footer-links-wrapper">
  262. <div class="footer-links-col">
  263. <ul>
  264. <li class="list-title"><a href="https://github.com/catalyst-team">Ecosystem</a></li>
  265. <li><a class="nav-dropdown-item" href="https://alchemy.host">Alchemy</a></li>
  266. <li><a class="nav-dropdown-item" href="https://github.com/catalyst-team/catalyst">Catalyst</a></li>
  267. <li><a class="nav-dropdown-item" href="https://github.com/catalyst-team/reaction">Reaction</a></li>
  268. </ul>
  269. </div>
  270. <div class="footer-links-col">
  271. <ul>
  272. <li class="list-title"><a href="https://github.com/catalyst-team">Projects</a></li>
  273. <li><a class="nav-dropdown-item" href="https://github.com/catalyst-team/codestyle">Codestyle</a></li>
  274. <li><a class="nav-dropdown-item" href="https://github.com/catalyst-team/neuro">Catalyst.Neuro</a></li>
  275. <li><a class="nav-dropdown-item" href="https://github.com/catalyst-team/classification">Classification</a></li>
  276. <li><a class="nav-dropdown-item" href="https://github.com/catalyst-team/detection">Detection</a></li>
  277. <li><a class="nav-dropdown-item" href="https://github.com/catalyst-team/segmentation">Segmentation</a></li>
  278. <li><a class="nav-dropdown-item" href="https://github.com/catalyst-team/gan">Catalyst.GAN</a></li>
  279. </ul>
  280. </div>
  281. <div class="footer-links-col">
  282. <ul>
  283. <li class="list-title"><a href="https://catalyst-team.com/">Support</a></li>
  284. <li><a href="https://github.com/catalyst-team/catalyst/issues" target="_blank">Github Issues</a></li>
  285. <li><a href="https://github.com/catalyst-team/catalyst/blob/master/CONTRIBUTING.md" target="_blank">Contributing</a></li>
  286. <li><a href="https://www.patreon.com/catalyst_team" target="_blank">Patreon</a></li>
  287. </ul>
  288. </div>
  289. <div class="footer-links-col follow-us-col">
  290. <div class="footer-social-icons">
  291. <a href="https://t.me/catalyst_team" target="_blank" class="telegram"></a>
  292. <a href="https://twitter.com/catalyst_core" target="_blank" class="twitter"></a>
  293. <a href="https://join.slack.com/t/catalyst-team-core/shared_invite/zt-d9miirnn-z86oKDzFMKlMG4fgFdZafw" target="_blank" class="ods"></a>
  294. </div>
  295. </div>
  296. </div>
  297. </div>
  298. </footer>
  299. <!-- End Footer -->
  300. <!-- Begin Mobile Menu -->
  301. <div class="mobile-main-menu">
  302. <div class="container-fluid">
  303. <div class="container">
  304. <div class="mobile-main-menu-header-container">
  305. <a class="header-logo" href="https://catalyst-team.com/" aria-label="Catalyst"></a>
  306. <a class="main-menu-close-button" href="#" data-behavior="close-mobile-menu"></a>
  307. </div>
  308. </div>
  309. </div>
  310. <div class="mobile-main-menu-links-container">
  311. <div class="main-menu">
  312. <ul>
  313. <li>
  314. <a href="">Get Started</a>
  315. </li>
  316. <li>
  317. <a href="https://github.com/catalyst-team/catalyst">Github</a>
  318. </li>
  319. </ul>
  320. </div>
  321. </div>
  322. </div>
  323. <!-- End Mobile Menu -->
  324. <script type="text/javascript" src="_static/js/vendor/anchor.min.js"></script>
  325. <script type="text/javascript">
  326. $(document).ready(function() {
  327. mobileMenu.bind();
  328. mobileTOC.bind();
  329. catalystAnchors.bind();
  330. sideMenus.bind();
  331. scrollToAnchor.bind();
  332. highlightNavigation.bind();
  333. mainMenuDropdown.bind();
  334. // Add class to links that have code blocks, since we cannot create links in code blocks
  335. $("article.catalyst-article a span.pre").each(function(e) {
  336. $(this).closest("a").addClass("has-code");
  337. });
  338. })
  339. </script>
  340. </body>
  341. </html>