SmartScan: An Intelligent Online Scan Sequence Optimization Approach for Uniform Thermal Distribution, Reduced Residual Stresses and Deformations in PBF Additive Manufacturing