|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--gov.nist.antd.merlin.algorithm.AlgorithmTemplate
|
+--gov.nist.antd.merlin.algorithm.wavelength.bestfit.BestFit
This class computes the channels of lambdas for an optical route, according to a best fit philosophy.
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.
| Field Summary | |
(package private) double[] |
allBwVals
an array of all possible bandwidth values for the current optical route. |
(package private) OpticalConnection |
currentRoute
pointer to the oRoute associated w/ this path |
(package private) double |
maxGig
the maximum bandwidth value present in the current oRoute |
(package private) double |
minGig
the minimum bandwidth value present in the current oRoute |
(package private) ONIC[] |
onics
array of onics in the optical path |
(package private) double |
reqGig
desired bandwidth of the oPath |
| 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 | |
BestFit()
Default constructor |
|
| Method Summary | |
private boolean |
checkLam(Lambda lambda,
double gig)
utility function for findWavelength(), checks if the lambda can be included |
private void |
clear(java.util.LinkedList list)
utility function to make the lambdas in the channels list available again. |
java.lang.Object[] |
execute(Glass net,
OpticalConnection[] routes,
java.lang.Object[] parameter)
this function executes the algorithm |
java.util.Vector |
execute(Glass net,
java.util.Vector routes,
java.util.Vector parameter)
this function executes the algorithm |
Lambda |
find(double gig,
Fiber[] fibs,
double waveLength)
find a lamda w/ |
private double[] |
findAllBw()
utility function to return an array of all bandwidth values in the current optical Route |
private double |
findNearestBw(double currentGig,
boolean includeBounds)
utility function to find the bandwidth value closest to but less than the parameter value |
private double |
findNearestGreaterBw(double currentGig)
utility function to find the bandwidth value > the parameter value closest to the parameter value |
int |
findWavelength(double gig,
int index,
Lambda[] channel,
boolean atStart)
(recursive)find a path through hosts where converter==false, where the bandwidth same as gig |
Lambda[] |
getChannel(double gig)
get a channel from this opticalPath that has bandwidth gig. |
private ExtRouter |
getHost(ONIC o)
utility fuction to get the host of an onic |
ONIC[] |
getOnics(java.util.Vector links)
return an array of onics that contain all of the onics who are the source of the outgoing fibers in the vector of links that make up the oPath. |
byte |
getType()
Retruns the type of wavelength. |
(package private) void |
makePath(OpticalPath path)
this function, called from execute(), does the work of creating the channels for each optical route |
static void |
print(java.lang.Object o)
utility to make printing to System.out easier |
static void |
println(java.lang.Object o)
utility to make printing to System.out easier |
void |
recMake(java.util.LinkedList channels,
double currentGig)
recMake recursively populates a linked list with optical channels. |
java.lang.String |
toDML()
This method generates the DML representation of this class. |
| Methods inherited from class gov.nist.antd.merlin.algorithm.AlgorithmTemplate |
config, getName, isDebug, setDebug, setName |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
ONIC[] onics
double reqGig
double[] allBwVals
double minGig
double maxGig
OpticalConnection currentRoute
| Constructor Detail |
public BestFit()
| Method Detail |
public java.util.Vector execute(Glass net,
java.util.Vector routes,
java.util.Vector parameter)
throws AlgorithmException
execute in interface Algorithmexecute in class AlgorithmTemplatenet - The OpNet that contains the topology.routes - The vector of potential routes.parameter - The vector of objects containing the parameters for the
algorithm
AlgorithmException
public java.lang.Object[] execute(Glass net,
OpticalConnection[] routes,
java.lang.Object[] parameter)
throws AlgorithmException
execute in interface Algorithmexecute in class AlgorithmTemplatenet - The OpNet that contains the topology.routes - The array of potential Optical Routes.parameter - The array of objects containing the parameters for the
algorithm
AlgorithmException
void makePath(OpticalPath path)
throws AlgorithmException
path - the path associated w/ the route passed in from execute()
AlgorithmExceptionpublic ONIC[] getOnics(java.util.Vector links)
links - vector of links from opticalPath
public void recMake(java.util.LinkedList channels,
double currentGig)
channels - list where channels will be storedcurrentGig - the current bandwidth to be searched forprivate void clear(java.util.LinkedList list)
list - list of Lambda[], channels that can not be used.private double[] findAllBw()
private double findNearestBw(double currentGig,
boolean includeBounds)
currentGig - value to search forincludeBounds - true if you want a value equal
to the currentGig, false if you want a value strictly
less than currentGig.
private double findNearestGreaterBw(double currentGig)
currentGig - value to search for
public Lambda[] getChannel(double gig)
gig - The requested bandwidth
public Lambda find(double gig,
Fiber[] fibs,
double waveLength)
gig - requested bandwidthfibs - outgoing fibers to searchwaveLength - The wavelength that will be a search criterion for
a suitable lambda.
public int findWavelength(double gig,
int index,
Lambda[] channel,
boolean atStart)
gig - requested bandwidthindex - current index in onics[]channel - the current channel being constructedatStart - true on first call, false otherwise
private boolean checkLam(Lambda lambda,
double gig)
lambda - The Lambda to be checkedgig - bandwidth that the lambda must be
private ExtRouter getHost(ONIC o)
o - onic whose host is desired
public static void println(java.lang.Object o)
o - object to be printedpublic static void print(java.lang.Object o)
o - object to be printedpublic java.lang.String toDML()
toDML in interface DMLDumptoDML in class AlgorithmTemplatepublic final byte getType()
getType in interface AlgorithmgetType in class AlgorithmTemplate
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||