Hi,
I am writing a discrete event simulator and want to simplify the
analysis of multipath by trigging an arrival of multipath based on a
the receiver distance from sender- say 'd'- and a simulation
parameter, say mpParam which gives the fraction of maximum range
within which the reflecting surface is located (I know gross
simplifications!). Note that for fraction beyond 1, there is no need
for any event to be triggered as it will not be strong enough to be
received (for sure). Based on the direct distance to the receiver and
the multipath distance I want to make the probability of a multipath
being triggered to be inversely proportional to the sq. of the
distance.
Since the trigerring of the event is a binary decision I am little
confused how to code this. Currently I am doing the following (but it
doesnt feel/seem right!, thats why I am asking here) (RAND_UNIFORME is
a macro giving random # b/w 0,1)
distance = (*nodePosition).getDistance(gNodeInfoVector[nodeIter]);
timerInfo.timeLeft_ = (timeTicks)( distance*SEC_TO_TIMETICK/
(SPEED_MPS));
tcbPtr = new Event(timerInfo); //set event for direct path
float decisionMP=(RAND_UNIFORME+mpParam)*(1-pow((MAX_RANGE/distance),
2));
if(decisionMP <0.5){//only if the threshold is greater than what is
expected at the receiver do we have a multipath signal arriving at the
receiver.. assume a 2 ray model for multipath
double multipathDistance, surfaceHeight;
surfaceHeight=mpParam*MAX_RANGE;
multipathDistance=2*sqrt(((surfaceHeight*surfaceHe ight)+
(distance*distance/4)));//gemoetry calc for multipath calculation
timerInfo.timeLeft_ = (timeTicks)
( multipathDistance*SEC_TO_TIMETICK/(SNDSPEED_MPS));
tcbPtr = new Event(timerInfo);//set event for multipath
}
Any suggestions would be more than welcome.
Thank you.
Affan