Rename interface again

This commit is contained in:
Ivan Danyliuk 2018-04-30 22:07:17 +02:00
parent 842ad42fc2
commit e2ebc9fe91
No known key found for this signature in database
GPG Key ID: 97ED33CE024E1DBF
4 changed files with 7 additions and 7 deletions

View File

@ -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)

View File

@ -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",

View File

@ -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
}

View File

@ -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]