yass.igf
Class BestWorstCandidateChooser

java.lang.Object
  extended by yass.igf.BestWorstCandidateChooser
All Implemented Interfaces:
IgfForwardingCandidateChooser

public class BestWorstCandidateChooser
extends java.lang.Object
implements IgfForwardingCandidateChooser

Examines a set of received CTS packets and decides which, if any, of the CTS packet sending nodes should be selected as a forwarding candidate. Instances of this class always choose the candidate whose CTS packet has the best score, and the candidate whose CTS packet has the worst score.


Field Summary
private static org.apache.log4j.Logger log
          The logger
 
Constructor Summary
BestWorstCandidateChooser()
           
 
Method Summary
 java.util.Set<Node> chooseCandidates(java.util.Set<IgfPacket> ctsPackets)
          Examines a set of received CTS packets and selects the node which sent the CTS packet with the lowest score as the single forwarding candidate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static org.apache.log4j.Logger log
The logger

Constructor Detail

BestWorstCandidateChooser

public BestWorstCandidateChooser()
Method Detail

chooseCandidates

public java.util.Set<Node> chooseCandidates(java.util.Set<IgfPacket> ctsPackets)
Examines a set of received CTS packets and selects the node which sent the CTS packet with the lowest score as the single forwarding candidate. If the set of CTS packets is empty, then no forwarding candidate is selected and the returned set is empty. If the set of CTS packets contains either one or two members, then the nodes corresponding to all received CTS packets are selected and present in the return set. If more than three CTS packets have been received then only those nodes responsible for the CTS packet with the best score, and the worst score, are selected and are present in the return set.

Specified by:
chooseCandidates in interface IgfForwardingCandidateChooser
Parameters:
ctsPackets - the received CTS packets to consider
Returns:
the set of selected forwarding nodes