edu.usc.cse.desi.viewers
Class LatencyCalculator

java.lang.Object
  extended byedu.usc.cse.desi.viewers.AbstractCalculator
      extended byedu.usc.cse.desi.viewers.LatencyCalculator
All Implemented Interfaces:
java.util.EventListener, java.beans.PropertyChangeListener

public class LatencyCalculator
extends AbstractCalculator

This calculator will calculate the overall availability of the system based on the following formula: SumOverAllComps(SumOverAllComps(FREQ* (DELAY + EVTSIZE/BW) ))/SumOverAllComps(Freq)

Author:
NeLs Started on Nov 4, 2004

Field Summary
 
Fields inherited from class edu.usc.cse.desi.viewers.AbstractCalculator
myLabel, myModel
 
Constructor Summary
LatencyCalculator(DESIViewModel model, org.eclipse.swt.widgets.Label label)
           
 
Method Summary
protected  void addThisAsAListenerToModel()
          Add this as a listener to the model.
protected  void calculate()
          Here's where we calculate the availability and print it to the label.
static double calculateLatency(DESIViewModel model)
          This is a static method that can be used at any time to calculate the latency of a system.
 void propertyChange(java.beans.PropertyChangeEvent arg0)
          When properties change, we have to re-calculate the availability.
protected  void removeThisAsAListenerFromModel()
          I overrode this method:
 
Methods inherited from class edu.usc.cse.desi.viewers.AbstractCalculator
finalize, modelChanged, setMyLabelText
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LatencyCalculator

public LatencyCalculator(DESIViewModel model,
                         org.eclipse.swt.widgets.Label label)
Parameters:
model -
label -
Method Detail

addThisAsAListenerToModel

protected void addThisAsAListenerToModel()
Add this as a listener to the model. I overrode this method:

Specified by:
addThisAsAListenerToModel in class AbstractCalculator
See Also:
AbstractCalculator.addThisAsAListenerToModel()

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent arg0)
When properties change, we have to re-calculate the availability. I overrode this method:

See Also:
PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)

calculateLatency

public static double calculateLatency(DESIViewModel model)
This is a static method that can be used at any time to calculate the latency of a system.

Parameters:
model -
Returns:

calculate

protected void calculate()
Here's where we calculate the availability and print it to the label. I overrode this method:

Specified by:
calculate in class AbstractCalculator
See Also:
AbstractCalculator.calculate()

removeThisAsAListenerFromModel

protected void removeThisAsAListenerFromModel()
I overrode this method:

Specified by:
removeThisAsAListenerFromModel in class AbstractCalculator
See Also:
AbstractCalculator.removeThisAsAListenerFromModel()