routing.maxprop
Class MeetingProbabilitySet

java.lang.Object
  extended by routing.maxprop.MeetingProbabilitySet

public class MeetingProbabilitySet
extends java.lang.Object

Class for storing and manipulating the meeting probabilities for the MaxProp router module.


Constructor Summary
MeetingProbabilitySet()
          Constructor.
MeetingProbabilitySet(java.util.List<java.lang.Integer> initiallyKnownNodes)
          Constructor.
 
Method Summary
 java.util.Map<java.lang.Integer,java.lang.Double> getAllProbs()
          Returns a reference to the probability map of this probability set
 double getLastUpdateTime()
          Returns the time when this probability set was last updated
 double getProbFor(java.lang.Integer index)
          Returns the current delivery probability value for the given node index
 MeetingProbabilitySet replicate()
          Returns a deep copy of the probability set
 java.lang.String toString()
          Returns a String presentation of the probabilities
 void updateMeetingProbFor(java.lang.Integer index)
          Updates meeting probability for the given node index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MeetingProbabilitySet

public MeetingProbabilitySet()
Constructor. Creates a probability set with empty node-probability mapping.


MeetingProbabilitySet

public MeetingProbabilitySet(java.util.List<java.lang.Integer> initiallyKnownNodes)
Constructor. Creates a probability set with equal probability for all the given node indexes.

Method Detail

updateMeetingProbFor

public void updateMeetingProbFor(java.lang.Integer index)
Updates meeting probability for the given node index.
 P(b) = P(b)_old + 1
 Normalize{P}
I.e., The probability of the given node index is increased by one and then all the probabilities are normalized so that their sum equals to 1.

Parameters:
index - The node index to update the probability for

getProbFor

public double getProbFor(java.lang.Integer index)
Returns the current delivery probability value for the given node index

Parameters:
index - The index of the node to look the P for
Returns:
the current delivery probability value

getAllProbs

public java.util.Map<java.lang.Integer,java.lang.Double> getAllProbs()
Returns a reference to the probability map of this probability set

Returns:
a reference to the probability map of this probability set

getLastUpdateTime

public double getLastUpdateTime()
Returns the time when this probability set was last updated

Returns:
the time when this probability set was last updated

replicate

public MeetingProbabilitySet replicate()
Returns a deep copy of the probability set

Returns:
a deep copy of the probability set

toString

public java.lang.String toString()
Returns a String presentation of the probabilities

Overrides:
toString in class java.lang.Object
Returns:
a String presentation of the probabilities