Modelling using Classic DEVS
|
General Information
GoalsThis assignment will make you familiar with modelling, simulation, and performance analysis in DEVS. Problem StatementYou are tasked to model the behaviour of an assembly line in a factory. Products are assembled out of cylinders and cubes and are afterwards inspected for validity. After the latter, most products are accepted, some are thrown in the trash and the remainder will be sent back for reassembly. To allow for optimization and analysis, you are required to model this assembly line. This model will be used to analyze the influence of model parameters on the behaviour. There are seven statistics we will concern ourselves with (please print them to the console at the end of your simulation and describe them in your report):
The model will consist of a Coupled DEVS model named Factory, as shown in the image below: The following is a detailed description of the components of this model as well as the messages that are being sent. Note that it is perfectly possible some components have the exact same functionality, but were given different names for the description of the system. Try to optimize your code such that there is a minimal of code duplication.
SimulationPerform a reasonable number of simulation experiments. Always choose the simulation duration sufficiently long enough to get statistically relevant measurements.
Tips and Tricks
Practical IssuesYou will use the PyPDEVS (Python PDEVS) simulator [download, git repo]. An in-depth documentation is available, and includes examples. Installing PythonPDEVS can be done by executing python setup.py install --user. Note PythonPDEVS works on both Python 2.7 as well as Python >=3.6. The statistics can be printed after the simulate call and printed to the console, to be plotted at the end (e.g. using gnuplot/matplotlib/bokeh). You are strongly advised to first study the "Application to Queueing Systems" example. Note that in PythonPDEVS, when an external transition is triggered, this means that some external input has arrived on one or more of the ports. The inputs will be passed to the method in the form of a dictionary, which is the only argument of the extTransition method. The key values of this dictionary are the ports. If a port is not present in the dictionary, there was no input on that port. The elapsed time can be accessed using the elapsed attribute, but note that this is only correct in the extTransition method. It is therefore not allowed to access the elapsed attribute in an intTransition (and its value will be undefined).
|