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.
파일 보기 프로젝트 열기: pstjuste/brunet 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
_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