pulling.availability_imposer
Class Node

java.lang.Object
  extended by pulling.availability_imposer.Node
All Implemented Interfaces:
java.io.Serializable

public class Node
extends java.lang.Object
implements java.io.Serializable

This class represents a Node in the Availability node. Every node represents a state of availability for the server.

Author:
Majd Kokaly
See Also:
Serialized Form

Constructor Summary
Node(double aj, java.lang.String description, long periodToStay)
          The default constructor
 
Method Summary
 void addArch(double probability, Node distinatioNode)
          This method is used to add an Arch.
 java.util.LinkedList<Arch> getArchs()
           
 java.lang.String getDescription()
           
 Node getNeighbour(int i)
           
 int getNeighboursNumber()
           
 long getPeriodToStay()
           
 double getPropability(int i)
           
 boolean isSumValid()
          This method checks if the sum of the probabilities of Archs are valid
 void print()
           
 void setArchs(java.util.LinkedList<Arch> archs)
           
 void setDescription(java.lang.String description)
           
 void setPeriodToStay(long periodToStay)
           
 java.lang.String toString()
           
 void visit()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Node

public Node(double aj,
            java.lang.String description,
            long periodToStay)
The default constructor

Parameters:
aj -
description -
periodToStay -
Method Detail

getDescription

public java.lang.String getDescription()

setDescription

public void setDescription(java.lang.String description)

getPeriodToStay

public long getPeriodToStay()

setPeriodToStay

public void setPeriodToStay(long periodToStay)

getArchs

public java.util.LinkedList<Arch> getArchs()

setArchs

public void setArchs(java.util.LinkedList<Arch> archs)

addArch

public void addArch(double probability,
                    Node distinatioNode)
This method is used to add an Arch.

Parameters:
probability - is the probability of the added node.
distinatioNode - is the destination node.

isSumValid

public boolean isSumValid()
This method checks if the sum of the probabilities of Archs are valid

Returns:
true if sum equals one

getNeighboursNumber

public int getNeighboursNumber()
Returns:
the number of Nodes connected to this Node

getNeighbour

public Node getNeighbour(int i)
Parameters:
i - a number
Returns:
returns the ith neighbouring node

getPropability

public double getPropability(int i)
Parameters:
i - a number
Returns:
returns the probability of the arch connecting to the ith neighbouring node

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

visit

public void visit()

print

public void print()