473,322 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Simulating a discrete event with probability x

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

Jun 26 '07 #1
2 2130
Affan wrote:
I am writing a discrete event simulator [..]

Since the trigerring of the event is a binary decision I am little
confused how to code this.
What's the algorithm? Can you write it in pseudo-code? If you can,
please do, we can help you convert it into C++ code. If you cannot,
ask in 'comp.programming'. Here we talk C++, not general programming.
[..]
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jun 26 '07 #2
On Jun 26, 1:39 pm, "Victor Bazarov" <v.Abaza...@comAcast.netwrote:
Affan wrote:
I am writing a discrete event simulator [..]
Since the trigerring of the event is a binary decision I am little
confused how to code this.

What's the algorithm? Can you write it in pseudo-code? If you can,
please do, we can help you convert it into C++ code. If you cannot,
ask in 'comp.programming'. Here we talk C++, not general programming.
[..]

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
posted to comp.programming.. as the issue is algorithmic not about
coding.

Thanks.

Jun 26 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Andreas Schmitt | last post by:
Hi, Sorry for posting in German before, totally forgot about that when I was pasting this in here from another German newsgroup I was writing to, trying to get help I am programming a simple...
47
by: Lauren Quantrell | last post by:
I have constructed the following code that simulates the common rollover effect when moving the mouse over a label (this example makes the label bold.) I'm wondering if anyone has come up with...
2
by: Francois Vanderseypen | last post by:
Imagine a discrete 2D space of any size. Say, you have a 100x100 pixels (.net) panel and you have discrete cells of 10x10 pixels. Thinking e.g. of the game of life. I would like to draw a line in...
11
by: CW | last post by:
I have message entry screen that's causing me a bit of an issue. At the moment, there are 2 buttons, one is used to send message to another user (btnSend) and another is used to send messages to...
10
by: jack | last post by:
Hi guys, I am working on a project which requires an implementation of discrete event simulation in C using linked lists. I would greatly appreciate if someone could provide with some sources...
4
by: Roger Withnell | last post by:
I would like to freeze column and row headings on a webpage, simulating freeze panes as in an Excel spreadsheet. Don't seem to be able to do it with Frames. Is there a way with Javascript...
0
by: Mike P | last post by:
I have a couple of columns in my gridview that I am adding formatting to in the RowDataBound event. But when I want to edit the rows when the RowDataBound event gets called, I get an error. I'm...
0
by: info | last post by:
Hi I would like to introduce Discrete-event simulation system Delsi 2.0 The system is implemented as a set of components for .NET 2.0 Framework. It is designed for simulation of queuing systems...
5
by: Xu, Qian | last post by:
Hello All, I have some problem by simulating a link click using javascript. The webpage uses a js-library named interface (jQuery like) ------------------------------ <a id="foo" href="#">Try...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.