mardi 13 juin 2017

C# select random numbers within a period of time

I have a list of employee numbers (about 300 employees), each employee will place his fingerprint into a scanner and I have to randomly select 20 employees between 7am and 7:15am and within a random interval of time.

All employees entrance shift is between 7:00am and 7:15am, Human Resources needs to receive an alert exactly after they place their finger into the door scanner only for the randomnly selected employee so inmediatly the employee is moved into a room for a special test.

For example, 300 employees will go in within a frame of 15 minutes, I have to select only 20 but don't want to be sequencial, so maybe the first employee will be selected but then second is not, and third is not, and maybe the fourth is selected again, and so on.

And there is other complex rule, once a employee is radonmly selected, the algorith will have to wait between 30 and 60 seconds (this has to be random also) until the random logic is executed again.

Here is an example in Excel of how it should work:

enter image description here

Any clue?




Aucun commentaire:

Enregistrer un commentaire