Text this: Beam Hopping Beam Optimization and Resource Allocation Algorithm Based on Phased Array