simulation

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ACCEPTED = 'A'
	REJECTED = 'R'
	DROPPED  = 'D'
	OUTBOUND = 'O'
	INCOMING = 'I'
)

Variables

View Source
var RecordConv = NewConvergenceList()

Functions

func ConvergenceToString

func ConvergenceToString() (output [][]string)
func DropLink(x, y peer.ID, timestamp int64, list []Link) bool

func LinksToString

func LinksToString(linkList []Link) (output [][]string)

func MessagesToString

func MessagesToString(nodeMap map[peer.ID]Node, status *StatusMap) (output [][]string)

func NewLinkAnalysis

func NewLinkAnalysis(nodeMap map[peer.ID]Node) *linkAnalysis

func WriteAdjlist

func WriteAdjlist(nodeMap map[peer.ID]Node, filename string) error

func WriteCSV

func WriteCSV(records [][]string, filename string, header ...[]string) error

Types

type Convergence

type Convergence struct {
	// contains filtered or unexported fields
}

type ConvergenceList

type ConvergenceList struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewConvergenceList

func NewConvergenceList() *ConvergenceList

func (*ConvergenceList) Append

func (c *ConvergenceList) Append(t Convergence)

func (*ConvergenceList) GetAvgNeighbors

func (c *ConvergenceList) GetAvgNeighbors() float64

func (*ConvergenceList) GetConvergence

func (c *ConvergenceList) GetConvergence() float64
type Link struct {
	// contains filtered or unexported fields
}
func NewLink(x, y peer.ID, timestamp int64) Link

func (Link) String

func (l Link) String() string

type Node

type Node struct {
	Start func()
	Stop  func()
	// contains filtered or unexported fields
}

func NewNode

func NewNode(name string, saltLifetime time.Duration, network *transport.ChanNetwork, dropOnUpdate bool, discover selection.DiscoverProtocol) Node

func (Node) GetNeighbors

func (n Node) GetNeighbors() []*peer.Peer

func (Node) GetOutgoingNeighbors

func (n Node) GetOutgoingNeighbors() []*peer.Peer

func (Node) ID

func (n Node) ID() peer.ID

func (Node) Peer

func (n Node) Peer() *peer.Peer

type Status

type Status struct {
	// contains filtered or unexported fields
}

type StatusMap

type StatusMap struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewStatusMap

func NewStatusMap() *StatusMap

func (*StatusMap) Append

func (s *StatusMap) Append(from, to peer.ID, op byte)

func (*StatusMap) GetSummary

func (s *StatusMap) GetSummary(id peer.ID) (cnt StatusSum)

type StatusSum

type StatusSum struct {
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL