CBD.realtime.threadingGameLoop.html 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475
  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. <ul class="current">
  122. <li class="toctree-l1 current"><a class="reference internal" href="CBD.html">CBD package</a></li>
  123. </ul>
  124. </div>
  125. </div>
  126. </nav>
  127. <div class="catalyst-container">
  128. <div class="catalyst-page-level-bar" id="catalyst-page-level-bar">
  129. <div class="catalyst-breadcrumbs-wrapper">
  130. <div role="navigation" aria-label="breadcrumbs navigation">
  131. <ul class="catalyst-breadcrumbs">
  132. <li>
  133. <a href="index.html">
  134. Docs
  135. </a> &gt;
  136. </li>
  137. <li><a href="CBD.html">CBD package</a> &gt;</li>
  138. <li><a href="CBD.realtime.html">CBD.realtime package</a> &gt;</li>
  139. <li>CBD.realtime.threadingGameLoop module</li>
  140. <li class="catalyst-breadcrumbs-aside">
  141. </li>
  142. </ul>
  143. </div>
  144. </div>
  145. <div class="catalyst-shortcuts-wrapper" id="catalyst-shortcuts-wrapper">
  146. Shortcuts
  147. </div>
  148. </div>
  149. <section data-toggle="wy-nav-shift" id="catalyst-content-wrap" class="catalyst-content-wrap">
  150. <div class="catalyst-content-left">
  151. <div class="rst-content">
  152. <div role="main" class="main-content" itemscope="itemscope" itemtype="http://schema.org/Article">
  153. <article itemprop="articleBody" id="catalyst-article" class="catalyst-article">
  154. <div class="section" id="module-CBD.realtime.threadingGameLoop">
  155. <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>
  156. <dl class="class">
  157. <dt id="CBD.realtime.threadingGameLoop.ThreadingGameLoop">
  158. <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>
  159. <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
  160. <p>Game loop subsystem for realtime simulation.
  161. 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>
  162. <dl class="method">
  163. <dt id="CBD.realtime.threadingGameLoop.ThreadingGameLoop.step">
  164. <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>
  165. <dd><p>Perform a step in the simulation. Actual processing is done in a seperate thread.</p>
  166. </dd></dl>
  167. <dl class="method">
  168. <dt id="CBD.realtime.threadingGameLoop.ThreadingGameLoop.wait">
  169. <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>
  170. <dd><p>Wait for the specified time, or faster if interrupted</p>
  171. <table class="docutils field-list" frame="void" rules="none">
  172. <col class="field-name" />
  173. <col class="field-body" />
  174. <tbody valign="top">
  175. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
  176. <li><strong>delay</strong> – time to wait</li>
  177. <li><strong>func</strong> – the function to call</li>
  178. </ul>
  179. </td>
  180. </tr>
  181. </tbody>
  182. </table>
  183. </dd></dl>
  184. <dl class="method">
  185. <dt id="CBD.realtime.threadingGameLoop.ThreadingGameLoop.interrupt">
  186. <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>
  187. <dd><p>Interrupt the waiting thread</p>
  188. </dd></dl>
  189. </dd></dl>
  190. </div>
  191. </article>
  192. </div>
  193. <footer>
  194. <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
  195. <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>
  196. <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>
  197. </div>
  198. <hr>
  199. <div role="contentinfo">
  200. <p>
  201. &copy; Copyright 2020, Randy Paredis.
  202. </p>
  203. </div>
  204. <div>
  205. 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>.
  206. </div>
  207. </footer>
  208. </div>
  209. </div>
  210. <div class="catalyst-content-right" id="catalyst-content-right">
  211. <div class="catalyst-right-menu" id="catalyst-right-menu">
  212. <div class="catalyst-side-scroll" id="catalyst-side-scroll-right">
  213. <ul>
  214. <li><a class="reference internal" href="#">CBD.realtime.threadingGameLoop module</a></li>
  215. </ul>
  216. </div>
  217. </div>
  218. </div>
  219. </section>
  220. </div>
  221. <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
  222. <script type="text/javascript" src="_static/jquery.js"></script>
  223. <script type="text/javascript" src="_static/underscore.js"></script>
  224. <script type="text/javascript" src="_static/doctools.js"></script>
  225. <script type="text/javascript" src="_static/language_data.js"></script>
  226. <script type="text/javascript" src="_static/js/vendor/popper.min.js"></script>
  227. <script type="text/javascript" src="_static/js/vendor/bootstrap.min.js"></script>
  228. <script type="text/javascript" src="_static/js/theme.js"></script>
  229. <script type="text/javascript">
  230. jQuery(function () {
  231. SphinxRtdTheme.Navigation.enable(true);
  232. });
  233. </script>
  234. <!-- Begin Footer -->
  235. <footer class="site-footer" id="site-footer">
  236. <div class="container footer-container">
  237. <div class="footer-logo-wrapper">
  238. <a href="https://catalyst-team.com/" class="footer-logo"></a>
  239. </div>
  240. <div class="footer-links-wrapper">
  241. <div class="footer-links-col">
  242. <ul>
  243. <li class="list-title"><a href="https://github.com/catalyst-team">Ecosystem</a></li>
  244. <li><a class="nav-dropdown-item" href="https://alchemy.host">Alchemy</a></li>
  245. <li><a class="nav-dropdown-item" href="https://github.com/catalyst-team/catalyst">Catalyst</a></li>
  246. <li><a class="nav-dropdown-item" href="https://github.com/catalyst-team/reaction">Reaction</a></li>
  247. </ul>
  248. </div>
  249. <div class="footer-links-col">
  250. <ul>
  251. <li class="list-title"><a href="https://github.com/catalyst-team">Projects</a></li>
  252. <li><a class="nav-dropdown-item" href="https://github.com/catalyst-team/codestyle">Codestyle</a></li>
  253. <li><a class="nav-dropdown-item" href="https://github.com/catalyst-team/neuro">Catalyst.Neuro</a></li>
  254. <li><a class="nav-dropdown-item" href="https://github.com/catalyst-team/classification">Classification</a></li>
  255. <li><a class="nav-dropdown-item" href="https://github.com/catalyst-team/detection">Detection</a></li>
  256. <li><a class="nav-dropdown-item" href="https://github.com/catalyst-team/segmentation">Segmentation</a></li>
  257. <li><a class="nav-dropdown-item" href="https://github.com/catalyst-team/gan">Catalyst.GAN</a></li>
  258. </ul>
  259. </div>
  260. <div class="footer-links-col">
  261. <ul>
  262. <li class="list-title"><a href="https://catalyst-team.com/">Support</a></li>
  263. <li><a href="https://github.com/catalyst-team/catalyst/issues" target="_blank">Github Issues</a></li>
  264. <li><a href="https://github.com/catalyst-team/catalyst/blob/master/CONTRIBUTING.md" target="_blank">Contributing</a></li>
  265. <li><a href="https://www.patreon.com/catalyst_team" target="_blank">Patreon</a></li>
  266. </ul>
  267. </div>
  268. <div class="footer-links-col follow-us-col">
  269. <div class="footer-social-icons">
  270. <a href="https://t.me/catalyst_team" target="_blank" class="telegram"></a>
  271. <a href="https://twitter.com/catalyst_core" target="_blank" class="twitter"></a>
  272. <a href="https://join.slack.com/t/catalyst-team-core/shared_invite/zt-d9miirnn-z86oKDzFMKlMG4fgFdZafw" target="_blank" class="ods"></a>
  273. </div>
  274. </div>
  275. </div>
  276. </div>
  277. </footer>
  278. <!-- End Footer -->
  279. <!-- Begin Mobile Menu -->
  280. <div class="mobile-main-menu">
  281. <div class="container-fluid">
  282. <div class="container">
  283. <div class="mobile-main-menu-header-container">
  284. <a class="header-logo" href="https://catalyst-team.com/" aria-label="Catalyst"></a>
  285. <a class="main-menu-close-button" href="#" data-behavior="close-mobile-menu"></a>
  286. </div>
  287. </div>
  288. </div>
  289. <div class="mobile-main-menu-links-container">
  290. <div class="main-menu">
  291. <ul>
  292. <li>
  293. <a href="">Get Started</a>
  294. </li>
  295. <li>
  296. <a href="https://github.com/catalyst-team/catalyst">Github</a>
  297. </li>
  298. </ul>
  299. </div>
  300. </div>
  301. </div>
  302. <!-- End Mobile Menu -->
  303. <script type="text/javascript" src="_static/js/vendor/anchor.min.js"></script>
  304. <script type="text/javascript">
  305. $(document).ready(function() {
  306. mobileMenu.bind();
  307. mobileTOC.bind();
  308. catalystAnchors.bind();
  309. sideMenus.bind();
  310. scrollToAnchor.bind();
  311. highlightNavigation.bind();
  312. mainMenuDropdown.bind();
  313. // Add class to links that have code blocks, since we cannot create links in code blocks
  314. $("article.catalyst-article a span.pre").each(function(e) {
  315. $(this).closest("a").addClass("has-code");
  316. });
  317. })
  318. </script>
  319. </body>
  320. </html>