Re: Is continuously seeding a random number generator performance intensive?

2014-01-30 Thread monarch_dodra
On Tuesday, 21 January 2014 at 19:00:32 UTC, Jeroen Bollen wrote: On Tuesday, 21 January 2014 at 17:51:44 UTC, monarch_dodra Is that your actual code? "MersenneTwisterEngine(seed)" is not valid code, you have to provide the template arguments. I meant to answer to this by the way, sorry. (in n

Re: Is continuously seeding a random number generator performance intensive?

2014-01-21 Thread Jeroen Bollen
On Tuesday, 21 January 2014 at 17:51:44 UTC, monarch_dodra Is that your actual code? "MersenneTwisterEngine(seed)" is not valid code, you have to provide the template arguments. I meant to answer to this by the way, sorry. (in need of edit feature :P )

Re: Is continuously seeding a random number generator performance intensive?

2014-01-21 Thread Jeroen Bollen
On Tuesday, 21 January 2014 at 17:51:44 UTC, monarch_dodra wrote: On Tuesday, 21 January 2014 at 17:13:39 UTC, Jeroen Bollen wrote: On Friday, 17 January 2014 at 19:00:29 UTC, Jeroen Bollen wrote: On Wednesday, 15 January 2014 at 21:00:57 UTC, Jeroen Bollen wrote: How do you correctly create a

Re: Is continuously seeding a random number generator performance intensive?

2014-01-21 Thread monarch_dodra
On Tuesday, 21 January 2014 at 17:13:39 UTC, Jeroen Bollen wrote: On Friday, 17 January 2014 at 19:00:29 UTC, Jeroen Bollen wrote: On Wednesday, 15 January 2014 at 21:00:57 UTC, Jeroen Bollen wrote: How do you correctly create a MersenneTwisterEngine with a ulong as seed? This question still

Re: Is continuously seeding a random number generator performance intensive?

2014-01-21 Thread Jeroen Bollen
On Friday, 17 January 2014 at 19:00:29 UTC, Jeroen Bollen wrote: On Wednesday, 15 January 2014 at 21:00:57 UTC, Jeroen Bollen wrote: How do you correctly create a MersenneTwisterEngine with a ulong as seed? This question still isn't answered by the way. Come on, surely someone knows how to.

Re: Is continuously seeding a random number generator performance intensive?

2014-01-17 Thread Jeroen Bollen
On Wednesday, 15 January 2014 at 21:00:57 UTC, Jeroen Bollen wrote: How do you correctly create a MersenneTwisterEngine with a ulong as seed? This question still isn't answered by the way.

Re: Is continuously seeding a random number generator performance intensive?

2014-01-16 Thread Jeroen Bollen
On Wednesday, 15 January 2014 at 21:23:03 UTC, Frustrated wrote: Anyways, now that you have your RND2D you don't ever have to pre-generate your noise. Obviously it is more computationally expensive though. Thing is, the image is finite so I figured it'd be best to pre-generate a set of seeds,

Re: Is continuously seeding a random number generator performance intensive?

2014-01-15 Thread Frustrated
On Friday, 3 January 2014 at 13:39:41 UTC, Andrea Fontana wrote: On Friday, 3 January 2014 at 01:01:21 UTC, Frustrated wrote: On Thursday, 2 January 2014 at 20:38:10 UTC, Jeroen Bollen wrote: [...] e.g., seed(k); for(i = 1..10) print(rnd(i)); and for(i = 1..10) { seed(time); print(rnd(i)); }

Re: Is continuously seeding a random number generator performance intensive?

2014-01-15 Thread Frustrated
On Wednesday, 15 January 2014 at 21:00:57 UTC, Jeroen Bollen wrote: How do you correctly create a MersenneTwisterEngine with a ulong as seed? If you are trying to create a very large 2D noise generator, this is how you do it, and you can any degree of smoothness you want: Create a 2D RNG. e

Re: Is continuously seeding a random number generator performance intensive?

2014-01-15 Thread Jeroen Bollen
How do you correctly create a MersenneTwisterEngine with a ulong as seed?

Re: Is continuously seeding a random number generator performance intensive?

2014-01-13 Thread marcpmichel
On Thursday, 2 January 2014 at 20:38:10 UTC, Jeroen Bollen wrote: Is it good to re-seed a generator for every coordinate, will this be performance intensive? Is there maybe way to easily implement Generator.at(uint x) in D? http://www.valion-game.com/337/noise-functions-to-generate-landscape

Re: Is continuously seeding a random number generator performance intensive?

2014-01-04 Thread Jeroen Bollen
On Saturday, 4 January 2014 at 21:48:02 UTC, bearophile wrote: Jeroen Bollen: Divisions for every result would be expensive, and shifting the output wouldn't return a uniform distribution. If the ulong is uniform, then every of its ubytes is uniform. So "& ubyte.max" could suffice. If that's

Re: Is continuously seeding a random number generator performance intensive?

2014-01-04 Thread bearophile
Jeroen Bollen: Divisions for every result would be expensive, and shifting the output wouldn't return a uniform distribution. If the ulong is uniform, then every of its ubytes is uniform. So "& ubyte.max" could suffice. If that's not good enough for you, then you can xor together the eight u

Re: Is continuously seeding a random number generator performance intensive?

2014-01-04 Thread Jeroen Bollen
On Saturday, 4 January 2014 at 20:16:31 UTC, Jeroen Bollen wrote: Also where is UIntType defined? Alright, turns out it was just a template. One more question though, I have my Engine set to have 'ulong' as a seed through the template, which means that it'll also return 'ulong' as a result.

Re: Is continuously seeding a random number generator performance intensive?

2014-01-04 Thread Jeroen Bollen
Also where is UIntType defined?

Re: Is continuously seeding a random number generator performance intensive?

2014-01-03 Thread Jeroen Bollen
On Friday, 3 January 2014 at 18:23:23 UTC, monarch_dodra wrote: On Friday, 3 January 2014 at 17:41:48 UTC, Jeroen Bollen wrote: On Friday, 3 January 2014 at 13:42:19 UTC, monarch_dodra wrote: On Friday, 3 January 2014 at 13:30:09 UTC, Jeroen Bollen wrote: I already considered this, but the prob

Re: Is continuously seeding a random number generator performance intensive?

2014-01-03 Thread monarch_dodra
On Friday, 3 January 2014 at 17:41:48 UTC, Jeroen Bollen wrote: On Friday, 3 January 2014 at 13:42:19 UTC, monarch_dodra wrote: On Friday, 3 January 2014 at 13:30:09 UTC, Jeroen Bollen wrote: I already considered this, but the problem is, I need to smoothen the noise, and to do that I need all

Re: Is continuously seeding a random number generator performance intensive?

2014-01-03 Thread Jeroen Bollen
On Friday, 3 January 2014 at 13:42:19 UTC, monarch_dodra wrote: On Friday, 3 January 2014 at 13:30:09 UTC, Jeroen Bollen wrote: I already considered this, but the problem is, I need to smoothen the noise, and to do that I need all surrounding 'checkpoints' too. This means that it'll have to loa

Re: Is continuously seeding a random number generator performance intensive?

2014-01-03 Thread monarch_dodra
On Friday, 3 January 2014 at 13:30:09 UTC, Jeroen Bollen wrote: I already considered this, but the problem is, I need to smoothen the noise, and to do that I need all surrounding 'checkpoints' too. This means that it'll have to load in 5 at a time. I don't see that as a problem. Just because

Re: Is continuously seeding a random number generator performance intensive?

2014-01-03 Thread Andrea Fontana
On Friday, 3 January 2014 at 01:01:21 UTC, Frustrated wrote: On Thursday, 2 January 2014 at 20:38:10 UTC, Jeroen Bollen wrote: [...] e.g., seed(k); for(i = 1..10) print(rnd(i)); and for(i = 1..10) { seed(time); print(rnd(i)); } will both produce random sequences of numbers(and random sequen

Re: Is continuously seeding a random number generator performance intensive?

2014-01-03 Thread Jeroen Bollen
On Friday, 3 January 2014 at 10:06:27 UTC, monarch_dodra wrote: On Friday, 3 January 2014 at 01:43:09 UTC, Chris Cain wrote: So, it sounds like the OP is using the x and y coords for a seed to generate a single number and he was curious to whether it costs too much to reseed like this for every

Re: Is continuously seeding a random number generator performance intensive?

2014-01-03 Thread monarch_dodra
On Friday, 3 January 2014 at 01:43:09 UTC, Chris Cain wrote: So, it sounds like the OP is using the x and y coords for a seed to generate a single number and he was curious to whether it costs too much to reseed like this for every point. FWIW, I'm under the impression that this is a fairly co

Re: Is continuously seeding a random number generator performance intensive?

2014-01-02 Thread Chris Cain
On Thursday, 2 January 2014 at 22:01:01 UTC, monarch_dodra wrote: *This* comment is confusing me. What do you mean by "re-seed"? You mean a random seed? Once seeded, you shouldn't have to re-seed a PRNG: It'll generate random numbers forever. Or do you mean "re-seed" in the sense "reset"? Becau

Re: Is continuously seeding a random number generator performance intensive?

2014-01-02 Thread Frustrated
On Thursday, 2 January 2014 at 20:38:10 UTC, Jeroen Bollen wrote: D provides a set of Random Number Generators in std.random. I am writing an application which would create a 2D map of noise. To do this though, I'll have to calculate the same random numbers over and over again. (I cannot store

Re: Is continuously seeding a random number generator performance intensive?

2014-01-02 Thread monarch_dodra
On Thursday, 2 January 2014 at 20:38:10 UTC, Jeroen Bollen wrote: D provides a set of Random Number Generators in std.random. I am writing an application which would create a 2D map of noise. To do this though, I'll have to calculate the same random numbers over and over again. (I cannot store

Is continuously seeding a random number generator performance intensive?

2014-01-02 Thread Jeroen Bollen
D provides a set of Random Number Generators in std.random. I am writing an application which would create a 2D map of noise. To do this though, I'll have to calculate the same random numbers over and over again. (I cannot store them, that'd take a horrible amount of RAM. ) Is it good to re-s