## page was renamed from Assignments/StochasticAreaNetworks #acl _Students:read #acl All:read <> {{{#!wiki comment FIXME: sim/assignments/README-Assignment-Checklist.txt rubric entries need updated (forgot to do this before releasing in 2020). FIXME: rewrite in Conceptual Model, Specification Model form. Spec model must detail ties for critical paths. }}} {{{#!wiki important 1. Here is [[#|the change log|&action=info]] for this assignment write-up. I will try to be descriptive in my log messages. 1. You can also [[#|subscribe|&action=subscribe]] to this page and receive Emails when changes are made, though I doubt there will be many changes required. 1. The [[#simgrading|grader tarball]] can be downloaded and used on an alamode machine to test your `SIM`. 1. You may work with a partner, or you may work alone --- your choice. If you decide to partner up, one of you should send your instructor an Email saying as much --- deadline for this is 1 week before the due date. }}} Write a program `SIM` (meeting the usual [[Assignments/Requirements|requirements]]) that implements the Monte Carlo simulation for ''Stochastic Area Networks'' in section 2.4.4 of the text. = Input & Output = Your `SIM` program will take several arguments: ||Argument ||Value || ||1 ||File of $Uniform(0,1)$ values; use one of [[Assignments/TraceFiles|these]] if you like || ||2 ||Number of replications to run ($N$) || ||3 ||A text file describing the SAN (details below) || Your program should produce output such as (compared to the book's table on page 83, we are simply displaying the $\pi_k$ and $\hat{p}_a(\pi_k)$ columns): {{{ OUTPUT :a1/2,a2/3,a3/4,a4/6: 5.72632e-01 OUTPUT :a1/3,a3/6: 1.81732e-02 OUTPUT :a1/2,a2/5,a5/6: 1.51699e-03 OUTPUT :a1/2,a2/3,a3/6: 9.45027e-02 OUTPUT :a1/4,a4/6: 1.94422e-01 OUTPUT :a1/3,a3/4,a4/6: 1.18930e-01 }}} '''Note that the there is no specific order''' to the output,<> but you '''must''' provide an entry for all '''possible''' paths. The paths should be formatted without any intervening white space, beware: {{{ OUTPUT :a1/2, a2/3, a3/4, a4/6: 5.72632e-01 }}} is no good The value provided for each path is the critical path point estimate described in the book. Use '''at least 6 significant digits''' and [[Assignments/ScientificNotation|scientific notation]] for the point estimates. The output above is nicely formatted into columns, but your results don't need to be (in fact I've prettied up the aforementioned output from my own results). = SAN Description Files = <> = Submit Your Work = <> /* optional */ <> === grader.sh === <> Students have access to the same script I'm providing the grader for testing your `SIM`. Here is how to use it: First, download <> to your Mines Linux account ("alamode" machines!) and unroll it in a temporary directory. {{{ $ ls criticalpath-student.* criticalpath-student.tar.bz2 $ mkdir tmp $ cd tmp $ tar xjf ../criticalpath-student.tar.bz2 }}} Second, set the SIMGRADING environmental variable with: {{{ $ source ~khellman/SIMGRADING/setup.sh ~khellman/SIMGRADING }}} Now go to the directory holding your !CriticalPath `SIM` (is it `~/sim/critpath` or something else?) and execute the `grader.sh` script from the `criticalpath-student.tar.bz2` resource. {{{ $ cd ~/sim/critpath $ ls SIM SIM $ ~/tmp/CriticalPath/grader.sh : : : }}} You will need to read any messages from the script carefully, and you may need to hit `ENTER` several times throughout its course. This script checks for: a. missing tracefiles a. truncated tracefiles a. incorrect edge weight randomization a. correct reporting of multiple critical paths a. a result formatting a. and the difference between `SIM` results and expected results The latter test generates PDFs files for your inspection. The <> are the result of `SIM` point estimates using $N=1000$ replications; the <> are the expected results from eight $N=300$ trials. The $x$ coordinate for all plots are the point estimates from an $N=10000$ experiment. The <> is the line of identity ($y=x$). Your `SIM`'s <> should be closer to the line of identity than most of the <>. Here is an example of one of the plots generated by `grader.sh`: {{attachment:_s_cp-1201.svg|san 1201 result|title="san 1201 result",width="60%"}} {{{#!wiki tip If you are concerned that some of your `SIM`'s <> are too far away from the line of identity, you can easily run `grader.sh` using a larger number of replications. This should bring your data closer to the $y=x$ --- if it doesn't you probably have a flawed `SIM`. To run with a larger $N$:<
> `$ ~/tmp/CriticalPath/grader.sh . 2500`<
> Note the first argument of a period (`.`), more usage details for `grader.sh` can be found with `--help` as the first argument. }}} {{{#!wiki important The grader will use the same `grader.sh` script, but different SAN files. The network files included in <> are representative of the network files used for grading. }}} <> = Rubric = This work is worth 46 points. ||Requirements ||Points ||Notes || ||Meets [[Assignments/Requirements|simulation course project requirements]] ||10 || || ||Proper termination with missing or truncated input files ||5 ||`exit(1)` for missing files or when random numbers run out || ||Proper edge allocation algorithm ||5 ||$Uniform(a,b)$ once per edge per replication || ||Detects and reports multiple critical paths correctly ||5 || || ||Output meets requirements (formatting of paths, point estimates) ||5 || || ||`san-leemis79.net` results ||5 || || ||`san-1201` results ||5 || || ||`san-161009` results ||5 || || ||Correct submission ||1 /* Encourage them to do this right */ || ||