From 321cb4871e6d64988fb4c0dba1a6f165b93efcdb Mon Sep 17 00:00:00 2001 From: Joeri Exelmans Date: Fri, 13 Dec 2024 14:28:07 +0100 Subject: [PATCH] finish assignment --- assignment/doc/assignment.html | 52 ++++++++++++++++++++++++++++++++-- assignment/environment.py | 2 ++ 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/assignment/doc/assignment.html b/assignment/doc/assignment.html index 66132e2..fe49409 100644 --- a/assignment/doc/assignment.html +++ b/assignment/doc/assignment.html @@ -97,8 +97,25 @@ The specification of the semantics of the Atomic DEVS blocks is entirely determi

-

Goal: Performance Analysis

-

We will do performance analysis, comparing combinations of the following parameter values:

+

What is expected

+

First of all, you are given an implementation of the following AtomicDEVS blocks, which you must not edit:

+ +

You will:

+ + +

Goal: Performance Analysis

+

Once you have implemented the system, we will do performance analysis, comparing combinations of the following parameter values:

More specifically, we would like to know under which (combinations of) parameter values the (avg/min/max) duration that ships spend in the system is minimized. Also, we'd like to know if one choice (e.g., prioritize bigger) always better than another choice (e.g., prioritize smaller), or does it depend on the choices made for the other parameters?

+

Getting Started

+
    +
  1. Clone the mosis24 branch of this git repository.
  2. +
  3. Under the assignment directory, you'll find the following files: +
      +
    • runner.py This script runs the simulation for all combinations of parameter values as described in the Performance Analysis section. It will generate .csv files with the time durations that each ship has spent in the system. Every row is a ship (500 ships, so 500 rows total), and every column represents a different value for the max_wait_duration parameter. It will also generate a plot.gnuplot file, which you can run with gnuplot as follows: +
      gnuplot plot.gnuplot
      + which will result in a number of SVG files containing plots of the CSV files. + +

      You are only allowed to make temporary changes (for debugging) to this file.

      +
    • +
    • system.py Contains the full system, modeled as CoupledDEVS. You need to edit this file.
    • +
    • atomicdevs.py Contains skeletons for the AtomicDEVS blocks that you must implement. You need to edit this file.
    • +
    • environment.py Contains implementations of the Generator, Sink and Ship types. You must not edit this file.
    • +
    +
  4. +
+ +

Attention!

+

You must stick to the rules of DEVS:

+ +

Any violation of these rules results in an incorrect solution. Points will be subtracted.

+ +

Extra Material

+ + \ No newline at end of file diff --git a/assignment/environment.py b/assignment/environment.py index e5fb4fc..27617d2 100644 --- a/assignment/environment.py +++ b/assignment/environment.py @@ -80,6 +80,8 @@ class Sink(AtomicDEVS): def __init__(self): super().__init__("Sink") self.state = SinkState() + + # On this input port, the Sink expects to receive a *list* of Ships. This is because a Lock can contain more than one Ship, and the Lock can send them all at once to the Sink (with a single event). self.in_ships = self.addInPort("in_ships") def extTransition(self, inputs):