| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- #include "StdAfx.h"
- #include "StrategyLoop.h"
- #include "Agent.h"
- #include "AgentGroup.h"
- CStrategyLoop::CStrategyLoop(void) : m_Index(0)
- {
- }
- CStrategyLoop::~CStrategyLoop(void)
- {
- }
- /*****************************************************************
- **【函数名称】 _locateAgent
- **【函数功能】 得到当前排队策略下可用座席
- **【参数】
- **【返回值】
- ****************************************************************/
- CAgent* CStrategyLoop::_locateAgent( CAgentGroup& AgentGroup )
- {
- CAgent* pAgent = NULL;
- bool t_b_has_jump = false;
- pAgent = AgentGroup.GetFreeAgentForLoop();
- return pAgent;
- /*
- for(int i=0; i<AgentGroup.GetCount(); ++i) // 保证遍历一轮
- {
- if(m_Index >= AgentGroup.GetCount())
- m_Index = 0;
- pAgent = AgentGroup[m_Index++];
- if (pAgent->queueJump()) {
- t_b_has_jump = true;
- continue;
- }
- if(pAgent->isFree())
- return pAgent;
- } // end if
- if (t_b_has_jump == true) {
- for (int i = 0; i<AgentGroup.GetCount(); ++i) // 保证遍历一轮
- {
- if (m_Index >= AgentGroup.GetCount())
- m_Index = 0;
- pAgent = AgentGroup[m_Index++];
- if (pAgent->isFree())
- return pAgent;
- } // end if
- }
- return NULL;
- */
- }
|