mirror of
https://github.com/status-im/simulation.git
synced 2025-02-23 04:18:09 +00:00
Rename interface again
This commit is contained in:
parent
842ad42fc2
commit
e2ebc9fe91
@ -38,7 +38,7 @@ func main() {
|
||||
}
|
||||
defer fd.Close()
|
||||
|
||||
var sim propagation.PropagationSimulator
|
||||
var sim propagation.Simulator
|
||||
switch *simType {
|
||||
case "naivep2p":
|
||||
sim = naivep2p.NewSimulator(data, *naiveP2PN, *naiveP2PDelay)
|
||||
|
@ -46,12 +46,12 @@ func NewSimulator(data *graph.Graph, N int, delay time.Duration) *Simulator {
|
||||
return sim
|
||||
}
|
||||
|
||||
// Stop stops simulator and frees all resources if any. Implements propagation.PropagationSimulator.
|
||||
// Stop stops simulator and frees all resources if any. Implements propagation.Simulator.
|
||||
func (s *Simulator) Stop() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// SendMessage sends single message and tracks propagation. Implements propagation.PropagationSimulator.
|
||||
// SendMessage sends single message and tracks propagation. Implements propagation.Simulator.
|
||||
func (s *Simulator) SendMessage(startNodeIdx, ttl int) *propagation.Log {
|
||||
message := Message{
|
||||
Content: "dummy",
|
||||
|
@ -1,7 +1,7 @@
|
||||
package propagation
|
||||
|
||||
// PropagationSimulator defines the simulators for message propagation within the graph.
|
||||
type PropagationSimulator interface {
|
||||
// Simulator defines the simulators for message propagation within the graph.
|
||||
type Simulator interface {
|
||||
SendMessage(idx, ttl int) *Log
|
||||
Stop() error
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ import (
|
||||
)
|
||||
|
||||
// Simulator simulates WhisperV6 message propagation through the
|
||||
// given p2p network. Implements PropagationSimulator interface.
|
||||
// given p2p network. Implements Simulator interface.
|
||||
type Simulator struct {
|
||||
data *graph.Graph
|
||||
network *simulations.Network
|
||||
@ -120,7 +120,7 @@ func (s *Simulator) Stop() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// SendMessage sends single message and tracks propagation. Implements propagation.PropagationSimulator.
|
||||
// SendMessage sends single message and tracks propagation. Implements propagation.Simulator.
|
||||
func (s *Simulator) SendMessage(startNodeIdx, ttl int) *propagation.Log {
|
||||
node := s.network.Nodes[startNodeIdx]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user