Thank you for your help!

By the way, the RandomMlcgC is a better (and slower) random number generator
because it allows the user to choose the seed that he wants to use?

2010/1/20 Henrik Mäkitaavola <[email protected]>

> I want to generate random numbers, I know that I can use RandomLfsrC or
>> RandomMlcgC. However, the RandomLfsrC is out of question because it
>> generates always the same sequence in all nodes.
>>
> If the nodes have different node id:s both RandomLfsrC and RandomMlcgC
> should generate different sequences. If the nodes have the same node id both
> modules will generate same sequences on all nodes because they will all use
> the same seed.
>
> Regarding the built in rand(). I don't know how it is implemented so it may
> be slower than the once provided by the TinyOS core.
>
>
> 2010/1/20 Ricardo . <[email protected]>
>
>
>> Thanks for the reply.
>>
>> That does not make clear my doubt ... Maybe I have not explained the best
>> way: there is a method rand() available in the C programming language, which
>> is also available in TinyOS. This method will not need any wiring or
>> anything else, it works simply by invoking the function rand().
>>
>> My question is: what is the difference between this method rand() and
>> method rand16()/rand32() provided by RandomMlcgC?
>>
>> On Wed, Jan 20, 2010 at 2:37 AM, Qiyuan Zhang <[email protected]>wrote:
>>
>>> Hi, Ricardo.
>>>
>>> The interface Random provides two functions: rand16() and rand32(). 
>>> RandomLfsrC
>>> or RandomMlcgC is the specific implementations. Of course you can call
>>> functions from them directly. You can also provide your own
>>> implementation. Interface Random just provides an abstraction layer.
>>>
>>> Best wishes
>>>
>>> Qiyuan Zhang
>>>
>>>
>>>
>>> On Wed, Jan 20, 2010 at 5:59 AM, Ricardo . <[email protected]>wrote:
>>>
>>>> Hello everyone!
>>>>
>>>> I want to generate random numbers, I know that I can use RandomLfsrC or
>>>> RandomMlcgC. However, the RandomLfsrC is out of question because it
>>>> generates always the same sequence in all nodes.
>>>>
>>>> My question is: what is the difference of using RandomMlcgC instead of
>>>> calling directly the function rand() (which I do not even know which is the
>>>> component that provides the functionality)?
>>>>
>>>> I appreciate any explanation.
>>>>
>>>> Regards,
>>>> Ricardo
>>>>
>>>> _______________________________________________
>>>> Tinyos-help mailing list
>>>> [email protected]
>>>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>>>
>>>
>>>
>>
>> _______________________________________________
>> Tinyos-help mailing list
>> [email protected]
>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>
>
>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to