| 1 |
<?xml version="1.0" encoding="utf-8" ?> |
| 2 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 3 |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| 4 |
<head> |
| 5 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| 6 |
<meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" /> |
| 7 |
<title>simpylogo LIST OF MODELS using SimPy</title> |
| 8 |
<meta name="authors" content="Tony Vignaux <Vignaux@users.sourceforge.net>, Klaus Muller <Muller@users.sourceforge.net>" /> |
| 9 |
<style type="text/css"> |
| 10 |
|
| 11 |
/* |
| 12 |
:Author: David Goodger |
| 13 |
:Contact: [email protected] |
| 14 |
:Date: $Date$ |
| 15 |
:Revision: $Revision$ |
| 16 |
:Copyright: This stylesheet has been placed in the public domain. |
| 17 |
|
| 18 |
Default cascading style sheet for the HTML output of Docutils. |
| 19 |
|
| 20 |
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to |
| 21 |
customize this style sheet. |
| 22 |
*/ |
| 23 |
|
| 24 |
/* used to remove borders from tables and images */ |
| 25 |
.borderless, table.borderless td, table.borderless th { |
| 26 |
border: 0 } |
| 27 |
|
| 28 |
table.borderless td, table.borderless th { |
| 29 |
/* Override padding for "table.docutils td" with "! important". |
| 30 |
The right padding separates the table cells. */ |
| 31 |
padding: 0 0.5em 0 0 ! important } |
| 32 |
|
| 33 |
.first { |
| 34 |
/* Override more specific margin styles with "! important". */ |
| 35 |
margin-top: 0 ! important } |
| 36 |
|
| 37 |
.last, .with-subtitle { |
| 38 |
margin-bottom: 0 ! important } |
| 39 |
|
| 40 |
.hidden { |
| 41 |
display: none } |
| 42 |
|
| 43 |
a.toc-backref { |
| 44 |
text-decoration: none ; |
| 45 |
color: black } |
| 46 |
|
| 47 |
blockquote.epigraph { |
| 48 |
margin: 2em 5em ; } |
| 49 |
|
| 50 |
dl.docutils dd { |
| 51 |
margin-bottom: 0.5em } |
| 52 |
|
| 53 |
/* Uncomment (and remove this text!) to get bold-faced definition list terms |
| 54 |
dl.docutils dt { |
| 55 |
font-weight: bold } |
| 56 |
*/ |
| 57 |
|
| 58 |
div.abstract { |
| 59 |
margin: 2em 5em } |
| 60 |
|
| 61 |
div.abstract p.topic-title { |
| 62 |
font-weight: bold ; |
| 63 |
text-align: center } |
| 64 |
|
| 65 |
div.admonition, div.attention, div.caution, div.danger, div.error, |
| 66 |
div.hint, div.important, div.note, div.tip, div.warning { |
| 67 |
margin: 2em ; |
| 68 |
border: medium outset ; |
| 69 |
padding: 1em } |
| 70 |
|
| 71 |
div.admonition p.admonition-title, div.hint p.admonition-title, |
| 72 |
div.important p.admonition-title, div.note p.admonition-title, |
| 73 |
div.tip p.admonition-title { |
| 74 |
font-weight: bold ; |
| 75 |
font-family: sans-serif } |
| 76 |
|
| 77 |
div.attention p.admonition-title, div.caution p.admonition-title, |
| 78 |
div.danger p.admonition-title, div.error p.admonition-title, |
| 79 |
div.warning p.admonition-title { |
| 80 |
color: red ; |
| 81 |
font-weight: bold ; |
| 82 |
font-family: sans-serif } |
| 83 |
|
| 84 |
/* Uncomment (and remove this text!) to get reduced vertical space in |
| 85 |
compound paragraphs. |
| 86 |
div.compound .compound-first, div.compound .compound-middle { |
| 87 |
margin-bottom: 0.5em } |
| 88 |
|
| 89 |
div.compound .compound-last, div.compound .compound-middle { |
| 90 |
margin-top: 0.5em } |
| 91 |
*/ |
| 92 |
|
| 93 |
div.dedication { |
| 94 |
margin: 2em 5em ; |
| 95 |
text-align: center ; |
| 96 |
font-style: italic } |
| 97 |
|
| 98 |
div.dedication p.topic-title { |
| 99 |
font-weight: bold ; |
| 100 |
font-style: normal } |
| 101 |
|
| 102 |
div.figure { |
| 103 |
margin-left: 2em ; |
| 104 |
margin-right: 2em } |
| 105 |
|
| 106 |
div.footer, div.header { |
| 107 |
clear: both; |
| 108 |
font-size: smaller } |
| 109 |
|
| 110 |
div.line-block { |
| 111 |
display: block ; |
| 112 |
margin-top: 1em ; |
| 113 |
margin-bottom: 1em } |
| 114 |
|
| 115 |
div.line-block div.line-block { |
| 116 |
margin-top: 0 ; |
| 117 |
margin-bottom: 0 ; |
| 118 |
margin-left: 1.5em } |
| 119 |
|
| 120 |
div.sidebar { |
| 121 |
margin-left: 1em ; |
| 122 |
border: medium outset ; |
| 123 |
padding: 1em ; |
| 124 |
background-color: #ffffee ; |
| 125 |
width: 40% ; |
| 126 |
float: right ; |
| 127 |
clear: right } |
| 128 |
|
| 129 |
div.sidebar p.rubric { |
| 130 |
font-family: sans-serif ; |
| 131 |
font-size: medium } |
| 132 |
|
| 133 |
div.system-messages { |
| 134 |
margin: 5em } |
| 135 |
|
| 136 |
div.system-messages h1 { |
| 137 |
color: red } |
| 138 |
|
| 139 |
div.system-message { |
| 140 |
border: medium outset ; |
| 141 |
padding: 1em } |
| 142 |
|
| 143 |
div.system-message p.system-message-title { |
| 144 |
color: red ; |
| 145 |
font-weight: bold } |
| 146 |
|
| 147 |
div.topic { |
| 148 |
margin: 2em } |
| 149 |
|
| 150 |
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle, |
| 151 |
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle { |
| 152 |
margin-top: 0.4em } |
| 153 |
|
| 154 |
h1.title { |
| 155 |
text-align: center } |
| 156 |
|
| 157 |
h2.subtitle { |
| 158 |
text-align: center } |
| 159 |
|
| 160 |
hr.docutils { |
| 161 |
width: 75% } |
| 162 |
|
| 163 |
img.align-left { |
| 164 |
clear: left } |
| 165 |
|
| 166 |
img.align-right { |
| 167 |
clear: right } |
| 168 |
|
| 169 |
ol.simple, ul.simple { |
| 170 |
margin-bottom: 1em } |
| 171 |
|
| 172 |
ol.arabic { |
| 173 |
list-style: decimal } |
| 174 |
|
| 175 |
ol.loweralpha { |
| 176 |
list-style: lower-alpha } |
| 177 |
|
| 178 |
ol.upperalpha { |
| 179 |
list-style: upper-alpha } |
| 180 |
|
| 181 |
ol.lowerroman { |
| 182 |
list-style: lower-roman } |
| 183 |
|
| 184 |
ol.upperroman { |
| 185 |
list-style: upper-roman } |
| 186 |
|
| 187 |
p.attribution { |
| 188 |
text-align: right ; |
| 189 |
margin-left: 50% } |
| 190 |
|
| 191 |
p.caption { |
| 192 |
font-style: italic } |
| 193 |
|
| 194 |
p.credits { |
| 195 |
font-style: italic ; |
| 196 |
font-size: smaller } |
| 197 |
|
| 198 |
p.label { |
| 199 |
white-space: nowrap } |
| 200 |
|
| 201 |
p.rubric { |
| 202 |
font-weight: bold ; |
| 203 |
font-size: larger ; |
| 204 |
color: maroon ; |
| 205 |
text-align: center } |
| 206 |
|
| 207 |
p.sidebar-title { |
| 208 |
font-family: sans-serif ; |
| 209 |
font-weight: bold ; |
| 210 |
font-size: larger } |
| 211 |
|
| 212 |
p.sidebar-subtitle { |
| 213 |
font-family: sans-serif ; |
| 214 |
font-weight: bold } |
| 215 |
|
| 216 |
p.topic-title { |
| 217 |
font-weight: bold } |
| 218 |
|
| 219 |
pre.address { |
| 220 |
margin-bottom: 0 ; |
| 221 |
margin-top: 0 ; |
| 222 |
font-family: serif ; |
| 223 |
font-size: 100% } |
| 224 |
|
| 225 |
pre.literal-block, pre.doctest-block { |
| 226 |
margin-left: 2em ; |
| 227 |
margin-right: 2em ; |
| 228 |
background-color: #eeeeee } |
| 229 |
|
| 230 |
span.classifier { |
| 231 |
font-family: sans-serif ; |
| 232 |
font-style: oblique } |
| 233 |
|
| 234 |
span.classifier-delimiter { |
| 235 |
font-family: sans-serif ; |
| 236 |
font-weight: bold } |
| 237 |
|
| 238 |
span.interpreted { |
| 239 |
font-family: sans-serif } |
| 240 |
|
| 241 |
span.option { |
| 242 |
white-space: nowrap } |
| 243 |
|
| 244 |
span.pre { |
| 245 |
white-space: pre } |
| 246 |
|
| 247 |
span.problematic { |
| 248 |
color: red } |
| 249 |
|
| 250 |
span.section-subtitle { |
| 251 |
/* font-size relative to parent (h1..h6 element) */ |
| 252 |
font-size: 80% } |
| 253 |
|
| 254 |
table.citation { |
| 255 |
border-left: solid 1px gray; |
| 256 |
margin-left: 1px } |
| 257 |
|
| 258 |
table.docinfo { |
| 259 |
margin: 2em 4em } |
| 260 |
|
| 261 |
table.docutils { |
| 262 |
margin-top: 0.5em ; |
| 263 |
margin-bottom: 0.5em } |
| 264 |
|
| 265 |
table.footnote { |
| 266 |
border-left: solid 1px black; |
| 267 |
margin-left: 1px } |
| 268 |
|
| 269 |
table.docutils td, table.docutils th, |
| 270 |
table.docinfo td, table.docinfo th { |
| 271 |
padding-left: 0.5em ; |
| 272 |
padding-right: 0.5em ; |
| 273 |
vertical-align: top } |
| 274 |
|
| 275 |
table.docutils th.field-name, table.docinfo th.docinfo-name { |
| 276 |
font-weight: bold ; |
| 277 |
text-align: left ; |
| 278 |
white-space: nowrap ; |
| 279 |
padding-left: 0 } |
| 280 |
|
| 281 |
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils, |
| 282 |
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils { |
| 283 |
font-size: 100% } |
| 284 |
|
| 285 |
tt.docutils { |
| 286 |
background-color: #eeeeee } |
| 287 |
|
| 288 |
ul.auto-toc { |
| 289 |
list-style-type: none } |
| 290 |
|
| 291 |
</style> |
| 292 |
</head> |
| 293 |
<body> |
| 294 |
<div class="document" id="simpylogo-list-of-models-using-simpy"> |
| 295 |
<h1 class="title"><img alt="simpylogo" src="../SimPyDocs/_images/sm_SimPy_Logo.png" /> LIST OF MODELS using SimPy</h1> |
| 296 |
<table class="docinfo" frame="void" rules="none"> |
| 297 |
<col class="docinfo-name" /> |
| 298 |
<col class="docinfo-content" /> |
| 299 |
<tbody valign="top"> |
| 300 |
<tr><th class="docinfo-name">Authors:</th> |
| 301 |
<td>Tony Vignaux <<a class="reference" href="mailto:Vignaux@users.sourceforge.net">Vignaux@users.sourceforge.net</a>>, |
| 302 |
<br />Klaus Muller <<a class="reference" href="mailto:Muller@users.sourceforge.net">Muller@users.sourceforge.net</a>></td></tr> |
| 303 |
<tr class="field"><th class="docinfo-name">SimPy version:</th><td class="field-body">2.0</td> |
| 304 |
</tr> |
| 305 |
<tr class="field"><th class="docinfo-name">Web-site:</th><td class="field-body"><a class="reference" href="http://simpy.sourceforge.net/">http://simpy.sourceforge.net/</a></td> |
| 306 |
</tr> |
| 307 |
<tr class="field"><th class="docinfo-name">Python-Version:</th><td class="field-body">2.3 or later (not 3.0)</td> |
| 308 |
</tr> |
| 309 |
</tbody> |
| 310 |
</table> |
| 311 |
<p>These models are examples of SimPy use written by several authors and |
| 312 |
usually developed for other purposes, such as teaching and |
| 313 |
consulting. They are in a variety of styles. Some have been converted |
| 314 |
to the new script structure accepted by the SimPy users. These are |
| 315 |
listed first.</p> |
| 316 |
<p>Most models are given in two versions, one with the procedural SimPy API |
| 317 |
and the other (identified by an "_OO" appended to the program name) with |
| 318 |
the Object Oriented API introduced in SimPy 2.0.</p> |
| 319 |
<div class="section"> |
| 320 |
<h1><a id="command-line-input-and-output" name="command-line-input-and-output">Command Line input and output</a></h1> |
| 321 |
<div class="section"> |
| 322 |
<h2><a id="new-program-structure" name="new-program-structure">new program structure</a></h2> |
| 323 |
<dl class="docutils"> |
| 324 |
<dt>MMC.py, MMC_OO.py</dt> |
| 325 |
<dd>M/M/c (multiple server queue model. This demonstrates both the |
| 326 |
multiple capacity Resource class and the observe method of the |
| 327 |
Monitor class. Random arrivals, exponential |
| 328 |
service-times. (TV)</dd> |
| 329 |
<dt>bcc.py, bcc_OO.py</dt> |
| 330 |
<dd>Determine the probability of rejection of random arrivals to a |
| 331 |
2-server system with different service-time distributions. No |
| 332 |
queues allowed, blocked customers are rejected |
| 333 |
(BCC). Distributions are Erlang, exponential, and |
| 334 |
hyperexponential. The theoretical probability is also |
| 335 |
calculated. (TV)</dd> |
| 336 |
<dt>callCenter.py, callCenter_OO.py</dt> |
| 337 |
<dd>A call center with agents with different skills. The model |
| 338 |
returns the frequency distribution of client waiting times, |
| 339 |
the percentage of reneging clients, and the load on the |
| 340 |
agents. This model demonstrates the use of yield get with a |
| 341 |
filter function. (KGM)</dd> |
| 342 |
<dt>cellphone.py, cellphone_OO.py</dt> |
| 343 |
<dd>A cellphone cell with blocking (that is BCC discipline). The |
| 344 |
program simulates the operation for 10 observation periods and |
| 345 |
measures the mean and variance of the total time blockedr and |
| 346 |
the number of times blocking occur in each hour. An |
| 347 |
observational gap occurs between the observation periods to |
| 348 |
make each one's measurement independent. (TV)</dd> |
| 349 |
<dt>centralserver.py, centralserver_OO.py</dt> |
| 350 |
<dd>A primitive central-server model with a single CPU and a |
| 351 |
single disk. A fixed number of users send "tasks" to the |
| 352 |
system which are processed and sent back to the user who then |
| 353 |
thinks for a time before sending a task back. Service times |
| 354 |
are exponential. This system can be solved analytically. |
| 355 |
Trace statements have been removed. (TV)</dd> |
| 356 |
<dt>jacksonnetwork.py, jacksonnetwork_OO.py</dt> |
| 357 |
<dd>A Jackson network with 3 nodes, exponential service times and |
| 358 |
probability switching. The simulation measures the delay for |
| 359 |
jobs moving through the system. (TV)</dd> |
| 360 |
</dl> |
| 361 |
</div> |
| 362 |
<div class="section"> |
| 363 |
<h2><a id="miscellaneous-models" name="miscellaneous-models">Miscellaneous Models</a></h2> |
| 364 |
<dl class="docutils"> |
| 365 |
<dt>bank08renege.py, bank08renege_OO.py (partial conversion)</dt> |
| 366 |
<dd>Use of reneging (compound <tt class="docutils literal"><span class="pre">yield</span> <span class="pre">request</span></tt>) based on <tt class="docutils literal"><span class="pre">bank08.py</span></tt> |
| 367 |
of the tutorial TheBank. Customers leave if they lose patience |
| 368 |
with waiting.</dd> |
| 369 |
<dt>Carwash.py, Carwash_OO.py</dt> |
| 370 |
<dd>Using a Store object for implementing master/slave cooperation |
| 371 |
between processes. Scenario is a carwash installation with |
| 372 |
multiple machines. Two model implementations are shown, one |
| 373 |
with the carwash as master in the cooperation, and the other |
| 374 |
with the car as master.</dd> |
| 375 |
<dt>CellularAutomata.py</dt> |
| 376 |
<dd>A two-dimensional cellular automaton. Does the game of |
| 377 |
Life. (KGM)</dd> |
| 378 |
<dt>demoSimPyEvents.py</dt> |
| 379 |
<dd>Demo of the event signalling constructs introduced in SimPy |
| 380 |
1.5. Three small simulations are included: Pavlov's drooling |
| 381 |
dogs, an activity simulation where a job is completed after a |
| 382 |
number of parallel activities, and the simulation of a |
| 383 |
US-style 4-way stop intersection.</dd> |
| 384 |
<dt>shortestPath_SimPy.py, shortestPath_SimPy_OO.py</dt> |
| 385 |
<dd>A fun example of using SimPy for non-queuing work. It |
| 386 |
simulates a searcher through a graph, seeking the shortest |
| 387 |
path. (KGM)</dd> |
| 388 |
<dt>Machineshop.py, Machineshop_OO.py</dt> |
| 389 |
<dd>An example of the use of the <tt class="docutils literal"><span class="pre">interrupt()</span></tt> method. It |
| 390 |
simulates a workshop with <tt class="docutils literal"><span class="pre">n</span></tt> machines which break down and one |
| 391 |
or more repairmen which have to repair them. (KGM)</dd> |
| 392 |
<dt>Market.py, Market_OO.py</dt> |
| 393 |
<dd>A supermarket checkout with multiple counters and extended |
| 394 |
Monitor objects. Written and analysed by David Mertz in an |
| 395 |
article for developerWorks (). (MM)</dd> |
| 396 |
</dl> |
| 397 |
<p>Movie_renege.py, Movie_renege_OO.py</p> |
| 398 |
<blockquote> |
| 399 |
Use of reneging (compound <tt class="docutils literal"><span class="pre">yield</span> <span class="pre">request</span></tt>) constructs for |
| 400 |
reneging at occurrence of an event. Scenario is a movie ticket |
| 401 |
counter with a limited number of tickets for three movies.</blockquote> |
| 402 |
<dl class="docutils"> |
| 403 |
<dt>needResources.py, needResources_OO.py</dt> |
| 404 |
<dd>Demo of <tt class="docutils literal"><span class="pre">waitUntil</span></tt> capability introduced in SimPy 1.5. It |
| 405 |
simulates three workers each requiring a set of tools to do |
| 406 |
their jobs. Tools are shared, scarce resources for which they |
| 407 |
compete.</dd> |
| 408 |
<dt>SimPy_worker_extend.py, SimPy_worker_extend_OO.py</dt> |
| 409 |
<dd>Factory making widgets with queues for machines. (MM)</dd> |
| 410 |
<dt>WidgetPacking.py, WidgetPacking_OO.py</dt> |
| 411 |
<dd>Using buffers for producer/consumer scenarios. Scenario is a |
| 412 |
group of widget producing machines and a widget packer, |
| 413 |
synchronized via a buffer. Two models are shown: the first |
| 414 |
uses a Level for buffering non-distinguishable items |
| 415 |
(widgets), and the second a Store for distinguishable items |
| 416 |
(widgets of different weight).</dd> |
| 417 |
</dl> |
| 418 |
</div> |
| 419 |
</div> |
| 420 |
<div class="section"> |
| 421 |
<h1><a id="gui-input" name="gui-input">GUI Input</a></h1> |
| 422 |
<dl class="docutils"> |
| 423 |
<dt>GUIdemo.py, GUIdemo_OO.py</dt> |
| 424 |
<dd>A firework show.</dd> |
| 425 |
<dt>bank11GUI.py, bank11GUI_OO.py</dt> |
| 426 |
<dd>A modification of the bank11 simulation with GUI input.</dd> |
| 427 |
<dt>SimGUIStep.py</dt> |
| 428 |
<dd>A modification of the bank11 simulation with the ability to |
| 429 |
step between events</dd> |
| 430 |
</dl> |
| 431 |
</div> |
| 432 |
<div class="section"> |
| 433 |
<h1><a id="plot" name="plot">Plot</a></h1> |
| 434 |
<dl class="docutils"> |
| 435 |
<dt>bakery.py, bakery_OO.py</dt> |
| 436 |
<dd>A bakery with three ovens to answer the following questions: |
| 437 |
a) What is the mean waiting time for retail and restaurant |
| 438 |
buyers? b) What is their maximum waiting time? c) What |
| 439 |
percentage of customer has to wait longer than 15 minutes? |
| 440 |
This graphs the number of baguettes over time using |
| 441 |
SimPy.SimPlot. (KGM)</dd> |
| 442 |
<dt>bank11Plot.py</dt> |
| 443 |
<dd>A Modification of the bank11 simulation with graphical |
| 444 |
output. It plots service and waiting times</dd> |
| 445 |
</dl> |
| 446 |
<table class="docutils field-list" frame="void" rules="none"> |
| 447 |
<col class="field-name" /> |
| 448 |
<col class="field-body" /> |
| 449 |
<tbody valign="top"> |
| 450 |
<tr class="field"><th class="field-name">Created:</th><td class="field-body">2002-December</td> |
| 451 |
</tr> |
| 452 |
<tr class="field"><th class="field-name">Date:</th><td class="field-body">$Date$</td> |
| 453 |
</tr> |
| 454 |
<tr class="field"><th class="field-name">Revision:</th><td class="field-body">$Revision$</td> |
| 455 |
</tr> |
| 456 |
</tbody> |
| 457 |
</table> |
| 458 |
|
| 459 |
|
| 460 |
|
| 461 |
|
| 462 |
|
| 463 |
|
| 464 |
</div> |
| 465 |
</div> |
| 466 |
</body> |
| 467 |
</html> |