algorithm - Generating a set of random events at a predefined frequency -
I have a set of events that should be randomly , but in the predefined frequency i.e. During completely infinite events, event A should be repeatedly 10%, Events should be B3%, and so on ... Of course, the total amount of percentage of event list will be added to 100.
I want to achieve this program. How do I do this?
You have not specified a language, so here some pseudo code comes
You basically want a function that will call other functions with different functions
function RandomEvent float roll = random () - Random number between 0 and 1 if the rolls < 0.1 Then the event will be rolled to other if the rolls & lt; 0.13 Then the event ....
Comments
Post a Comment