|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object peersim.vector.VectAngle
public class VectAngle
Observes the cosine angle between two vectors. The number which is output is the inner product divided by the product of the length of the vectors. All values are converted to double before processing.
This observer class can observe any protocol field containing a primitive value, provided that the field is associated with a getter method that reads it. The methods to be used are specified through parameter "getter1" and "getter2".
Please refer to package peersim.vector
for a detailed description of
this mechanism.
Parameter Summary | |
---|---|
protocol1
The first protocol to be observed. |
|
protocol2
The second protocol to be observed. |
|
getter1
The getter method used to obtain the values of the first protocol. |
|
getter2
The getter method used to obtain the values of the second protocol. |
Constructor Summary | |
---|---|
VectAngle(java.lang.String prefix)
Standard constructor that reads the configuration parameters. |
Method Summary | |
---|---|
boolean |
execute()
Observes the cosine angle between two vectors. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Parameter Detail |
---|
protocol1
protocol2
getter1
getValue
(for backward compatibility with previous
implementation of this class, that were based on the
SingleValue
interface).
Refer to the vector package description for more
information about getters and setters.
getter2
getValue
(for backward compatibility with previous
implementation of this class, that were based on the
SingleValue
interface).
Refer to the vector package description for more
information about getters and setters.
Constructor Detail |
---|
public VectAngle(java.lang.String prefix)
prefix
- the configuration prefix for this classMethod Detail |
---|
public boolean execute()
execute
in interface Control
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |