simulation
Class ModelData

java.lang.Object
  extended bysimulation.ModelData

public class ModelData
extends java.lang.Object


Field Summary
private static java.util.LinkedList C2CList
           
private static java.util.LinkedList ComponentList
           
private static java.util.LinkedList H2HLinkList
           
private static java.util.LinkedList HostList
           
 
Constructor Summary
ModelData()
           
 
Method Summary
static void cleanModel()
           
static java.util.LinkedList getC2CList()
           
static java.util.LinkedList getComponentList()
           
static java.util.LinkedList getH2HLinkList()
           
static java.util.LinkedList getHostList()
           
static boolean linkBetweenHosts(int host1_id, int host2_id)
          This is an expensive (n^2!) algorithm for determining wether or not there are components on the given hosts that communicate with each other.
static int searchC2CLink(int componentId1, int componentId2)
          One of two functions that checks to see if a components are linked.
static int searchC2CLink1(int componentId1)
          One of two functions that checks to see if a components are linked.
static ComponentFigure searchComponentList(int componentId)
          Returns the component from the ComponentList with the given component ID number.
static int searchH2HLink(int HostId1, int HostId2)
          This method checks to see if there is a link between two hosts.
static HostFigure searchHostList(int hostId)
          This function returns the HostFigure with the given host ID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HostList

private static java.util.LinkedList HostList

H2HLinkList

private static java.util.LinkedList H2HLinkList

ComponentList

private static java.util.LinkedList ComponentList

C2CList

private static java.util.LinkedList C2CList
Constructor Detail

ModelData

public ModelData()
Method Detail

searchHostList

public static HostFigure searchHostList(int hostId)
This function returns the HostFigure with the given host ID. It gets it from the HostList.

Parameters:
hostId - The ID of the host you want to find.
Returns:
HostFigure with the given hostId or null if host does not exist.

searchH2HLink

public static int searchH2HLink(int HostId1,
                                int HostId2)
This method checks to see if there is a link between two hosts. It sees if there is a link based on the IDs of the two hosts.

Parameters:
HostId1 - The ID of the first Host.
HostId2 - The ID of the second Host.
Returns:
The index of the link if there is a link between the two hosts. -1 if there is no link between the two hosts.

searchComponentList

public static ComponentFigure searchComponentList(int componentId)
Returns the component from the ComponentList with the given component ID number.

Parameters:
componentId - The ID of the component that you want.
Returns:
ComponentFigure with the given ID Or null if this component does not exist.

searchC2CLink1

public static int searchC2CLink1(int componentId1)
One of two functions that checks to see if a components are linked.

Parameters:
componentId1 -
Returns:

searchC2CLink

public static int searchC2CLink(int componentId1,
                                int componentId2)
One of two functions that checks to see if a components are linked.

Parameters:
componentId1 -
componentId2 -
Returns:
int i where i is the location of this C2CLink in its linked list or 0 if this link does not exist.

linkBetweenHosts

public static boolean linkBetweenHosts(int host1_id,
                                       int host2_id)
This is an expensive (n^2!) algorithm for determining wether or not there are components on the given hosts that communicate with each other. This is useful for determining if a imaginary link is needed or not.

Parameters:
host1_id - The ID of the first host.
host2_id - The ID of the seccond host.
Returns:
True if components on each host communicate, false if not. It also returns false if host1_id == host2_id.

getHostList

public static java.util.LinkedList getHostList()

getH2HLinkList

public static java.util.LinkedList getH2HLinkList()

getComponentList

public static java.util.LinkedList getComponentList()

getC2CList

public static java.util.LinkedList getC2CList()

cleanModel

public static void cleanModel()