Dynamic D2D Communication in 5G/6G using a Distributed AI Framework – IEEE