mwalk.visitor
Class RandomVisitor
java.lang.Object
|
+--mwalk.visitor.AbstractVisitor
|
+--mwalk.visitor.GlobalVisitor
|
+--mwalk.visitor.RandomVisitor
- Direct Known Subclasses:
- CountVisitor
- public class RandomVisitor
- extends GlobalVisitor
A compund visitor which runs other visitors using a random sampling
of active receivers.
- Version:
- 1.0
- Author:
- Robert Chalmers
Field Summary |
private static java.lang.String |
CFG_BASE
Base of keys in configuration file |
protected int |
incCount
Amount to increment receivers count by |
protected boolean |
increment
Whether to increment the number of receivers on subsequent rounds |
protected ReceiverRandomizer |
rand
Randomizer used select a random set of receivers |
protected int |
receivers
Number of receivers to select |
Method Summary |
boolean |
again(Tree tree)
Determine whether to walk the tree again. |
boolean |
init(Tree tree)
Initialize visitor. |
void |
reset(Tree tree)
Reset the visitor for a new pass over the tree. |
Methods inherited from class mwalk.visitor.GlobalVisitor |
getChildren,
getParents,
getReceivers,
nextReceiver,
postfix,
prefix,
prepare,
visitDown,
visitDown,
visitUp,
visitUp,
walkDown,
walkUp |
Methods inherited from class mwalk.visitor.AbstractVisitor |
cfgBoolean,
cfgInt,
cfgString,
cfgVisitor,
evaluator,
evaluator,
haveSeen,
haveVisited,
markSeen,
markVisited,
verbose |
Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
toString,
wait,
wait,
wait |
CFG_BASE
private static final java.lang.String CFG_BASE
- Base of keys in configuration file
rand
protected ReceiverRandomizer rand
- Randomizer used select a random set of receivers
receivers
protected int receivers
- Number of receivers to select
increment
protected boolean increment
- Whether to increment the number of receivers on subsequent rounds
incCount
protected int incCount
- Amount to increment receivers count by
RandomVisitor
public RandomVisitor()
- Default constructor.
RandomVisitor
public RandomVisitor(int rounds,
boolean increment,
int incCount)
RandomVisitor
public RandomVisitor(DownVisitor dv)
RandomVisitor
public RandomVisitor(DownVisitor dv,
int rounds,
boolean increment,
int incCount)
init
public boolean init(Tree tree)
- Initialize visitor.
- Overrides:
- init in class GlobalVisitor
- Parameters:
Tree
- current tree instance- Returns:
boolean
whether initialization succeeded
reset
public void reset(Tree tree)
- Reset the visitor for a new pass over the tree.
- Overrides:
- reset in class GlobalVisitor
- Parameters:
Tree
- vistited tree
again
public boolean again(Tree tree)
- Determine whether to walk the tree again.
- Overrides:
- again in class GlobalVisitor
- Parameters:
Tree
- current tree instance- Returns:
boolean
whether to walk again
Submit a bug or feature mwalk Platform API Specification 0.3.0
Sensitivity: {Public:Research}
Copyright(c) 2000, Robert Chalmers