|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpeersim.reports.GraphObserver
public abstract class GraphObserver
Class that provides functionality for observing graphs. It can efficiently create an undirected version of the graph, making sure it is updated only when the simulation has advanced already, and provides some common parameters.
Parameter Summary | |
---|---|
protocol
The protocol to operate on. |
|
undir
If defined, the undirected version of the graph will be analyzed. |
|
undirected
Alias for "undir". |
|
graphobserver.fast
If defined, the undirected version of the graph will be stored using much more memory but observers will be in general a few times faster. |
Field Summary | |
---|---|
protected Graph |
g
|
protected GraphAlgorithms |
ga
|
protected java.lang.String |
name
The name of this observer in the configuration |
protected int |
pid
|
protected boolean |
undir
|
Constructor Summary | |
---|---|
protected |
GraphObserver(java.lang.String name)
Standard constructor that reads the configuration parameters. |
Method Summary | |
---|---|
protected void |
updateGraph()
Sets g . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface peersim.core.Control |
---|
execute |
Parameter Detail |
---|
protocol
undir
undirected
graphobserver.fast
Field Detail |
---|
protected final java.lang.String name
protected final int pid
protected final boolean undir
protected final GraphAlgorithms ga
protected Graph g
Constructor Detail |
---|
protected GraphObserver(java.lang.String name)
name
- the configuration prefix for this classMethod Detail |
---|
protected void updateGraph()
g
.
It MUST be called by any implementation of Control.execute()
before
doing anything else.
Attempts to initialize g
from a
pre-calculated graph stored in a static field, but first it
checks whether it needs to be updated.
If the simulation time has progressed or it was calculated for a different
protocol, then updates this static graph as well.
The purpose of this mechanism is to save the time of constructing the
graph if many observers are run on the same graph. Time savings can be very
significant if the undirected version of the same graph is observed by many
observers.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |