MATES 3.0-rc2

org.mates.sim.models.link
Class TemporalLinkModel

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

public class TemporalLinkModel
extends java.lang.Object
implements LinkModel

A link model that defines link quality as a function of time. Link quality rules are added using the setLinkQuality(org.mates.sim.Host, org.mates.sim.Host, double, long) function. This is useful when the link quality is not a function of the mobility model. For example, say one has a log file containing real-world network connectivity data; one would add a new temporal link quality rule for each change in the topology in the file.

Author:
Evan Sultanik

Constructor Summary
TemporalLinkModel()
          Default constructor.
 
Method Summary
 void clearLinkQualities()
          Resets all link quality rules such that the link quality between all hosts is always 0.
 double getLinkQuality(Host host1, Host host2)
          This function should return a real number in the range from 0.0 to 1.0, where 1.0 is a link of maximum quality.
 double getLinkQuality(Host fromHost, Host toHost, long atTime)
          Returns the link quality between fromHost and toHost at time atTime.
 void setLinkQuality(Host fromHost, Host toHost, double quality, long startTime)
          Records the link quality between hosts starting at a specific time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemporalLinkModel

public TemporalLinkModel()
Default constructor.

Method Detail

setLinkQuality

public void setLinkQuality(Host fromHost,
                           Host toHost,
                           double quality,
                           long startTime)
Records the link quality between hosts starting at a specific time. The link quality will remain the same until either the end of the experiment or until another rule is added. If a link quality already exists at startTime, the preexisting quality will be overridden.


clearLinkQualities

public void clearLinkQualities()
Resets all link quality rules such that the link quality between all hosts is always 0.


getLinkQuality

public double getLinkQuality(Host fromHost,
                             Host toHost,
                             long atTime)
Returns the link quality between fromHost and toHost at time atTime.


getLinkQuality

public double getLinkQuality(Host host1,
                             Host host2)
Description copied from interface: LinkModel
This function should return a real number in the range from 0.0 to 1.0, where 1.0 is a link of maximum quality.

Specified by:
getLinkQuality in interface LinkModel

MATES 3.0-rc2

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

Copyright 2004 Evan Sultanik