# Duplicated Magic Number

4 posts / 0 new
Duplicated Magic Number
#1

Hello,

I modified an existing mover. Compilation finishes without any problems. When starting Rosetta I get the following error:

 ../rosetta_source/bin/minirosetta.macosgccrelease @flags Duplicate magic number in random object initialization! Number:84195 ERROR:: Exit from: src/numeric/random/random.cc line: 136

It seems basically all movers initialize their own RandomnumberGenerator with different seeds. So why is Rosetta complaining in this particular case and not with the other movers? What have I missed?

Best regards and thanks for any helpful suggestions.

Post Situation:
Thu, 2011-11-03 11:26
jurkm

I can't find 84195 in my copy of the source.

Generally, this comes from two places. Either:

A) you put the same RG seed in two files (perhaps the original and a copy you modified)

B) you created the RG ( static numeric::random::RandomGenerator RG(84195); // <- Magic number, do not change it!!! ) in a header file, then included the header in more than one place (thus duplicating the RG).

Thu, 2011-11-03 11:51
smlewis

Thank you so much.

I modified the RigidBodyMover / made a new subclass. I didn't want to mess with the original source code so I did everything in a separate file and (here comes the problem) in a copy of that.

Thu, 2011-11-03 13:46
jurkm

I assume you were able to fix it...? (This wasn't a question, so I'm guessing yes...)

Thu, 2011-11-03 14:30
smlewis