|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpeersim.dynamics.DynamicNetwork
public class DynamicNetwork
This Control
can change the size of networks by adding and removing
nodes. Can be used to model churn. This class supports only permanent removal
of nodes and the addition of brand new nodes. That is, temporary downtime
is not supported by this class.
Parameter Summary | |
---|---|
init
Config parameter which gives the prefix of node initializers. |
|
substitute
If defined, nodes are substituted (an existing node is removed, a new one is added. |
|
add
Specifies the number of nodes to add or remove. |
|
maxsize
Nodes are added until the size specified by this parameter is reached. |
|
minsize
Nodes are removed until the size specified by this parameter is reached. |
Field Summary | |
---|---|
protected double |
add
value of "add" |
protected NodeInitializer[] |
inits
node initializers to apply on the newly added nodes |
protected int |
maxsize
value of "maxsize" |
protected int |
minsize
value of "minsize" |
protected boolean |
substitute
value of "substitute" |
Constructor Summary | |
---|---|
DynamicNetwork(java.lang.String prefix)
Standard constructor that reads the configuration parameters. |
Method Summary | |
---|---|
protected void |
add(int n)
Adds n nodes to the network. |
boolean |
execute()
Calls add(int) or remove(int) with the parameters defined by the
configuration. |
protected void |
remove(int n)
Removes n nodes from the network. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Parameter Detail |
---|
init
control.0 DynamicNetwork control.0.init.0 RandNI control.0.init.0.k 5 control.0.init.0.protocol somelinkable ...
substitute
add
maxsize
minsize
Field Detail |
---|
protected final double add
protected final boolean substitute
protected final int minsize
protected final int maxsize
protected final NodeInitializer[] inits
Constructor Detail |
---|
public DynamicNetwork(java.lang.String prefix)
prefix
- the configuration prefix for this classMethod Detail |
---|
protected void add(int n)
n
- the number of nodes to add, must be non-negative.protected void remove(int n)
Network.remove(int)
.
n
- the number of nodes to removepublic final boolean execute()
add(int)
or remove(int)
with the parameters defined by the
configuration.
execute
in interface Control
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |