C# Класс Brunet.Graph.Graph

Graph provides the ability to test routing algorithms for ring-based structured p2p networks
Key features provided by Graph include support for Tunnels, latency, hop count, user specified latency, tweaking of network size, near neighbor count, shortcut count.
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
_addr_to_index int>.Dictionary
_addr_to_node GraphNode>.Dictionary
_addrs List
_latency_map List>
_rand System.Random

Открытые методы

Метод Описание
AllToAll ( ) : void
Average ( List data ) : double

Calculates the average of a data set.

BoundedBroadcast ( AHAddress caller, AHAddress from, AHAddress to ) : int

Performs the bounded broadcast using recursion.

Broadcast ( ) : int

Performs a broadcast to the entire overlay.

Broadcast ( AHAddress from ) : int

Performs a broadcast to the entire overlay.

BroadcastAverage ( ) : void
Crawl ( ) : void

Crawls the network using a random address in the network.

Crawl ( AHAddress start ) : void

Crawls the network using the given starting address.

DhtQuery ( AHAddress from, byte key ) : int
GetLeftNearTarget ( AHAddress address ) : AHAddress

Calculate the Left AHAddress of the given address.

GetNearTarget ( AHAddress address ) : AHAddress
Graph ( int count, int near, int shortcuts ) : Brunet.Collections
Graph ( int count, int near, int shortcuts, int seed ) : Brunet.Collections
Graph ( int count, int near, int shortcuts, int random_seed, List dataset ) : Brunet.Collections
ReadLatencyDataSet ( string dataset ) : List>

Loads a square matrix based latency data set from a file.

SendPacket ( AHAddress from, AHAddress to ) : List

Sends a packet from A to B returning the delay and hop count using the Greedy Routing Algorithm.

SendPacket ( AHAddress from, AHAddress to, ushort option ) : List

Sends a packet from A to B returning the delay and hop count.

StandardDeviation ( List data, double avg ) : double

Calculates the standard deviation given a data set and the average.

WriteGraphFile ( string outfile ) : void

Creates a Dot file which can generate an image using either neato with using the -n parameter or circo.

Защищенные методы

Метод Описание
AddConnection ( GraphNode node1, GraphNode node2, int delay ) : void

Creates an edge and a connection from node2 to node1 including the edge. Note: this is unidirectional, this must be called twice, swapping node1 with node2 for a connection to be complete.

CalculateDelay ( GraphNode node1, GraphNode node2 ) : int

Calculates the delay between two nodes.

ComputeShortcutTarget ( AHAddress addr ) : AHAddress

Calculates a shortcut using a harmonic distribution as in a Symphony-lke shortcut.

CreateNode ( AHAddress addr ) : GraphNode

Let the inheritor create their own node types

FindNodeNearestToAddress ( AHAddress addr ) : AHAddress
FixLists ( ) : void
GenerateAddress ( ) : AHAddress
MapToRing ( byte key ) : Brunet.Util.MemBlock[]

Описание методов

AddConnection() защищенный Метод

Creates an edge and a connection from node2 to node1 including the edge. Note: this is unidirectional, this must be called twice, swapping node1 with node2 for a connection to be complete.
protected AddConnection ( GraphNode node1, GraphNode node2, int delay ) : void
node1 GraphNode
node2 GraphNode
delay int
Результат void

AllToAll() публичный Метод

public AllToAll ( ) : void
Результат void

Average() публичный статический Метод

Calculates the average of a data set.
public static Average ( List data ) : double
data List
Результат double

BoundedBroadcast() публичный Метод

Performs the bounded broadcast using recursion.
public BoundedBroadcast ( AHAddress caller, AHAddress from, AHAddress to ) : int
caller AHAddress
from AHAddress
to AHAddress
Результат int

Broadcast() публичный Метод

Performs a broadcast to the entire overlay.
public Broadcast ( ) : int
Результат int

Broadcast() публичный Метод

Performs a broadcast to the entire overlay.
public Broadcast ( AHAddress from ) : int
from AHAddress
Результат int

BroadcastAverage() публичный Метод

public BroadcastAverage ( ) : void
Результат void

CalculateDelay() защищенный Метод

Calculates the delay between two nodes.
protected CalculateDelay ( GraphNode node1, GraphNode node2 ) : int
node1 GraphNode
node2 GraphNode
Результат int

ComputeShortcutTarget() защищенный Метод

Calculates a shortcut using a harmonic distribution as in a Symphony-lke shortcut.
protected ComputeShortcutTarget ( AHAddress addr ) : AHAddress
addr AHAddress
Результат AHAddress

Crawl() публичный Метод

Crawls the network using a random address in the network.
public Crawl ( ) : void
Результат void

Crawl() публичный Метод

Crawls the network using the given starting address.
public Crawl ( AHAddress start ) : void
start AHAddress
Результат void

CreateNode() защищенный Метод

Let the inheritor create their own node types
protected CreateNode ( AHAddress addr ) : GraphNode
addr AHAddress
Результат GraphNode

DhtQuery() публичный Метод

public DhtQuery ( AHAddress from, byte key ) : int
from AHAddress
key byte
Результат int

FindNodeNearestToAddress() защищенный Метод

protected FindNodeNearestToAddress ( AHAddress addr ) : AHAddress
addr AHAddress
Результат AHAddress

FixLists() защищенный Метод

protected FixLists ( ) : void
Результат void

GenerateAddress() защищенный Метод

protected GenerateAddress ( ) : AHAddress
Результат AHAddress

GetLeftNearTarget() публичный Метод

Calculate the Left AHAddress of the given address.
public GetLeftNearTarget ( AHAddress address ) : AHAddress
address AHAddress
Результат AHAddress

GetNearTarget() публичный Метод

public GetNearTarget ( AHAddress address ) : AHAddress
address AHAddress
Результат AHAddress

Graph() публичный Метод

public Graph ( int count, int near, int shortcuts ) : Brunet.Collections
count int
near int
shortcuts int
Результат Brunet.Collections

Graph() публичный Метод

public Graph ( int count, int near, int shortcuts, int seed ) : Brunet.Collections
count int
near int
shortcuts int
seed int
Результат Brunet.Collections

Graph() публичный Метод

public Graph ( int count, int near, int shortcuts, int random_seed, List dataset ) : Brunet.Collections
count int The network size not including the clusters.
near int The amount of connections on the left or right of a ///node.
shortcuts int The amount of far connections had per node.
random_seed int
dataset List A square dataset consisting of pairwise latencies.
Результат Brunet.Collections

MapToRing() защищенный Метод

protected MapToRing ( byte key ) : Brunet.Util.MemBlock[]
key byte
Результат Brunet.Util.MemBlock[]

ReadLatencyDataSet() публичный статический Метод

Loads a square matrix based latency data set from a file.
public static ReadLatencyDataSet ( string dataset ) : List>
dataset string
Результат List>

SendPacket() публичный Метод

Sends a packet from A to B returning the delay and hop count using the Greedy Routing Algorithm.
public SendPacket ( AHAddress from, AHAddress to ) : List
from AHAddress
to AHAddress
Результат List

SendPacket() публичный Метод

Sends a packet from A to B returning the delay and hop count.
public SendPacket ( AHAddress from, AHAddress to, ushort option ) : List
from AHAddress
to AHAddress
option ushort
Результат List

StandardDeviation() публичный статический Метод

Calculates the standard deviation given a data set and the average.
public static StandardDeviation ( List data, double avg ) : double
data List
avg double
Результат double

WriteGraphFile() публичный Метод

Creates a Dot file which can generate an image using either neato with using the -n parameter or circo.
public WriteGraphFile ( string outfile ) : void
outfile string
Результат void

Описание свойств

_addr_to_index защищенное свойство

protected Dictionary _addr_to_index
Результат int>.Dictionary

_addr_to_node защищенное свойство

protected Dictionary _addr_to_node
Результат GraphNode>.Dictionary

_addrs защищенное свойство

protected List _addrs
Результат List

_latency_map защищенное свойство

protected List> _latency_map
Результат List>

_rand защищенное свойство

protected Random,System _rand
Результат System.Random