Page: 1 , 2 | Go to End | |
Author | Topic:RandomNumbersGenerator Plugin Development | 11918 Views |
16 February 2010 at 9:13am
Hi,
If you are doubts, You can check that Fairmat is using your generator by writing contents using Console.WriteLine
virtual void Normal(double* samples, int n)
{
if(DVPLI::Engine::Verbosity>0)
Console::WriteLine("called Normal....");
}
virtual double Normal()
{
double random_variate= .....
if(DVPLI::Engine::Verbosity>0)
Console::WriteLine(random_variate);
return 0;
}[/code:19ls13a0]
and you can control the Verbosity level From the modeler settings windows.
16 February 2010 at 10:07am
Thanks for the answer.
The code you propose however will not test that Fairmat is actually USING the randomness from the plugin randomgenerator. Your tests tests whether or not the plugin random generator is CALLED. It doesn't test the supplied randomness by the pluginn random generator is actually used by Fairmat in the simulation.
The test I propose will test that the supplied randomness by the plugin is USED by Fairmat. This can eg. be done by returning the constant 0.5 for the (0,1) uniform randomness and 0 for normal randomness inthe plugin. If we compare the results of Fairmat using the plugin with this randomness and the standard random generator by removing the plugin from the plugin directory and restarting Fairmat this should in my opinion gibe completely different simulation results. At the moment this we don't see happening.
In order to test this, I propose you give a Fairmat simulation program and change the example plugin so it returns the proposed constant (non-random values). Then we can reproduce whether or not the monte carlo simulation results are different. If they stay the same, in my opinion this is not a monte carlo simulation. A monte carlo simulation is dependent from the quality of the randomness. As far as we can see at the moment, the simulation results are independend from the randomness.
With the proposed test we can verify this is indeed the case or not.
Note that this test is also a good general test of Fairmat !
16 February 2010 at 2:58pm
Thanks for the feedback. For some strange reason Fairmat, as you noticed, is continuing to use the default generator.
We are investigating the problem, I will keep you updated.
17 February 2010 at 8:03am
Hi,
If you are doubts, You can check that Fairmat is using your generator by writing contents using Console.WriteLine
virtual void Normal(double* samples, int n)
{
if(DVPLI::Engine::Verbosity>0)
Console::WriteLine("called Normal....");
}
virtual double Normal()
{
double random_variate= .....
if(DVPLI::Engine::Verbosity>0)
Console::WriteLine(random_variate);
return 0;
}[/code:1r2em0op]
and you can control the Verbosity level From the modeler settings windows.[/quote:1r2em0op]
When we insert this code and include the plugin, during the simulation these is no message in the log that the random generator is called. Perhaps this is the problem why the simulation results are the same for the internal and the plugin randomgenerator with non-random results.
7 January 2012 at 1:20pm
It might be interesting that true quantum randomness for usage of Monte Carlo Simulations can be downloaded from http://qrng.physik.hu-berlin.de/[/url:vbomipud].
If you want to buy the true quantum random generator then on [url:vbomipud]http://www.picoquant.com/products/pqrng150/pqrng150.htm[/url:vbomipud] you can find more information.
11918 Views | ||
Prev | Go to Top |
Currently Online: There is nobody online.
Welcome to our latest member: User4d51