Algorithms of agent based systems synchronization