|
MATES 3.0-rc2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mates.sim.models.link.QuadraticLinkModel
A link model that defines link quality in an inverse exponential relationship with the Euclidean distance between hosts.
Constructor Summary | |
QuadraticLinkModel()
Default constructor. |
Method Summary | |
double |
getLinkQuality(Host host1,
Host host2)
Determines the link quality of the directed connection between two hosts. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public QuadraticLinkModel()
Method Detail |
public double getLinkQuality(Host host1, Host host2)
Position.distanceTo(org.mates.util.Position)
,
which is usually implemented as a function of the euclidean
distance between the hosts and the radio range of
host1
.
Note that getLinkQuality(host1, host2) ==
getLinkQuality(host2, host1)
if and only if
host1.getRadioRange() == host2.getRadioRange()
or
if the hosts are not communicable.
When both hosts are using Position2D
,
the general formula used for calculating link quality is as
follows:
((host1
's radio range)2 - (euclidean distance between the hosts)2) / (host1
's radio range)2
This function always returns a link quality of 0.0 if
host1 == host2
.
getLinkQuality
in interface LinkModel
[0, 1]
corresponding
to the link quality with which host1
can transmit
to host2
.
|
MATES 3.0-rc2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |