亂數函數 (Random-Number Function)
-
Upload
lenore-massey -
Category
Documents
-
view
63 -
download
3
description
Transcript of 亂數函數 (Random-Number Function)
-
(Random-Number Function)Rung-Shiang ChengDepartment of Computer and Communication, Kun Shan [email protected]
-
Outline
-
? ANSI C
-
10RAND_MAX(1/2)Example
-
10RAND_MAX (2/2)
-
("0")
1. 2. n
-
1016Example: .
-
1016
-
0 ~ 1Example
-
0 ~ 1
-
m nExample: m + (rand() % (n m + 1) )
-
m n
-
mn
-
mn
-
m nm + (rand() / RAND_MAX) (n m)
-
m nCase 1: random (20, 60)
-
m nCase 2: random (0, 1)
-
NS-2NS-2?Network Simulator, version 2C++, OTCLRouter, Link, End point, TCP/IP protocolsEthernet, WiFi, Sensor Networks
-
(seed) (distribution) E.g. ParetoConstantUniformExponentialHyperExponentail
*
-
Uniform Distribution : min_: max_
*
NS-22(0 )
-
FTP
-
Error Model (Uniform Distribution)(1/2)TCL Scriptnode0node1( SimpleLink object)error rate : Specify error rateunit : Specify the unit of error (time, pkt, bits)Default: packetranvar : Specify the random variable for generating errors
-
Error Model (Uniform Distribution)(1/2)goodput
-
Error rate (1/2)AWK(sent_drop.awk)
-
Error rate (1/2)&: 5
-
? (Report)http://teachers.ksu.edu.tw/rscheng/illus/report.htm