#include <LateralEuclidianDistanceConnectionPredicate.h>
Public Member Functions | |
LateralEuclidianDistanceConnectionPredicate (double C, double lambd, bool toroid=false, double toroid_off=0.0, int src_shape_x=1, int src_shape_y=1, int dst_shape_x=1, int dst_shape_y=1, double src_scale=1.0, double dst_scale=1.0, double src_center_x=0.0, double src_center_y=0.0, double dst_center_x=0.0, double dst_center_y=0.0) | |
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 /2/ lambda^2 ). |
The connection probability is C * exp( -|pi-pj|^2 /2/ lambda^2 ) where |pi-pj| is the Euclidian distance between the SimObject's locations pi and pj in the x-y plane. Self connections are not made.
Definition at line 25 of file LateralEuclidianDistanceConnectionPredicate.h.
LateralEuclidianDistanceConnectionPredicate::LateralEuclidianDistanceConnectionPredicate | ( | double | C, | |
double | lambd, | |||
bool | toroid = false , |
|||
double | toroid_off = 0.0 , |
|||
int | src_shape_x = 1 , |
|||
int | src_shape_y = 1 , |
|||
int | dst_shape_x = 1 , |
|||
int | dst_shape_y = 1 , |
|||
double | src_scale = 1.0 , |
|||
double | dst_scale = 1.0 , |
|||
double | src_center_x = 0.0 , |
|||
double | src_center_y = 0.0 , |
|||
double | dst_center_x = 0.0 , |
|||
double | dst_center_y = 0.0 | |||
) | [inline] |
Definition at line 28 of file LateralEuclidianDistanceConnectionPredicate.h.
virtual bool LateralEuclidianDistanceConnectionPredicate::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 /2/ lambda^2 ).
Self connections are not made by returning false if ID(src) == ID(dst).
Reimplemented from ConnectionDecisionPredicateSpecialization< SpatialSimObjectPopulation, SpatialSimObjectPopulation >.
Definition at line 62 of file LateralEuclidianDistanceConnectionPredicate.h.
References SimObjectPopulation::getID(), SpatialSimObjectPopulation::getLocation(), ConnectionDecisionPredicateSpecialization< SpatialSimObjectPopulation, SpatialSimObjectPopulation >::m_destinationPopulation, ConnectionDecisionPredicateSpecialization< SpatialSimObjectPopulation, SpatialSimObjectPopulation >::m_sourcePopulation, and Point2DDistance< T >::sqr_distance().