SimulationI have to create this simulation, but I'm having some troubles. This is what I must do:
- The first node sends a message to every node that's in range: easy.
- Every node must wait for a random time: easy.
- The one that wait for the less time must send the message again, while the other must not send it: I don't know how to do this point (without the help of some external variables). My problem is that the waiting times must be low, so every node waits at most 1 second. I tried to remember somehow if a node has already seen that message, but the waiting times are so low that in the end every node will broadcast the message again.
- The message will be broadcasted again. Only the nodes on the lest will just ignore it: easy.
- And so on.
Can someone help me?