MATES 3.0-rc2

org.mates.sim.models.link
Class GridLinkModel

java.lang.Object
  extended byorg.mates.sim.models.link.QuadraticLinkModel
      extended byorg.mates.sim.models.link.GridLinkModel
All Implemented Interfaces:
LinkModel

public class GridLinkModel
extends QuadraticLinkModel

Link model for a grid. If two hosts are currently on the same row or column of the grid, the QuadraticLinkModel is applied to them, else the hosts are disconnected.

Author:
Evan Sultanik

Constructor Summary
GridLinkModel(Grid grid)
          Default constructor.
 
Method Summary
 double getLinkQuality(Host host1, Host host2)
          Returns the link quality from host1 to host2.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridLinkModel

public GridLinkModel(Grid grid)
Default constructor.

Method Detail

getLinkQuality

public double getLinkQuality(Host host1,
                             Host host2)
Returns the link quality from host1 to host2. If the two hosts are currently on the same row or column of the grid, the QuadraticLinkModel is applied to them. Otherwise, the hosts are disconnected and 0.0 is returned.

Specified by:
getLinkQuality in interface LinkModel
Overrides:
getLinkQuality in class QuadraticLinkModel
Returns:
a double in the range [0, 1] corresponding to the link quality with which host1 can transmit to host2.

MATES 3.0-rc2

Submit a bug or request a feature
http://mates.sourceforge.net/

Copyright 2004 Evan Sultanik