Hi,

I need to develop a method that basically returns a random number based on specific parameters as defined below.

The context is that this method wil go in a wider implementation of a discrete-even simulation model that reflect a specific traffic system.

Basically, the input requires to be of type double. The output must be of type double as well. I have the graph below which is to be used to development of the algorithm to return a random number.

As shown in the image, service time changes as time passes. between 06.00am and 07.10 (70 mins), mean service time is 1. Between 07.10 and 7.35 (70 mins till 95 mins), mean service time is 3 etc. I would require that the random number returned displays this characteristics, i.e. as from time NOW = 0 (mins) to time now = 70 (mins), there is a mean service time of 1 etc.

Picture1.jpg

I am not exactly sure how to go along and develop this. Does it make sense to develop an array with probabilities?

Any help would be appreciated.