Changing Probabilities
Learn how changing probabilities works and how to use the technique in making custom generators.
We'll cover the following...
Why is changing probabilities required?
To understand why and when changing probabilities is useful, let’s take a look at an example. Let’s imagine that we have a generator that looks for ISO Latin1 strings by using the io_lib:printable_latin1_list
function, which will let us restrict the range of string()
:
latin1_string() ->
?SUCHTHAT(S, string(), io_lib:printable_latin1_list(S)).
Similarly as with Unicode, ensuring that nothing goes out of range looks like the following: ...
Access this course and 1400+ top-rated courses and projects.