GBM is not random data, it is simulated market data (some call it "synthetic market data").
Where can you get say 5-second bar data for hundereds of stocks for say 1000 years?
With GBM it is possible to test 1000s of market situations fast and with no costs.
It is very good for market modelling and forwardtesting, much like BSM is for modelling options.
And: you even don't need to store the mass data in databases; just store the "seed number" which is just a single 32bit or 64bit value depending on the operating system...
Ie. in the above code one would at program start in main() do something like this:
It means that you can replay/repeat the same sequence it generates. This is important during system design and development (ie. for debugging the system).Code:randgen.seed(123456);
This explains everything

Botpro, in addition to C++ please take a look at something called R
you will be enlightened by it, the best part you won't have to reinvent the wheel (in particular with regards to stochastic processes and such).