Esempio n. 1
0
void ExecPrinter::VerbosePrint(IChessExecution* exec){
	allExecs << "==========Exec " << numExecs << "========================\n";
	allExecs << *exec << std::endl;

	//allExecs << "Strategy States \n";
	//for(size_t sid = 0; sid <= exec->NumTransitions(); sid++){
	//	allExecs << "[" << sid << "]" << Chess::GetStrategy()->DebugState(sid) << "\n";
	//}
	allExecs.flush();

	if(false){
		size_t n = 0;
		if(edges.size() == 0){
			edges.push_back(stdext::hash_map<Task, size_t>());
			OnNewNode(n, 0, exec);
		}

		for(size_t i = 0; i<exec->NumTransitions(); i++){
			ChessTransition curr = exec->Transition(i);
			if(edges[n].find(curr.tid) == edges[n].end()){
				size_t s = edges.size();
				edges.push_back(stdext::hash_map<Task, size_t>());
				OnNewNode(s, i+1, exec);
				edges[n][curr.tid] = s;
				OnNewEdge(n,s,i,exec);
			}
			n = edges[n][curr.tid];
		}
		fileStream << n << "->\"ex"<<numExecs << "\";" << std::endl;
		fileStream.flush();
	}
}
Esempio n. 2
0
ListNode * List::AddTail(Object *ptr)
{
    ListNode *n = OnNewNode();
    ListNode *c = NULL;
    n->m_pCurrent=ptr;
    if(m_pHead == NULL)
    {
        m_pHead = n;
    }
    c = m_pTail;
    m_pTail=n;
    m_pTail->m_pPast = c;
    if(c != NULL)
    {
        c->m_pNext = m_pTail;
    }
    if(m_bContainer)
        Sort();
    m_count++;
    return n;
}
Esempio n. 3
0
ListNode * List::AddHead(ListNode **n, Object *ptr)
{
    ListNode *c = NULL;
    if(*n == NULL)
        *n = OnNewNode();
    (*n)->m_pCurrent=ptr;
    if(m_pTail == NULL)
    {
        m_pTail = *n;
    }
    c = m_pHead;
    m_pHead=*n;
    m_pHead->m_pNext = c;
    if(c != NULL)
    {
        c->m_pPast = m_pHead;
    }
    if(m_bContainer)
        Sort();
    m_count++;
    return *n;
}
Esempio n. 4
0
ListNode * List::AddHead(Object *ptr)
{
    ListNode *n = OnNewNode();
    AddHead(&n,ptr);
    return n;
}