Knowledge Sharing in Multi-Agent Environments with the Distance-and-Frequency Reinforcement Learning Technique