Click here to Skip to main content
15,886,919 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Different results with debug and release version of simulation program Pin
Chris Losinger20-Sep-09 4:08
professionalChris Losinger20-Sep-09 4:08 
GeneralRe: Different results with debug and release version of simulation program Pin
mass8520-Sep-09 4:23
mass8520-Sep-09 4:23 
GeneralRe: Different results with debug and release version of simulation program Pin
Richard MacCutchan20-Sep-09 4:33
mveRichard MacCutchan20-Sep-09 4:33 
GeneralRe: Different results with debug and release version of simulation program Pin
mass8520-Sep-09 4:46
mass8520-Sep-09 4:46 
GeneralRe: Different results with debug and release version of simulation program Pin
Richard MacCutchan20-Sep-09 5:00
mveRichard MacCutchan20-Sep-09 5:00 
GeneralRe: Different results with debug and release version of simulation program Pin
mass8520-Sep-09 5:24
mass8520-Sep-09 5:24 
GeneralRe: Different results with debug and release version of simulation program Pin
Richard MacCutchan20-Sep-09 7:20
mveRichard MacCutchan20-Sep-09 7:20 
GeneralRe: Different results with debug and release version of simulation program Pin
mass8520-Sep-09 9:47
mass8520-Sep-09 9:47 
OK. I've changed conditional statement, so there's no upLinkRatio variable just constant value 0.2. And I also added cout<<temp;

the result="" is="" quite="" strange.="" most="" of="" the="" temp="" values="" are="" 0...="" which="" course="" incorrect.="" do="" you="" know,="" what="" might="" be="" reason="" for="" that?="" i="" will="" looking="" anything="" suspicious="" in="" generator,="" but="" it="" hard="" to="" find...="" example="" function="" gettimebe="" returns="" correct="" values.

here="" parts="" code="" that="" can="" affect="" beload="" from="" generator="" (this="" class="" used="" generate="" pseudo="" random="" numbers):
<pre="">
class Generator{
private:
int a, h, q, r, m;
int *coreCRC;
int **coreCW;
int *coreTimeBE;
int *coreTimeBK;
int *coreUpLinkRatio;
int *coreBurst;
int *corePacket;

int uniform(int X){
h = int ( double (X) / q );
X = a*(X - q*h) - r*h;
if (X < 0) X = X + m;
return X;
}

public:
double getTimeBE(int staAddress, double intensity){
int x = uniform(coreTimeBE[staAddress]);
coreTimeBE[staAddress] = x;
return (-1/intensity * log(double(x)/m));
}
double getUpLinkRandom(int staAddress){
int x = uniform(coreUpLinkRatio[staAddress]);
coreUpLinkRatio[staAddress] = x;
return double(x)/m;
}
void initialize(){
coreCW = new int*[staNr];
coreUpLinkRatio = new int[staNr];
coreBurst = new int[staNr];
coreTimeBE = new int[staNr];
coreTimeBK = new int[staNr];
corePacket = new int[staNr];
for(int i = 0; i < staNr; i++) coreCW[i] = new int[AC];


coreCRC = new int[staNr];
int x = 17;
int msgs = int (5*msgsToObserve*(1 + transientPhase/simTime));
for (int i = 0; i < staNr; i++){
for(int j = 0; j < AC; j++){
coreCW[i][j] = x;
for(int k = 0; k < (runsNr*(10*msgs + 3*shift + runShift)); k++)
x = uniform(x);
}
}
////////////////
// code omitted
///////////////
for(int i = 0; i < AC; i++){
coreUpLinkRatio[i] = x;
for(int j = 0; j < (runsNr*(2*beMsgsToObserve + shift + runShift)); j++)
x = uniform(x);
}
}
Generator() : a(69621), q(30845), r(23902), m(2147483647) {}
};

GeneralRe: Different results with debug and release version of simulation program Pin
CPallini20-Sep-09 10:01
mveCPallini20-Sep-09 10:01 
GeneralRe: Different results with debug and release version of simulation program Pin
mass8520-Sep-09 10:12
mass8520-Sep-09 10:12 
GeneralRe: Different results with debug and release version of simulation program Pin
Richard MacCutchan20-Sep-09 10:08
mveRichard MacCutchan20-Sep-09 10:08 
GeneralRe: Different results with debug and release version of simulation program Pin
mass8520-Sep-09 10:26
mass8520-Sep-09 10:26 
GeneralRe: Different results with debug and release version of simulation program Pin
Richard MacCutchan20-Sep-09 10:35
mveRichard MacCutchan20-Sep-09 10:35 
GeneralRe: Different results with debug and release version of simulation program Pin
mass8520-Sep-09 10:54
mass8520-Sep-09 10:54 
Question[SOLVED}How to activate a menu [modified] Pin
simion31420-Sep-09 0:31
simion31420-Sep-09 0:31 
AnswerRe: How to activate a menu Pin
GameZelda20-Sep-09 0:58
GameZelda20-Sep-09 0:58 
QuestionBinding a Memo Field Pin
Cal Brass19-Sep-09 14:48
Cal Brass19-Sep-09 14:48 
Question[Message Deleted] Pin
HighCloud19-Sep-09 8:42
HighCloud19-Sep-09 8:42 
AnswerRe: C# Programatic Font Install Pin
«_Superman_»19-Sep-09 20:20
professional«_Superman_»19-Sep-09 20:20 
AnswerRe: C# Programatic Font Install Pin
Code-o-mat19-Sep-09 23:16
Code-o-mat19-Sep-09 23:16 
Questioncan i compile the c programs using commands in coomand prompt undr windows,if possible plz post the procedure Pin
raghava.thummapudi19-Sep-09 7:28
raghava.thummapudi19-Sep-09 7:28 
AnswerRe: can i compile the c programs using commands in coomand prompt undr windows,if possible plz post the procedure Pin
Chris Losinger19-Sep-09 7:50
professionalChris Losinger19-Sep-09 7:50 
AnswerRe: can i compile the c programs using commands in coomand prompt undr windows,if possible plz post the procedure Pin
Saurabh.Garg19-Sep-09 12:58
Saurabh.Garg19-Sep-09 12:58 
QuestionProblem with SAPI and Windows Vista [modified] Pin
FredBrina19-Sep-09 5:53
FredBrina19-Sep-09 5:53 
AnswerRe: Problem with SAPI and Windows Vista Pin
Richard MacCutchan20-Sep-09 2:20
mveRichard MacCutchan20-Sep-09 2:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.