void EllipsoidalBoundary::process(Candidate *c) const { Vector3d pos = c->current.getPosition(); double d = pos.getDistanceTo(focalPoint1) + pos.getDistanceTo(focalPoint2); if (d >= majorAxis) { reject(c); } if (limitStep) c->limitNextStep(majorAxis - d + margin); }
void MaximumTrajectoryLength::process(Candidate *c) const { double length = c->getTrajectoryLength(); Vector3d position = c->current.getPosition(); if(observerPositions.size()) { bool inRange = false; for (size_t i = 0; i < observerPositions.size(); i++) { double distance = position.getDistanceTo(observerPositions[i]); if (distance + length < maxLength) inRange = true; } if (!inRange) { reject(c); return; } } if (length >= maxLength) { reject(c); } else { c->limitNextStep(maxLength - length); } }