C# Class Brunet.Simulator.Simulator

Exibir arquivo Open project: pstjuste/brunet Class Usage Examples

Public Properties

Property Type Description
BrunetNamespace string
CurrentNetworkSize int
NCEnable bool
Nodes NodeMapping>.SortedList
SimBroadcastHandler Brunet.Messaging.SimpleFilter
SimBroadcastPType Brunet.Util.PType
StartingNetworkSize int
TakenIDs NodeMapping>.SortedList

Protected Properties

Property Type Description
_broken double
_ca_cert Brunet.Security.Certificate
_dtls bool
_parameters Parameters
_pathing bool
_rand System.Random
_se_key System.Security.Cryptography.RSACryptoServiceProvider
_secure_edges bool
_secure_senders bool
_start bool

Public Methods

Method Description
AddNode ( ) : Node

Add a new (random) node to the simulation.

AddNode ( int id, AHAddress address ) : Node

Add a new specific node to the simulation.

AreConnected ( Node node0, Node node1 ) : bool
CheckRing ( bool log ) : bool

Performs a crawl of the network using the ConnectionTable of each node.

Complete ( bool quiet ) : bool
Disconnect ( ) : void

Disconnects all the nodes in the simulator.

FindMissing ( bool log ) : List

Returns a list of missing nodes, while crawling the simulation. This is an example of a PassiveTask.

PrintConnectionState ( ) : void
PrintConnections ( ) : void

Prints all the connections for the nodes in the simulator.

PrintConnections ( Node node ) : void
RandomNode ( ) : NodeMapping
RemoveNode ( Node node, bool cleanly, bool output ) : void
RemoveNode ( bool cleanly, bool output ) : void
Revoke ( bool log ) : NodeMapping

Revoke a random node from a random node.

Simulator ( Parameters parameters ) : System

Protected Methods

Method Description
CreateEdgeListener ( int id ) : EdgeListener

Return the SimulationEdgeListener.

GenerateAddress ( ) : AHAddress

Generate a new unique address, there is potential for collissions when we make the address space small.

GetRemoteTAs ( ) : List

Return a small list of random TAs.

PrepareNode ( int id, AHAddress address ) : StructuredNode
Simulator ( Parameters parameters, bool start ) : System
Start ( ) : void
TakeID ( ) : int

Remove and return the next ID from availability.

Method Details

AddNode() public method

Add a new (random) node to the simulation.
public AddNode ( ) : Node
return Node

AddNode() public method

Add a new specific node to the simulation.
public AddNode ( int id, AHAddress address ) : Node
id int
address Brunet.Symphony.AHAddress
return Node

AreConnected() static public method

static public AreConnected ( Node node0, Node node1 ) : bool
node0 Node
node1 Node
return bool

CheckRing() public method

Performs a crawl of the network using the ConnectionTable of each node.
public CheckRing ( bool log ) : bool
log bool
return bool

Complete() public method

public Complete ( bool quiet ) : bool
quiet bool
return bool

CreateEdgeListener() protected method

Return the SimulationEdgeListener.
protected CreateEdgeListener ( int id ) : EdgeListener
id int
return Brunet.Transport.EdgeListener

Disconnect() public method

Disconnects all the nodes in the simulator.
public Disconnect ( ) : void
return void

FindMissing() public method

Returns a list of missing nodes, while crawling the simulation. This is an example of a PassiveTask.
public FindMissing ( bool log ) : List
log bool
return List

GenerateAddress() protected method

Generate a new unique address, there is potential for collissions when we make the address space small.
protected GenerateAddress ( ) : AHAddress
return Brunet.Symphony.AHAddress

GetRemoteTAs() protected method

Return a small list of random TAs.
protected GetRemoteTAs ( ) : List
return List

PrepareNode() protected method

protected PrepareNode ( int id, AHAddress address ) : StructuredNode
id int
address Brunet.Symphony.AHAddress
return Brunet.Symphony.StructuredNode

PrintConnectionState() public method

public PrintConnectionState ( ) : void
return void

PrintConnections() public method

Prints all the connections for the nodes in the simulator.
public PrintConnections ( ) : void
return void

PrintConnections() public method

public PrintConnections ( Node node ) : void
node Node
return void

RandomNode() public method

public RandomNode ( ) : NodeMapping
return NodeMapping

RemoveNode() public method

public RemoveNode ( Node node, bool cleanly, bool output ) : void
node Node
cleanly bool
output bool
return void

RemoveNode() public method

public RemoveNode ( bool cleanly, bool output ) : void
cleanly bool
output bool
return void

Revoke() public method

Revoke a random node from a random node.
public Revoke ( bool log ) : NodeMapping
log bool
return NodeMapping

Simulator() public method

public Simulator ( Parameters parameters ) : System
parameters Parameters
return System

Simulator() protected method

protected Simulator ( Parameters parameters, bool start ) : System
parameters Parameters
start bool
return System

Start() protected method

protected Start ( ) : void
return void

TakeID() protected method

Remove and return the next ID from availability.
protected TakeID ( ) : int
return int

Property Details

BrunetNamespace public_oe property

public string BrunetNamespace
return string

CurrentNetworkSize public_oe property

public int CurrentNetworkSize
return int

NCEnable public_oe property

public bool NCEnable
return bool

Nodes public_oe property

public SortedList Nodes
return NodeMapping>.SortedList

SimBroadcastHandler public_oe property

public SimpleFilter,Brunet.Messaging SimBroadcastHandler
return Brunet.Messaging.SimpleFilter

SimBroadcastPType public_oe static_oe property

public static PType,Brunet.Util SimBroadcastPType
return Brunet.Util.PType

StartingNetworkSize public_oe property

public int StartingNetworkSize
return int

TakenIDs public_oe property

public SortedList TakenIDs
return NodeMapping>.SortedList

_broken protected_oe property

protected double _broken
return double

_ca_cert protected_oe property

protected Certificate,Brunet.Security _ca_cert
return Brunet.Security.Certificate

_dtls protected_oe property

protected bool _dtls
return bool

_parameters protected_oe property

protected Parameters,Brunet.Simulator _parameters
return Parameters

_pathing protected_oe property

protected bool _pathing
return bool

_rand protected_oe property

protected Random,System _rand
return System.Random

_se_key protected_oe property

protected RSACryptoServiceProvider,System.Security.Cryptography _se_key
return System.Security.Cryptography.RSACryptoServiceProvider

_secure_edges protected_oe property

protected bool _secure_edges
return bool

_secure_senders protected_oe property

protected bool _secure_senders
return bool

_start protected_oe property

protected bool _start
return bool