1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

use Box-Muller method to generate random walk messages

This commit is contained in:
Steffen Vogel 2015-05-19 16:54:00 +02:00
parent 82a1b36820
commit bb758490c8

View file

@ -82,7 +82,7 @@ int msg_fscan(FILE *f, struct msg *m)
void msg_random(struct msg *m)
{
for (int i = 0; i < m->length; i++)
m->data[i].f += (float) random() / RAND_MAX - .5;
m->data[i].f += box_muller(0, 1);
m->endian = MSG_ENDIAN_HOST;
}