|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--antsim.impl.PeernetImpl
This is a basic implementation of the Peernet interface. A PeernetImpl
is characterized by a certain size (i.e., the number of nests composing
it) and a degree (i.e., the number of links connecting it to other
nests).
This Peernet
implementation uses the Factory
class to
dynamically instantiate objects implementing Nest; the Factory
instance must be opportunely instructed with an XML definition for Nest
.
Field Summary | |
static String |
PAR_DEGREE
String name of the parameter used to determine the degree of the nodes included in this peernet. |
static String |
PAR_JOINPROB
String name of the parameter used to determine the probability for a node to join the peer network. |
static String |
PAR_LEAVEPROB
String name of the parameter used to determine the probability for a node to leave the peer network. |
static String |
PAR_SIZE
String name of the parameter used to determine the number of nodes included in this peernet. |
Fields inherited from interface antsim.Peernet |
NAME |
Constructor Summary | |
PeernetImpl(Factory factory,
String name)
Initializes a new simulated peer networks. |
Method Summary | |
void |
clear()
Restores the object to its initial state. |
int |
degree()
Returns the initial degree of the simulated p2p network (number of nests) |
void |
executeRound()
Executes a round in each of the nodes constituting the peernet. |
List |
getNests()
Return the nodes composing the simulated p2p network |
int |
size()
Returns the initial size of the simulated p2p network (number of nests) |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String PAR_SIZE
public static final String PAR_DEGREE
public static final String PAR_LEAVEPROB
public static final String PAR_JOINPROB
Constructor Detail |
public PeernetImpl(Factory factory, String name)
factory
- the factory to be used to read configuration arguments
and to create other configurable objectsname
- the name that is associated to this instance in the
configuration fileMethod Detail |
public void clear()
clear
in interface Clearable
public List getNests()
getNests
in interface Peernet
public int size()
size
in interface Peernet
public int degree()
public void executeRound()
executeRound
in interface Peernet
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |