diff options
author | Mission Liao <mission.liao@dexon.org> | 2019-01-03 16:00:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-03 16:00:45 +0800 |
commit | 09a00a0580c2fd6e11b17f1793edca5f7bb2f5f8 (patch) | |
tree | 12362787be4d3b6bcd0051591a7bc0c60d859878 /simulation/config | |
parent | 5739e74781092ac09d8b3a575cddc71b50beedf4 (diff) | |
download | dexon-consensus-09a00a0580c2fd6e11b17f1793edca5f7bb2f5f8.tar dexon-consensus-09a00a0580c2fd6e11b17f1793edca5f7bb2f5f8.tar.gz dexon-consensus-09a00a0580c2fd6e11b17f1793edca5f7bb2f5f8.tar.bz2 dexon-consensus-09a00a0580c2fd6e11b17f1793edca5f7bb2f5f8.tar.lz dexon-consensus-09a00a0580c2fd6e11b17f1793edca5f7bb2f5f8.tar.xz dexon-consensus-09a00a0580c2fd6e11b17f1793edca5f7bb2f5f8.tar.zst dexon-consensus-09a00a0580c2fd6e11b17f1793edca5f7bb2f5f8.zip |
simulation: add latency for gossip (#389)
Diffstat (limited to 'simulation/config')
-rw-r--r-- | simulation/config/config.go | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/simulation/config/config.go b/simulation/config/config.go index 797145c..d22f4f1 100644 --- a/simulation/config/config.go +++ b/simulation/config/config.go @@ -56,14 +56,18 @@ type Node struct { Changes []Change } +// LatencyModel for ths simulation. +type LatencyModel struct { + Mean float64 + Sigma float64 +} + // Networking config. type Networking struct { Type test.NetworkType PeerServer string - - Mean float64 - Sigma float64 - LossRateValue float64 + Direct LatencyModel + Gossip LatencyModel } // Scheduler Settings. @@ -129,11 +133,16 @@ func GenerateDefault(path string) error { MaxBlock: math.MaxUint64, }, Networking: Networking{ - Type: test.NetworkTypeTCPLocal, - PeerServer: "127.0.0.1", - Mean: 100, - Sigma: 10, - LossRateValue: 0, + Type: test.NetworkTypeTCPLocal, + PeerServer: "127.0.0.1", + Direct: LatencyModel{ + Mean: 100, + Sigma: 10, + }, + Gossip: LatencyModel{ + Mean: 300, + Sigma: 25, + }, }, Scheduler: Scheduler{ WorkerNum: 2, |