gov.nist.antd.merlin.protocol.protectionlink
Class BackupLink

java.lang.Object
  |
  +--gov.nist.antd.merlin.algorithm.AlgorithmTemplate
        |
        +--gov.nist.antd.merlin.protocol.protectionlink.BackupLink
All Implemented Interfaces:
Algorithm, DMLDump

public class BackupLink
extends AlgorithmTemplate

This class implements a route computation for link protection only. The given route requests must be point-to-point connections. The algorithm will compute an alternative backup to these given link.

 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.

Version:
1.6

 VERSION CONTROL
 -------------------------------------------------------------------------
 Name     - YYYY/MM/DD - VERSION - ACTION
 rouil    - 2001/07/11 - 1.0     - Source created.
 rouil    - 2001/07/23 - 1.1     - Use new structure to store backup.
 borchert - 2002/01/29 - 1.2     - Added the algorithm type.  
                                 - Updated documentation.
 rouil    - 2002/01/29           - Updated import files.
 rouil    - 2002/02/14           - Complete documentation.
 borchert - 2002/04/25 - 1.3     - Chenged reference from OpNet to Glass.
 borchert - 2002/06/06 - 1.4     - Changed Reference from OpticalRoute to 
                                   OpticalConnection
 rouil    - 2002/06/21 - 1.5     - Extended the OXCEdgeRouter to ExtRouter
 rouil    - 2002/09/25 - 1.6     - Use NHI instead of ID 
 

Author:
borchert
, rouil

Field Summary
private  java.util.Vector backups
          Vector of backup route.
private  LinkGraph graph
          The graph of the net
private  java.lang.String name
          The name of the algorithm
 
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
BackupLink()
          Default constructor
 
Method Summary
 void buildPath(Vertex source, Vertex dest, java.util.Vector v, java.util.Vector srlg)
          Recursive routine to build path to dest after running shortest path algorithm.
 void config(com.renesys.raceway.DML.Configuration cfg, Glass net)
          Configure the Centralized Algorithm.
 void dijkstra(java.lang.String startNhi, java.util.Vector srlg)
          The Dijktra's algorithm.
 java.lang.Object[] execute(Glass net, OpticalConnection[] routes, java.lang.Object[] parameter)
          This method executes the algorithm in the synchronized mode.
 java.util.Vector execute(Glass net, java.util.Vector routes, java.util.Vector parameter)
          This method executes the algorithm in the synchronized mode.
private  double getCost(Edge edge, java.lang.String fromHost, java.util.Vector srlg)
          Get the cost of the given edge.
 byte getType()
          this algorithm is a routing algorithm for a given link.
 void processBackup(OpticalConnection oRoute)
          Process a backup request
 OpticalConnection processRequest(OpticalConnection oRoute)
          Process a request.
 java.lang.String toDML()
          This method generates the DML representation of this class.
 
Methods inherited from class gov.nist.antd.merlin.algorithm.AlgorithmTemplate
getName, isDebug, setDebug, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

graph

private LinkGraph graph
The graph of the net


name

private java.lang.String name
The name of the algorithm


backups

private java.util.Vector backups
Vector of backup route.

Constructor Detail

BackupLink

public BackupLink()
Default constructor

Method Detail

dijkstra

public void dijkstra(java.lang.String startNhi,
                     java.util.Vector srlg)
The Dijktra's algorithm. The cost of an edge is the distance of the link

Parameters:
startNhi - the NHI of the node the diekstra has to start from.
srlg - The vector of SRLG we don't want to include in the path

getCost

private double getCost(Edge edge,
                       java.lang.String fromHost,
                       java.util.Vector srlg)
Get the cost of the given edge. The cost contains the distance. Is the link down, link in protection, or the bandwith < the distance the result will be a cost of == Double.POSITIVE_INFINITY; and the bandwidth == 0.0;

Parameters:
edge - The edge.
fromHost - The source node.
srlg - The Vector of SRLG that must not appear in the path.
Returns:
A double value containing the distance.

buildPath

public void buildPath(Vertex source,
                      Vertex dest,
                      java.util.Vector v,
                      java.util.Vector srlg)
Recursive routine to build path to dest after running shortest path algorithm. The path is known to exist.

Parameters:
source - The source vertex.
dest - The destination vertex
v - The vector where the path is stored.
srlg - The srlg of the path

processBackup

public void processBackup(OpticalConnection oRoute)
Process a backup request

Parameters:
oRoute - The connection Request

processRequest

public OpticalConnection processRequest(OpticalConnection oRoute)
Process a request. It will try to use a backup route

Parameters:
oRoute - The connection Request
Returns:
The backup or the parameter if no backup found

execute

public java.util.Vector execute(Glass net,
                                java.util.Vector routes,
                                java.util.Vector parameter)
                         throws AlgorithmException
This method executes the algorithm in the synchronized mode. The nodes in each given route request must be next to each other (point to point connection). The computed route is an alternative route to this ptp connection only.

Specified by:
execute in interface Algorithm
Specified by:
execute in class AlgorithmTemplate
Parameters:
net - The OpNet that contains the topology.
routes - The vector containing the OpticalConnection objects. These objects must not have an owner.
parameter - not used by this algorithm.
Returns:
The route vector containing the objects of OpticalRoutes with the calculated linklist.
Throws:
AlgorithmException - An AlgorithmException occured.

execute

public java.lang.Object[] execute(Glass net,
                                  OpticalConnection[] routes,
                                  java.lang.Object[] parameter)
                           throws AlgorithmException
This method executes the algorithm in the synchronized mode. The nodes in each given route request must be next to each other (point to point connection). The computed route is an alternative route to this ptp connection only.

Specified by:
execute in interface Algorithm
Overrides:
execute in class AlgorithmTemplate
Parameters:
net - The OpNet that contains the topology.
routes - The array of OpticalRoutes to compute.
parameter - The array of objects containing the parameters for the algorithm.
Returns:
The array of objects containing the result.
Throws:
AlgorithmException - An AlgorithmException occured.

config

public void config(com.renesys.raceway.DML.Configuration cfg,
                   Glass net)
            throws com.renesys.raceway.DML.configException
Configure the Centralized Algorithm.

Specified by:
config in interface Algorithm
Overrides:
config in class AlgorithmTemplate
Parameters:
cfg - configuration
net - The OpNet that contains the topology.
Throws:
com.renesys.raceway.DML.configException - when a configuration exception occurs.

toDML

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

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

getType

public byte getType()
this algorithm is a routing algorithm for a given link.

Specified by:
getType in interface Algorithm
Overrides:
getType in class AlgorithmTemplate
Returns:
description.
Since:
1.2