Generating Random numbers in omnetpp in a given range

1,308 views
Skip to first unread message

Neeraj Mudgil

unread,
May 21, 2012, 2:48:59 AM5/21/12
to omnetpp
Hi Everyone,

Can anyone please tell me how to generate decimal random numbers (random numbers of type double) in omnet++ in a given range? For example if we want to generate a random number of type double between 0 AND 3.2 how we can do this? I know that dblrand() only generates doubles between 0 AND 1. But this is not what I want.

Thank you!
--
Neeraj Mudgil
M.Tech Computer Engg.(2010-12)
NIT Kurukshetra

Alfonso Ariza Quintana

unread,
May 21, 2012, 3:59:49 AM5/21/12
to omn...@googlegroups.com
See manual section 7.4.4
 
uniform(0, 3.4)
--
Sent from the OMNeT++ mailing list. To configure your membership,
visit http://groups.google.com/group/omnetpp

Neeraj Mudgil

unread,
May 21, 2012, 7:08:50 AM5/21/12
to omn...@googlegroups.com
Thank you very much sir...
Contact: 09992300873

(¨`·.·´¨) Alwayz
`·.¸(¨`·.·´¨) Keep
       (¨`·.·´¨)¸.·´ Smiling!
        `·.¸.·´


Jarnail Singh

unread,
May 21, 2012, 4:45:16 PM5/21/12
to omn...@googlegroups.com
take refernce from jva random generatot in specific range....

On 5/21/12, Neeraj Mudgil <mudgil...@gmail.com> wrote:
> Thank you very much sir...
>
> On Mon, May 21, 2012 at 1:29 PM, Alfonso Ariza Quintana <
> aari...@hotmail.com> wrote:
>
>> See manual section 7.4.4
>>
>> uniform(0, 3.4)
>>
>> *From:* Neeraj Mudgil <mudgil...@gmail.com>
>> *Sent:* Monday, May 21, 2012 8:48 AM
>> *To:* omnetpp <omn...@googlegroups.com>
>> *Subject:* [Omnetpp-l] Generating Random numbers in omnetpp in a given
>> range
>>
>> Hi Everyone,
>>
>> Can anyone please tell me how to generate decimal random numbers (random
>> numbers of type* double*) in omnet++ in a given range? For example if we
>> want to generate a random number of type double between 0 AND 3.2 how we
>> can do this? I know that dblrand() only generates doubles between 0 AND 1.
>> But this is not what I want.
>>
>> Thank you!
>> --
>> Neeraj Mudgil
>> M.Tech Computer Engg.(2010-12)
>> NIT Kurukshetra
>>
>> --
>> Sent from the OMNeT++ mailing list. To configure your membership,
>> visit http://groups.google.com/group/omnetpp
>>
>> --
>> Sent from the OMNeT++ mailing list. To configure your membership,
>> visit http://groups.google.com/group/omnetpp
>>
>
>
>
> --
> Neeraj Mudgil
> M.Tech Computer Engg.(2010-12)
> NIT Kurukshetra
> Contact: 09992300873
> *
> **(¨`·.·´¨) Alwayz
> `·.¸(¨`·.·´¨) Keep
> (¨`·.·´¨)¸.·´ Smiling!
> `·.¸.·´ *
Reply all
Reply to author
Forward
0 new messages