Class NetworkManager

java.lang.Object
  extended by NetworkManager

public class NetworkManager
extends java.lang.Object

The NetworkManager class is responsible for instantiating a network instance. It also initializes the StatisticalData class to re-establish its variables. This class also initializes the configuration parameters in the IConstants class by the input parameters in the system retrieve from the input file.

The NetworkManager class implements the Singleton Design Pattern.

Version:
1.0

Field Summary
private static int curSet
          Keeps track of the current simulating network to read the relevant input parameters.
private static HelpingUtility helpUtility
          An instance of the HelpingUtility class to re-initialize the random seed and read the input file.
private static NetworkManager netManager
          An static instance of the NetworkManager class which is useful for the implementation of Singleton design pattern.
private static Network network
          An instance of the Network class to refer to the current simulating network.
private static java.lang.String paramFile
          Name of the input configuration file.
private static StatisticalData statData
          An instance of the StatisticalData class to perform the related statistical computations.
private static double warm_up_percentage
          Default percentage of warm_up_cycles to that of total simulation cycles.
 
Constructor Summary
NetworkManager(java.lang.String parameterFile)
          Constructor of the NetworkManager class.
 
Method Summary
 boolean createNextNetwork()
          Creates a Network class instance and loads the related configuration parameters in the IConstants class.
static HelpingUtility getHelpingUtility()
          Returns the helpUtility variable of this class.
static NetworkManager getInstance()
          Returns a NetworkManager class instance, if not already defined.
static NetworkManager getInstance(java.lang.String paramFile)
          Returns a NetworkManager class instance, if not already defined.
static Network getNetworkInstance()
          Returns the network variable of this class.
static StatisticalData getStatDataInstance()
          Returns the statData variable of this class.
 void initializeNetwork()
          Initializes the current simulating network and the statistical counters.
private  void loadSet(java.util.Vector set)
          Loads the configuration parameters in the IConstants class for the current simulating network.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

netManager

private static NetworkManager netManager
An static instance of the NetworkManager class which is useful for the implementation of Singleton design pattern.


network

private static Network network
An instance of the Network class to refer to the current simulating network.


statData

private static StatisticalData statData
An instance of the StatisticalData class to perform the related statistical computations.


helpUtility

private static HelpingUtility helpUtility
An instance of the HelpingUtility class to re-initialize the random seed and read the input file.


curSet

private static int curSet
Keeps track of the current simulating network to read the relevant input parameters.


paramFile

private static java.lang.String paramFile
Name of the input configuration file.


warm_up_percentage

private static double warm_up_percentage
Default percentage of warm_up_cycles to that of total simulation cycles.

Constructor Detail

NetworkManager

public NetworkManager(java.lang.String parameterFile)
Constructor of the NetworkManager class. Initializes the HelpingUtility class and invokes its pertinent method read parameters from the input file.

Parameters:
parameterFile - Name of the input configuration file
See Also:
HelpingUtility
Method Detail

createNextNetwork

public boolean createNextNetwork()
Creates a Network class instance and loads the related configuration parameters in the IConstants class. It also re-initializes the StatisticalData class.

Returns:
true if a Network class instance is created, false otherwise.
See Also:
IConstants, HelpingUtility, Network, StatisticalData

initializeNetwork

public void initializeNetwork()
Initializes the current simulating network and the statistical counters.

See Also:
Network, StatisticalData

loadSet

private void loadSet(java.util.Vector set)
Loads the configuration parameters in the IConstants class for the current simulating network.

Parameters:
set - total set of pairs of input parameter and its value

getInstance

public static NetworkManager getInstance(java.lang.String paramFile)
Returns a NetworkManager class instance, if not already defined. Otherwise, returns the previously defined object.

Parameters:
paramFile - name of the input configuration file
Returns:
an instance of the NetworkManager class

getInstance

public static NetworkManager getInstance()
Returns a NetworkManager class instance, if not already defined. Otherwise, returns the previously defined object.

Returns:
an instance of the NetworkManager class

getNetworkInstance

public static Network getNetworkInstance()
Returns the network variable of this class. 'network' is an instance of the Network class.

Returns:
reference to the current simulating network

getHelpingUtility

public static HelpingUtility getHelpingUtility()
Returns the helpUtility variable of this class. 'helpUtility' is an instance of the HelpingUtility class.

Returns:
instance of the HelpingUtility class
See Also:
HelpingUtility

getStatDataInstance

public static StatisticalData getStatDataInstance()
Returns the statData variable of this class. 'statData' is an instance of the StatisticalData class

Returns:
instance of the StatisticalData class
See Also:
StatisticalData