#include <SphereConnectionPredicate.h>
Public Member Functions | |
SphereConnectionPredicate (double radius) | |
New prediacte with a given radius. | |
virtual bool | decide (size_t src, size_t dst, RandomEngine *rnd) |
Return true if |px-py| < radius. |
Only connects SimObject's whos locations in space px and py are closer than the given radius. No self connections are made.
Definition at line 21 of file SphereConnectionPredicate.h.
SphereConnectionPredicate::SphereConnectionPredicate | ( | double | radius | ) | [inline] |
virtual bool SphereConnectionPredicate::decide | ( | size_t | src, | |
size_t | dst, | |||
RandomEngine * | rnd | |||
) | [inline, virtual] |
Return true if |px-py| < radius.
Reimplemented from ConnectionDecisionPredicateSpecialization< SpatialSimObjectPopulation, SpatialSimObjectPopulation >.
Definition at line 31 of file SphereConnectionPredicate.h.
References SimObjectPopulation::getID(), SpatialSimObjectPopulation::getLocation(), ConnectionDecisionPredicateSpecialization< SpatialSimObjectPopulation, SpatialSimObjectPopulation >::m_destinationPopulation, ConnectionDecisionPredicateSpecialization< SpatialSimObjectPopulation, SpatialSimObjectPopulation >::m_sourcePopulation, and sqr_distance().