update assignment

This commit is contained in:
Joeri Exelmans 2024-12-13 14:58:40 +01:00
parent 321cb4871e
commit c65ea0075e
2 changed files with 53 additions and 28 deletions

View file

@ -1,24 +0,0 @@
CODING CONVENTIONS
1. write your methods always in the following order:
extTransition
timeAdvance
outputFnc
intTransition
this reflects the order in which the methods are called by the simulator:
extTransition always has highest priority (can interrupt anything)
timeAdvance is called before outputFnc
outputFnc is called right before intTransition
2. input/output port attributes start with 'in_' and 'out_'
TROUBLESHOOTING
- did you forget to return `self.state` from intTransition or extTransition ?
- did you accidentally write to `self.x` instead of `self.state.x` ?
- did you modify the state in timeAdvance or outputFnc (NOT ALLOWED!!)

View file

@ -1,3 +1,5 @@
<dtml-var simple_html_header>
<html>
<head><title>DEVS Assignment</title></head>
<body>
@ -85,7 +87,7 @@ The specification of the semantics of the Atomic DEVS blocks is entirely determi
</p>
<h3>Coupled DEVS</h3>
<p>The system as a whole is modeled as a Coupled DEVS block. Many of its parameters are passed as-is to the underlying Atomic DEVS blocks, such as:
<p>The system as a whole is modeled as a Coupled DEVS block. Its parameters are mostly passed as-is to the underlying Atomic DEVS blocks. They are:
<ul>
<li><b>gen_num (int)</b> -> Generator.</li>
<li><b>gen_rate (float)</b> -> Generator.</li>
@ -139,16 +141,61 @@ The specification of the semantics of the Atomic DEVS blocks is entirely determi
<li><tt>environment.py</tt> Contains implementations of the Generator, Sink and Ship types. You must not edit this file.</li>
</ul>
</li>
<li>Write a report, where you:
<ul>
<li>explain and motivate the interfaces/protocol of the AtomicDEVS blocks</li>
<li>show the plotted results</li>
<li>interpret the plotted results</li>
</ul>
</li>
<li>Submit via BlackBoard, a ZIP file, containing:
<ul>
<li>Your code (only the <tt>assignment</tt> directory)</li>
<li>Your report (PDF)</li>
<li>The generated CSV- and SVG-files</li>
</ul>
</li>
</ol>
<h2>Attention!</h2>
<p>You must stick to the rules of DEVS:</p>
<h2 id="attention">Attention!</h2>
<p>You <b><u><i>must</i></u></b> stick to the rules of DEVS:</p>
<ul>
<li>The functions <tt>timeAdvance</tt> and <tt>outputFnc</tt> are purely <em>getters</em>! They must not mutate the DEVS state, or any variable, anywhere.</li>
<li>The functions <tt>extTransition</tt> and <tt>intTransition</tt> may mutate <em>ONLY</em> the DEVS state.</li>
</ul>
<p>Any violation of these rules results in an incorrect solution. Points will be subtracted.</p>
<h2>Coding Conventions</h2>
<p>Please follow these coding conventions:</p>
<ul>
<li>Write your AtomicDEVS methods always in the following order:
<ul>
<li>extTransition</li>
<li>timeAdvance</li>
<li>outputFnc</li>
<li>intTransition</li>
</ul>
<p>This reflects the order in which the methods are called by the simulator:</p>
<ul>
<li>extTransition always has highest priority (can interrupt anything)</li>
<li>timeAdvance is called before outputFnc</li>
<li>outputFnc is called right before intTransition</li>
</ul>
</li>
<li>Input/output port attributes start with 'in_' and 'out_'</li>
</ul>
<h2>Troubleshooting</h2>
<p>Common mistakes include:
<ul>
<li>did you forget to return <tt>self.state</tt> from intTransition or extTransition ?</li>
<li>did you accidentally write to <tt>self.x</tt> instead of <tt>self.state.x</tt> ?</li>
<li>did you modify the state in timeAdvance or outputFnc ? (<a href="#attention">NOT ALLOWED!!</a>)</li>
</ul>
<h2>Extra Material</h2>
<ul>
<li>This assignment was inspired by the queueuing example, which you can in <tt>examples/queueing</tt>.</li>
@ -156,3 +203,5 @@ The specification of the semantics of the Atomic DEVS blocks is entirely determi
</body>
</html>
<dtml-var standard_html_footer>