Merge pull request #4 from heniancheng/master

merge
totalAgentCount的更新放到了cycle的开始