edu.gwu.csd.algorithm
Class GWUTemplate

java.lang.Object
  |
  +--gov.nist.antd.merlin.algorithm.AlgorithmTemplate
        |
        +--edu.gwu.csd.algorithm.GWUTemplate
All Implemented Interfaces:
Algorithm, DMLDump
Direct Known Subclasses:
MapToRing

public abstract class GWUTemplate
extends AlgorithmTemplate

This class is a template that can be used for algorithms that don't work with the OpNet object. For these algorithm, we suppose that all links are bidirectional and there is only one link (multiple fibers are allowed) between 2 nodes.

 This class was developed at the National Institute of Standards and
 Technology by employees of the Federal Government in the course of
 their official duties. Pursuant to title 17 Section 105 of the United
 States Code this software is not subject to copyright protection and
 is in the public domain.
 NIST assumes no responsibility whatsoever for its use by other parties,
 and makes no guarantees, expressed or implied, about its quality,
 reliability, or any other characteristic.
 
We would appreciate acknowledgement if the software is used.
NIST ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION AND DISCLAIM ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.

Author:
borchert
, rouil

Field Summary
protected  java.util.Vector listOfConnections
          Store the list of connections containing the routes.
protected  java.util.Vector parameter
          Store the parameter for the algorithm.
private  boolean preCompute
          Indicates if the algorithm is in phase of precomputation.
private  boolean preComputed
          Inidicates if the algorithm has already been precomputed.
 
Fields inherited from class gov.nist.antd.merlin.algorithm.AlgorithmTemplate
 
Fields inherited from interface gov.nist.antd.optical.algorithm.Algorithm
ROUTING, RWA, UNKNOWN, WAVELENGTH
 
Constructor Summary
GWUTemplate()
           
 
Method Summary
 void config(com.renesys.raceway.DML.Configuration cfg, Glass net)
          Configure the algorithm Additional verbose description.
 void customConfig(com.renesys.raceway.DML.Configuration cfg, Glass net)
          Customized configuration for the algorithm
 java.util.Vector execute(Glass net, java.util.Vector theListOfConnections, java.util.Vector theParameter)
          This method executes the algorithm.
protected  void preComputeAlgorithm(Glass net)
          Starts the algorithm for each link.
protected abstract  int[][] theAlgorithm(int[][] topo, int[][] connections)
          The algorithm must implement this method.
 java.lang.String toDML()
          This method generates the DML representation of this class.
 
Methods inherited from class gov.nist.antd.merlin.algorithm.AlgorithmTemplate
execute, getName, getType, isDebug, setDebug, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

preCompute

private boolean preCompute
Indicates if the algorithm is in phase of precomputation.


preComputed

private boolean preComputed
Inidicates if the algorithm has already been precomputed.


listOfConnections

protected java.util.Vector listOfConnections
Store the list of connections containing the routes.


parameter

protected java.util.Vector parameter
Store the parameter for the algorithm.

Constructor Detail

GWUTemplate

public GWUTemplate()
Method Detail

config

public void config(com.renesys.raceway.DML.Configuration cfg,
                   Glass net)
            throws com.renesys.raceway.DML.configException
Configure the algorithm Additional verbose description.

Specified by:
config in interface Algorithm
Overrides:
config in class AlgorithmTemplate
Parameters:
cfg - description.
net - description.
Throws:
com.renesys.raceway.DML.configException - an configException occured.

preComputeAlgorithm

protected void preComputeAlgorithm(Glass net)
Starts the algorithm for each link.

Parameters:
net - The topology container

execute

public java.util.Vector execute(Glass net,
                                java.util.Vector theListOfConnections,
                                java.util.Vector theParameter)
                         throws AlgorithmException
This method executes the algorithm.

Specified by:
execute in interface Algorithm
Specified by:
execute in class AlgorithmTemplate
Parameters:
net - the topologies network.
theListOfConnections - The vector containing the connections.
theParameter - not used here.
Returns:
The vector containing the result.
Throws:
AlgorithmException - An AlgorithmException occured.

theAlgorithm

protected abstract int[][] theAlgorithm(int[][] topo,
                                        int[][] connections)
The algorithm must implement this method. This method is the startmethod of the algorithm.

Parameters:
topo - An array containing the topology matrix [fromNodeID, toNodeID, linkID].
connections - An array containing the connections [sourceNodeID, destNodeID].
Returns:
An array containing the list of links for each connection.

customConfig

public void customConfig(com.renesys.raceway.DML.Configuration cfg,
                         Glass net)
                  throws com.renesys.raceway.DML.configException
Customized configuration for the algorithm

Parameters:
cfg - The configuration.
net - The OpNet that contains the topology.
Throws:
com.renesys.raceway.DML.configException - an configException occured.

toDML

public java.lang.String toDML()
This method generates the DML representation of this class.

Specified by:
toDML in interface DMLDump
Overrides:
toDML in class AlgorithmTemplate
Returns:
The DML configuration as String