Edit cpp files to modify messages between agents according to rule