planet.results
Class LinkStateResults

java.lang.Object
  extended by planet.results.LinkStateResults

public class LinkStateResults
extends java.lang.Object

LinkStateResults is a class which shows how many incoming messages has been dropped by nodes and how many has been retransmitted towards its destination. It showns the expected number of hops for whatever message to reach its destination. Also classifies the messages according to type and mode of RouteMessageImpl.

Version:
1.0
Author:
Marc Sanchez

Field Summary
protected static java.util.Hashtable flowOfMessages
           
protected static java.util.Hashtable hopsByTypeOf
          LinkStateResults property: stores how many hops per RouteMessage's type and mode.
 
Constructor Summary
LinkStateResults()
           
 
Method Summary
static double getMeanByTypeOf(java.lang.String typeOf, java.lang.String modeOf)
          Gets the average of hops for the Message Performative specified by " typeOf " and " modeOf ".
static double getMeanByTypeOnly(java.lang.String typeOf)
          Gets the average of hops for the Message Performative specified only by the type.
static PatternStatus getStatisticsByTypeOf(java.lang.String typeOf, java.lang.String modeOf)
          Gets the PatternStatus of the Message Performative specified by "TypeOf" and "ModeOf".
static PatternStatus getStatisticsByTypeOnly(java.lang.String typeOf)
          Gets the PatternStatus of the Message Performative specified only by the type.
static void newMessage(RouteMessage msg)
          Stores a new RouteMessage has built up in order to be sent in a few steps.
static void newMessageOnlyByType(RouteMessage msg)
          Stores a new RouteMessage has built up in order to be sent in a few steps.
static void printByNode()
          Prints Link State Results per Node's flow.
static void printByType()
          Prints Link State Results per RouteMessage's type and node.
static void resetLinkState()
          Resets the LinkState results;
static void updateDropped(Id node)
          Stores the number of messages dropped by the node.
static void updateHopsByTypeOf(RouteMessage msg)
          Updates the number of hops per RouteMessage's type and mode.
static void updateHopsByTypeOnly(RouteMessage msg)
          Updates the number of hops per RouteMessage's type only.
static void updateIncoming(Id node)
          Stores the number of incoming messages received by the node.
static void updateOutcoming(Id node)
          Stores the number of outcoming messages sent by the node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hopsByTypeOf

protected static java.util.Hashtable hopsByTypeOf
LinkStateResults property: stores how many hops per RouteMessage's type and mode.


flowOfMessages

protected static java.util.Hashtable flowOfMessages
Constructor Detail

LinkStateResults

public LinkStateResults()
Method Detail

resetLinkState

public static void resetLinkState()
Resets the LinkState results;


updateHopsByTypeOnly

public static void updateHopsByTypeOnly(RouteMessage msg)
Updates the number of hops per RouteMessage's type only.

Parameters:
msg - The RouteMessage taken as input.

updateHopsByTypeOf

public static void updateHopsByTypeOf(RouteMessage msg)
Updates the number of hops per RouteMessage's type and mode.

Parameters:
msg - The RouteMessage taken as input.

newMessageOnlyByType

public static void newMessageOnlyByType(RouteMessage msg)
Stores a new RouteMessage has built up in order to be sent in a few steps.

Parameters:
msg - The RouteMessage taken as input.

newMessage

public static void newMessage(RouteMessage msg)
Stores a new RouteMessage has built up in order to be sent in a few steps.

Parameters:
msg - The RouteMessage taken as input.

updateIncoming

public static void updateIncoming(Id node)
Stores the number of incoming messages received by the node.

Parameters:
node - Node to overhear.

updateOutcoming

public static void updateOutcoming(Id node)
Stores the number of outcoming messages sent by the node.

Parameters:
node - Node to overhear.

updateDropped

public static void updateDropped(Id node)
Stores the number of messages dropped by the node.

Parameters:
node - Node to overhear.

getMeanByTypeOf

public static double getMeanByTypeOf(java.lang.String typeOf,
                                     java.lang.String modeOf)
                              throws NoSuchMessagePerformative
Gets the average of hops for the Message Performative specified by " typeOf " and " modeOf ".

Parameters:
typeOf - Type of the Message.
modeOf - Mode of the Message.
Returns:
Returns the average measured in hops for the current message performative.
Throws:
NoSuchMessagePerformative - Whenever the Message Performative does not match any Message.

getMeanByTypeOnly

public static double getMeanByTypeOnly(java.lang.String typeOf)
                                throws NoSuchMessagePerformative
Gets the average of hops for the Message Performative specified only by the type.

Parameters:
typeOf - Type of the Message.
Returns:
Returns the average measured in hops for the current message performative.
Throws:
NoSuchMessagePerformative - Whenever the Message Performative does not match any Message.

getStatisticsByTypeOf

public static PatternStatus getStatisticsByTypeOf(java.lang.String typeOf,
                                                  java.lang.String modeOf)
                                           throws NoSuchMessagePerformative
Gets the PatternStatus of the Message Performative specified by "TypeOf" and "ModeOf".

Parameters:
typeOf - Type of the Message.
modeOf - Mode of the Message.
Returns:
Return the statistics mapped to this Message Performative.
Throws:
NoSuchMessagePerformative - Whenever the Message Performative does not match any Message.
See Also:
for more details.

getStatisticsByTypeOnly

public static PatternStatus getStatisticsByTypeOnly(java.lang.String typeOf)
                                             throws NoSuchMessagePerformative
Gets the PatternStatus of the Message Performative specified only by the type.

Parameters:
typeOf - Type of the Message.
Returns:
Return the statistics mapped to this Message Performative.
Throws:
NoSuchMessagePerformative - Whenever the Message Performative does not match any Message.

printByType

public static void printByType()
Prints Link State Results per RouteMessage's type and node.


printByNode

public static void printByNode()
Prints Link State Results per Node's flow.