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:
parent
82a1b36820
commit
bb758490c8
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue