Self-optimizing Approach for the Alignment of Optical Components