Share

peersim

Subscribe

query sending (in event driven simulations)

  1. 2009-10-06 22:07:44 UTC

    Hi,

    I have several questions on PeerSim. (i) I use an event driven simulator. At each cycle, all the peers sends a query. How can I choose a subset of all peers as query senders for each cycle? (ii) How could I let the simulation go even if the end time is reached? (indeed it is possible with event driven simulation to have some messages in the queue after the defined end of simulation) (iii) Is it possible to balance the sending of queries during each cycle. Alternatively is it possible to choose the time of each sending (1/3 at the beginning of each cycle and 2/3 at the end, for example)?

    Thank you in advance, Anthony Ventresque

  2. 2009-10-07 09:19:14 UTC

    > (i) I use an event driven simulator. At each cycle, all the peers sends a query. How can I choose a subset of all peers as query senders for each cycle?

    Your question is ill-posed. On ED simulations a node (ED)protocol is executed (by calling its processEvent() ) if and only if there are messages scheduled for that node protocol.

    if your protocol sends a message on each cycle ("At each cycle, all the peers sends a query" ) subset of senders is equal to all peer set !

    So, what's the point?

    if you need to choose a subset of senders set, you can write a processEvent() like this:

    if( i-am-in-THE-subset ) do something nice else do the usual things.

    (ii) How could I let the simulation go even if the end time is reached? (indeed it is possible with event driven simulation to have some messages in the queue after the defined end of simulation)

    EDSImulation stops if end time is reached OR there aren't messages scheduled in simulator queue.

    You can set an arbitrary high end time value and stop simulation by a Control code. Or you can increase dynamically end time limit by calling CommonState.setEndTime ( but i never tried this).

    (iii) Is it possible to balance the sending of queries during each cycle. Alternatively is it possible to choose the time of each sending (1/3 at the beginning of each cycle and 2/3 at the end, for example)?

    All it's possible but depends on your protocol code.

    Maybe you should show us your code that sends messages.

< Previous | 1 | Next >

Add a Reply

This forum does not allow anonymous participation.

Log in to add a reply. Not registered? Create an account to participate and receive email updates when replies are posted to this topic.