Network
This class simulates an unreliable network that may lose, duplicate or delay messages. It was made together with AntiEntropy to locally test the correctness of Delta CRDTs in unreliable networks. The network can be made reliable for certain phases only by using the startReliablePhase and endReliablePhase methods.
Attributes
- delayChance
A value between 0 and 1 describing the likelihood that a message gets delayed during transfer, i.e. that it does not get retrieved in a call to receiveMessages. For example, assuming a lossChance of 0, in a network with delayChance 0 every message can be retrieved in the first call to receiveMessages after the message was sent, while in a network with delayChance 0.5 there is a 50% chance that the message is retrieved by the first call to receiveMessages, a 25% chance for the second call, a 12.5% chance for the third call and so on.
- duplicateChance
A value between 0 and 1 describing the likelihood that a received message is duplicated, i.e. it is not removed from the internal buffer when it is passed on to the anti-entropy algorithm. Note that a message that was left in the buffer might be duplicated again the next time that messages are retrieved. For example, assuming a lossChance of 0, a network with duplicateChance 0 will deliver every message exactly once, while a network with duplicateChance 0.5 delivers a message just once with a 50% chance, twice with a 25% chance, three times with a 12.5% chance and so on.
- lossChance
A value between 0 and 1 describing the likelihood that a message is lost in transfer. For example, a network with lossChance 0 will deliver every message while a network with lossChance 0.5 will lose 50% of all messages.
- Graph
- Supertypes
- class Objecttrait Matchableclass Any