{"id":38,"date":"2011-10-23T00:57:47","date_gmt":"2011-10-23T00:57:47","guid":{"rendered":"http:\/\/minkhollow.ca\/books\/?page_id=38"},"modified":"2014-07-21T17:36:22","modified_gmt":"2014-07-21T17:36:22","slug":"9-2","status":"publish","type":"page","link":"http:\/\/minkhollow.ca\/books\/?page_id=38","title":{"rendered":"9: Verification &#038; Validation"},"content":{"rendered":"<h1 id=\"\u00a0Chapter_9\" >\u00a0Chapter 9<\/h1>\n<p>Here&#8217;s were we will put color versions of the images, updates, and other extras.<\/p>\n<p>How do you ensure that the simulation you design simulates your model faithfully? In order to have confidence that the key elements of the simulation are faithful implementations of the original system it is necessary to verify both the model and the resultant simulation. This chapter will explain the process and examine several example approaches.<\/p>\n<p><a href=\"http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/wordl-ch-09-mar-17.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-498\" src=\"http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/wordl-ch-09-mar-17-300x133.png\" alt=\"wordl-ch-09-mar-17\" width=\"458\" height=\"203\" srcset=\"http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/wordl-ch-09-mar-17-300x133.png 300w, http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/wordl-ch-09-mar-17-768x342.png 768w, http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/wordl-ch-09-mar-17.png 805w\" sizes=\"auto, (max-width: 458px) 100vw, 458px\" \/><\/a><\/p>\n<ol>\n<li>\n<div>What is Verification &amp; Validation in a Simulation or a Game?<\/div>\n<\/li>\n<li>\n<div>How Do We Know There\u2019s A Problem?<\/div>\n<ol>\n<li>\n<div>Collecting Confirming Data<\/div>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<div>Verification<\/div>\n<ol>\n<li>\n<div>Code Verification<\/div>\n<\/li>\n<li>\n<div>Solution Verification<\/div>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<div>Validation<\/div>\n<ol>\n<li>\n<div>Conceptual Model Validation<\/div>\n<\/li>\n<li>\n<div>Face Validity<\/div>\n<\/li>\n<li>\n<div>Internal Validity<\/div>\n<\/li>\n<li>\n<div>Event Validity<\/div>\n<\/li>\n<li>\n<div>Sensitivity Analysis<\/div>\n<\/li>\n<li>\n<div>Historical validation<\/div>\n<\/li>\n<li>\n<div>Predictive Validation<\/div>\n<\/li>\n<li>\n<div>Extreme Condition\/Degenerate Tests<\/div>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<div>Validation and Verification of Games<\/div>\n<ol>\n<li>\n<div>Play Testing<\/div>\n<\/li>\n<li>\n<div>Effectiveness<\/div>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<div>Summary<\/div>\n<ol>\n<li>\n<div>Concepts<\/div>\n<\/li>\n<li>\n<div>Terminology<\/div>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<div>References, Notes &amp; Further Resources<\/div>\n<\/li>\n<\/ol>\n<h2 id=\"Images\" >Images<\/h2>\n<p>*Please note: all images are copyrighted, permission to use an image must be obtained from <a title=\"Wiley Copyright\" href=\"http:\/\/ca.wiley.com\/WileyCDA\/Section\/id-302345.html\" target=\"_blank\">Wiley<\/a> (and possibly also the original sources).<\/p>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_289\" aria-describedby=\"caption-attachment-289\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/ch09f001.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-289\" title=\"Figure 9.1: - Position of the weight plotted as a function of time, as generated by the first version of the Simple Harmonic Motion simulation.\" src=\"http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/ch09f001-300x227.gif\" alt=\"\" width=\"300\" height=\"227\" \/><\/a><figcaption id=\"caption-attachment-289\" class=\"wp-caption-text\">Figure 9.1: &#8211; Position of the weight plotted as a function of time, as generated by the first version of the Simple Harmonic Motion simulation.<\/figcaption><\/figure>\n<figure id=\"attachment_290\" aria-describedby=\"caption-attachment-290\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/ch09f002.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-290\" title=\"Figure 9-2:  How a debugger looks while running. The computer program is in source code form and is executed statement-by-statement. The yellow arrow indicates the current statement, while red dots marke statements where execution will pause so that the programmer can examine variables.\" src=\"http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/ch09f002-300x236.gif\" alt=\"\" width=\"300\" height=\"236\" srcset=\"http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/ch09f002-300x236.gif 300w, http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/ch09f002-768x604.gif 768w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-290\" class=\"wp-caption-text\">Figure 9-2: How a debugger looks while running. The computer program is in source code form and is executed statement-by-statement. The yellow arrow indicates the current statement, while red dots marke statements where execution will pause so that the programmer can examine variables.<\/figcaption><\/figure>\n<p><span style=\"font-size: x-large;\"> Single Server queuing model &#8211; SIMULA code, exponential arrivals\/departures <\/span><\/p>\n<p>comment<br \/>\nSingle server queueing model &#8211; exponential distribution.<\/p>\n<p>This is one half of the UNIX arrival process model. This is<br \/>\nthe &#8216;control&#8217; &#8211; the usual assumption on the arrival process is that<br \/>\ninterarrival times are exponentially distributed. This model<br \/>\nruns for two simulated weeks, and collects queue stats and metrics<br \/>\nto compare with the next model, using UNIX interarrival times;<\/p>\n<p>simulation begin<\/p>\n<p>ref (head) q;\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0comment The system queue;<br \/>\nreal u1,u2;<br \/>\nreal lastidle, idtime, arrtsum, rtime, qtime, sizeint, ls;<br \/>\nreal mitime, mstime, q1samp, q0samp, sersum, q2samp,t1,t2;<br \/>\ninteger nidle, narr, nsers, nsamps, V1, V2;<br \/>\ninteger\u00a0 sizeofq, nrsamps, nzsamps, ns;<br \/>\nreal a, b, c, d, e, f,x1,x2;<\/p>\n<p>link class arrentry;<br \/>\nbegin<br \/>\nreal arrtime;<br \/>\nend;<\/p>\n<p>process class arrprocess;<br \/>\nbegin<br \/>\nref(arrentry) b;<br \/>\nreal a;<\/p>\n<p>while true do<br \/>\nbegin<br \/>\nb :- new arrentry;\u00a0\u00a0 \u00a0comment\u00a0 Create a new queue entry;<br \/>\nb.arrtime := time;\u00a0\u00a0 \u00a0comment\u00a0 save the arrival time;<br \/>\nb.into(q);\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0comment\u00a0 Put this entry into the queue;<br \/>\nsizeint := sizeint + sizeofq*(time-ls); ns := ns+1;<br \/>\nls := time;<br \/>\nsizeofq := sizeofq + 1;<br \/>\nif server.idle then<br \/>\nbegin<br \/>\nnidle := nidle + 1;<br \/>\nidtime := idtime + (time-lastidle);<br \/>\nactivate server after current;<br \/>\nend;<br \/>\na := arrtime;<br \/>\narrtsum := arrtsum + a;<br \/>\nnarr := narr + 1;<\/p>\n<p>hold ( arrtime );<br \/>\nend;<br \/>\nend;<\/p>\n<p>process class serve;<br \/>\nbegin<br \/>\nref(arrentry) x;<br \/>\nreal a, b, c;<\/p>\n<p>while true do<br \/>\nbegin<br \/>\nif q.empty then begin<br \/>\nlastidle := time;<br \/>\npassivate;<br \/>\nend;<\/p>\n<p>x :- q.first;<br \/>\nq.first.out;<br \/>\na := sertime;<br \/>\nnsers := nsers + 1;<br \/>\nsersum := sersum + a;<br \/>\nhold(a);<br \/>\nsizeint := sizeint + sizeofq*(time-ls);<br \/>\nls := time; \u00a0\u00a0 \u00a0ns := ns + 1;<br \/>\nsizeofq := sizeofq &#8211; 1;<br \/>\nrtime := rtime + (time-x.arrtime);<br \/>\nnrsamps := nrsamps + 1;<br \/>\nqtime := qtime + (time-x.arrtime-a);<br \/>\nend;<br \/>\nend;<\/p>\n<p>process class demon;<br \/>\nbegin<br \/>\ninteger i;<\/p>\n<p>while true do<br \/>\nbegin<br \/>\nhold (60);\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0comment Sample every 1 Min;<br \/>\nnsamps := nsamps + 1;<br \/>\ni := sizeofq;<br \/>\nq0samp := q0samp + i;<br \/>\nif (i &gt; 2) then<br \/>\nbegin\u00a0\u00a0 \u00a0q1samp := q1samp + (i-1);<br \/>\nnzsamps := nzsamps + 1;<br \/>\nend;<\/p>\n<p>if i&gt;1 then i := i-1<br \/>\nelse i := 0;<br \/>\nq2samp := q2samp + i;<br \/>\nend;<br \/>\nend;<\/p>\n<p>real procedure sertime;<br \/>\nbegin<br \/>\nsertime :=\u00a0 negexp (1.0\/mstime, V2);<br \/>\nend;<\/p>\n<p>real procedure arrtime;<br \/>\nbegin<br \/>\nreal x1,x2;<\/p>\n<p>if (time &gt; t2) then<br \/>\nbegin\u00a0\u00a0 \u00a0t1 := t1 + 900;\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0comment Add 15 minutes;<br \/>\nt2 := t2 + 900;<br \/>\nx1 := inreal;\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0comment The time period;<br \/>\nx1 := inreal;\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0comment The mean;<br \/>\nx2 := inreal;\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0comment The standard deviation;<br \/>\nx2 := x2 * x2;\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0comment Variance;<br \/>\ncomment\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0outtext (&#8221;\u00a0 Mean is &#8220;) outreal (x1,4,12)<br \/>\nouttext (&#8221; SD is &#8220;) outreal(x2,4,12)<br \/>\noutimage;<\/p>\n<p>getmeans(x1,x2);<br \/>\ncomment\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0outtext (&#8220;U1 is &#8220;) outreal (1.0\/u1,4,12)<br \/>\nouttext (&#8220;U2 is &#8220;) outreal (1.0\/u2,4,12)<br \/>\noutimage;<br \/>\nend;<br \/>\nx1 := hypoexp (u1, u2, V1);\u00a0\u00a0 \u00a0comment Assume hypoexponential;<br \/>\narrtime := x1;<br \/>\nend;<\/p>\n<p>real procedure hypoexp (u1,u2, V2);<br \/>\nname V2;<br \/>\nreal u1,u2;\u00a0\u00a0 \u00a0integer V2;<br \/>\nbegin<br \/>\nhypoexp := negexp (u1, V2) + negexp (u2, V2);<br \/>\nend;<\/p>\n<p>procedure getmeans (x1,x2);<br \/>\nreal x1,x2;<br \/>\nbegin<br \/>\nreal a,b,c,d,e,f;<\/p>\n<p>a := 2.0*x2 &#8211; x1*x1;<br \/>\nif (a &lt; 0.0) then<br \/>\nbegin\u00a0\u00a0 \u00a0outtext (&#8220;** Complex solution for mean\/sd. &#8220;);<br \/>\noutreal (time, 4, 12);\u00a0 outreal(x1,4,12); outreal(x2,4,12);<br \/>\noutreal (a,4,12); outimage;<br \/>\nu1 := 2.0\/(x1);\u00a0\u00a0 \u00a0u2 := u1;<br \/>\nend else begin<br \/>\na := sqrt (a);<\/p>\n<p>b := (x1 + a)\/2.0;<br \/>\nc := (x1 &#8211; a)\/2.0;<br \/>\nif (b&lt;0.0) and (c&lt;0.0) then<br \/>\nbegin\u00a0\u00a0 \u00a0outtext (&#8220;** Negative means &#8220;);<br \/>\noutreal (time, 4, 12);\u00a0 outreal(x1,4,12); outreal(x2,4,12);<br \/>\noutreal (a,4,12); outimage;<br \/>\nend<br \/>\nelse if (b*c &gt; 0) then<br \/>\nu2 := (if b&lt;c then b else c)<br \/>\nelse if (b&lt;0.0) then u2 := c<br \/>\nelse u2 := b;<br \/>\nu1 := x1 &#8211; u2;<br \/>\nu1 := 1.0\/u1;\u00a0\u00a0 \u00a0u2 := 1.0\/u2;<br \/>\nend;<br \/>\nend;<\/p>\n<p>ref(serve) server;<br \/>\nref(arrprocess) arrp;<br \/>\nref(demon) sprocess;<\/p>\n<p>q :- new head;<br \/>\nserver :- new serve;<br \/>\narrp\u00a0\u00a0 :- new arrprocess;<br \/>\nsprocess :- new demon;<br \/>\nactivate sprocess after current;<br \/>\nactivate arrp after current;<br \/>\nactivate server after current;<br \/>\nmstime := 8.0;<br \/>\nmitime := 27.3;<br \/>\nV1 := 109827;\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0V2 := 87611;<\/p>\n<p>sizeofq := 0;\u00a0\u00a0 \u00a0rtime := 0.0;\u00a0\u00a0 \u00a0qtime := 0.0;\u00a0\u00a0 \u00a0nrsamps := 0;<br \/>\na := 3600 * 24 * 7;\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0comment 1 week;<br \/>\nlastidle := 0.0;\u00a0\u00a0 \u00a0sersum := 0.0;\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0arrtsum := 0.0;<br \/>\nq0samp := 0.0;\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0q1samp := 0.0;\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0sersum := 0.0;<br \/>\nnidle := 0;\u00a0\u00a0 \u00a0narr := 0;\u00a0\u00a0 \u00a0nsers := 0;\u00a0\u00a0 \u00a0nsamps := 0;<br \/>\nq2samp := 0.0;\u00a0\u00a0 \u00a0nzsamps := 0;<br \/>\nls := 0.0;\u00a0\u00a0 \u00a0sizeint := 0.0;\u00a0\u00a0 \u00a0ns := 0;<br \/>\nt1 := 0.0;\u00a0\u00a0 \u00a0t2 := 900.0;<br \/>\nx1 := inreal;\u00a0\u00a0 \u00a0x1 := inreal;\u00a0\u00a0 \u00a0x2 := inreal; x2 := x2*x2;<br \/>\ncomment\u00a0\u00a0 \u00a0outtext (&#8221;\u00a0 Mean is &#8220;) outreal (x1,4,12)<br \/>\nouttext (&#8221; SD is &#8220;) outreal(x2,4,12)<br \/>\noutimage;<br \/>\ngetmeans (x1,x2);<br \/>\ncomment\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0outtext (&#8220;U1 is &#8220;) outreal (1.0\/u1,4,12)<br \/>\nouttext (&#8220;U2 is &#8220;) outreal (1.0\/u2,4,12)<br \/>\noutimage;<\/p>\n<p>hold(a);\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0comment 1 day;<\/p>\n<p>outtext (&#8220;Single Server Queueing System &#8211; Exponential arrival\/service times.&#8221;);<br \/>\noutimage;<\/p>\n<p>outtext (&#8220;Specified interarrival time was: &#8220;);<br \/>\noutreal (mitime, 4, 12);<br \/>\nouttext (&#8221;\u00a0\u00a0 Measured interarrival time was &#8220;);<br \/>\noutreal (arrtsum\/narr, 4, 12);<br \/>\noutimage;<br \/>\nmitime := arrtsum\/narr;<\/p>\n<p>outtext (&#8220;Specified service time was &#8220;);<br \/>\noutreal (mstime, 4, 12);<br \/>\nouttext (&#8221;\u00a0\u00a0\u00a0\u00a0 Measured service time was &#8220;);<br \/>\noutreal (sersum\/nsers, 4, 12);<br \/>\noutimage;<\/p>\n<p>outtext (&#8220;Total idle time was &#8220;); outreal (idtime,4,12);<br \/>\nouttext (&#8221; in &#8220;); outint(nidle, 10); outtext (&#8221; idle periods.&#8221;);<br \/>\noutimage;<br \/>\nouttext(&#8220;Mean idle period was &#8220;); outreal(idtime\/nidle,5,12);<br \/>\noutimage;<br \/>\nouttext(&#8220;Probability of being idle was &#8220;); b := idtime\/a;<br \/>\noutreal (b, 5,12); outtext (&#8221; Predicted was &#8220;); c := mstime\/mitime;<br \/>\noutreal (1.0-c, 5,12); outimage;<\/p>\n<p>d := c\/(1.0-c);<br \/>\nouttext (&#8220;Mean system size was &#8220;); outreal (q0samp\/nsamps, 4, 12);<br \/>\nouttext (&#8221; Predicted was &#8220;); outreal (d, 4, 12);<br \/>\ne := sizeint\/a;<br \/>\noutreal (e, 4, 12);<br \/>\noutimage;<\/p>\n<p>e := 1.0\/(1.0-c);<br \/>\nouttext (&#8220;Mean queue size (&gt;0) was &#8220;);<br \/>\nif (nzsamps &lt;&gt; 0) then<br \/>\noutreal (q1samp\/nzsamps,4,12);<br \/>\nouttext (&#8221; Predicted was &#8220;); outreal (e, 4, 12);<br \/>\noutimage;<\/p>\n<p>e := (c*c)\/(1.0-c);<br \/>\nouttext (&#8220;Mean queue size was &#8220;);<br \/>\nif (nsamps &lt;&gt; 0) then<br \/>\noutreal (q2samp\/nsamps,4,12);<br \/>\nouttext (&#8221; Predicted was &#8220;); outreal (e, 4, 12);<br \/>\noutimage;<\/p>\n<p>e := 1.0\/( (1.0\/mstime) &#8211; (1.0\/mitime) );<br \/>\nouttext (&#8220;Mean response time was &#8220;); outreal (rtime\/nrsamps,4,12);<br \/>\nouttext (&#8221; Predicted was &#8220;); outreal (e, 4, 12);<br \/>\noutimage;<\/p>\n<p>a := 1.0\/mitime;\u00a0\u00a0 \u00a0b := 1.0\/mstime;<br \/>\ne := a\/(b*(b-a));<br \/>\nouttext (&#8220;Mean queue wait time was &#8220;); outreal (qtime\/nrsamps,4,12);<br \/>\nouttext (&#8221; Predicted was &#8220;); outreal (e, 4, 12);<br \/>\noutimage;<\/p>\n<p>end;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0Chapter 9 Here&#8217;s were we will put color versions of the images, updates, and other extras. How do you ensure that the simulation you design simulates your model faithfully? In order to have confidence that the key elements of the simulation are faithful implementations of the original system it is necessary to verify both the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":82,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","jetpack_post_was_ever_published":false,"footnotes":""},"class_list":{"0":"post-38","1":"page","2":"type-page","3":"status-publish","4":"has-post-thumbnail","6":"entry"},"jetpack_shortlink":"https:\/\/wp.me\/P4QGQz-C","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/minkhollow.ca\/books\/index.php?rest_route=\/wp\/v2\/pages\/38","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/minkhollow.ca\/books\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/minkhollow.ca\/books\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/minkhollow.ca\/books\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/minkhollow.ca\/books\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=38"}],"version-history":[{"count":11,"href":"http:\/\/minkhollow.ca\/books\/index.php?rest_route=\/wp\/v2\/pages\/38\/revisions"}],"predecessor-version":[{"id":499,"href":"http:\/\/minkhollow.ca\/books\/index.php?rest_route=\/wp\/v2\/pages\/38\/revisions\/499"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/minkhollow.ca\/books\/index.php?rest_route=\/wp\/v2\/media\/82"}],"wp:attachment":[{"href":"http:\/\/minkhollow.ca\/books\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=38"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}