Discrete-event simulation with SimPy and Optimization with SciPy -- 3
Budget: $10 – $30 USD
1) We would like to design a [network packet](https://en.wikipedia.org/wiki/Network_packet) routing system. To do so, we will need to define the system and run a simulation so that we can generate data that will be used for the optimization of design parameters. Our router will be a bit of a simpler system, so do not worry about any specifics you know about ethernet or telecommunications in general. The goal of our router is that it will route packets from devices connected to it through to the internet.
We'll parameterize our router so that it can accept $\alpha$ packet routing connections at any time. Assume that packets take $\beta$ time to be routed through the router. Let's say that each device connected to the router is only willing to wait up to $\gamma$ time for the packet to be routed to its destination. Let's also say that our system will allow for prioritization on three levels, so that we can make sure those high-priority packets like those for voice and video calls can route through before lower-priority packets like standard file downloads. To model our system, let's say that we have $n$ devices on our network connected to the router. Each device generates $X_v$ videocalling packets, $X_s$ standard priority packets, and $X_l$ low priority packets at an $X_i$ interval. Higher priority packets will not preempt lower-priority packets, but they will be able to jump the queue (`simpy.PriorityResource`).
Based on the distributions for the parameters below, what is the average number of packets that make it through the router to the internet, for $n$ = [3, 5, 10, 15]? All time-related parameters below are in milliseconds. Make sure to set the random seed.
- $\alpha$ = 6
- $\beta$ = exponentially-modified normal continuous random variable at location 1 and scale 1.5
- $\gamma$ = 3
- $X_v$ = uniform discrete random variable between [2,10]
- $X_s$ = uniform discrete random variable between [2,10]
- $X_l$ = uniform discrete random variable between [2,10]
- $X_i$ = binomial discrete random variable with n at 10 and p at 0.5
2)Write and discuss the steps to answering the following research question:** Create a function that will automatically run the simulation above given $n$ and return the number of packets that successfully route through. Make sure that the function sets the same random seed inside the function, so that your simulation parameters are consistent across runs. Using `scipy.optimize.minimize_scalar()` ([see reference](https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize_scalar.html#scipy.optimize.minimize_scalar)), what is the value of $n$ (number of devices on the network) that results in the highest number of packets that successfully route through our router design, where $5 \le n \le 30$?
Attached a file in jupyter notebook formate
We'll parameterize our router so that it can accept $\alpha$ packet routing connections at any time. Assume that packets take $\beta$ time to be routed through the router. Let's say that each device connected to the router is only willing to wait up to $\gamma$ time for the packet to be routed to its destination. Let's also say that our system will allow for prioritization on three levels, so that we can make sure those high-priority packets like those for voice and video calls can route through before lower-priority packets like standard file downloads. To model our system, let's say that we have $n$ devices on our network connected to the router. Each device generates $X_v$ videocalling packets, $X_s$ standard priority packets, and $X_l$ low priority packets at an $X_i$ interval. Higher priority packets will not preempt lower-priority packets, but they will be able to jump the queue (`simpy.PriorityResource`).
Based on the distributions for the parameters below, what is the average number of packets that make it through the router to the internet, for $n$ = [3, 5, 10, 15]? All time-related parameters below are in milliseconds. Make sure to set the random seed.
- $\alpha$ = 6
- $\beta$ = exponentially-modified normal continuous random variable at location 1 and scale 1.5
- $\gamma$ = 3
- $X_v$ = uniform discrete random variable between [2,10]
- $X_s$ = uniform discrete random variable between [2,10]
- $X_l$ = uniform discrete random variable between [2,10]
- $X_i$ = binomial discrete random variable with n at 10 and p at 0.5
2)Write and discuss the steps to answering the following research question:** Create a function that will automatically run the simulation above given $n$ and return the number of packets that successfully route through. Make sure that the function sets the same random seed inside the function, so that your simulation parameters are consistent across runs. Using `scipy.optimize.minimize_scalar()` ([see reference](https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize_scalar.html#scipy.optimize.minimize_scalar)), what is the value of $n$ (number of devices on the network) that results in the highest number of packets that successfully route through our router design, where $5 \le n \le 30$?
Attached a file in jupyter notebook formate