#include <EuclidianDistanceConnectionPredicate.h>
Public Member Functions | |
EuclidianDistanceConnectionPredicate (double C, double lambda) | |
New predicate with given parameters C and lambda. | |
virtual bool | decide (size_t src, size_t dst, RandomEngine *rnd) |
Return true if a uniform distributed random number is smaller than C * exp( -|px-py|^2 / lambda^2 ). |
The connection probability is C * exp( -|px-py|^2 / lambda^2 ) where |px-py| is the Euclidian distance between the SimObject's locations px and py. Self connections are not made.
Definition at line 20 of file EuclidianDistanceConnectionPredicate.h.
EuclidianDistanceConnectionPredicate::EuclidianDistanceConnectionPredicate | ( | double | C, | |
double | lambda | |||
) | [inline] |
New predicate with given parameters C and lambda.
Definition at line 25 of file EuclidianDistanceConnectionPredicate.h.
virtual bool EuclidianDistanceConnectionPredicate::decide | ( | size_t | src, | |
size_t | dst, | |||
RandomEngine * | rnd | |||
) | [inline, virtual] |
Return true if a uniform distributed random number is smaller than C * exp( -|px-py|^2 / lambda^2 ).
Self connections are not made by returning false if ID(src) == ID(dst).
Reimplemented from ConnectionDecisionPredicateSpecialization< SpatialSimObjectPopulation, SpatialSimObjectPopulation >.
Definition at line 33 of file EuclidianDistanceConnectionPredicate.h.
References SimObjectPopulation::getID(), SpatialSimObjectPopulation::getLocation(), ConnectionDecisionPredicateSpecialization< SpatialSimObjectPopulation, SpatialSimObjectPopulation >::m_destinationPopulation, ConnectionDecisionPredicateSpecialization< SpatialSimObjectPopulation, SpatialSimObjectPopulation >::m_sourcePopulation, and sqr_distance().