예제 #1
0
void ADPlanner::BuildNewOPENList(ADSearchStateSpace_t* pSearchStateSpace)
{
    ADState *state;
    CKey key;
    CHeap* pheap = pSearchStateSpace->heap;
    CList* pinconslist = pSearchStateSpace->inconslist;

    //move incons into open
    while (pinconslist->firstelement != NULL) {
        state = (ADState*)pinconslist->firstelement->liststate;

        //compute f-value
        key = ComputeKey(state);

        //insert into OPEN
        if (state->heapindex == 0)
            pheap->insertheap(state, key);
        else
            pheap->updateheap(state, key); //should never happen, but sometimes it does - somewhere there is a bug TODO
        //remove from INCONS
        pinconslist->remove(state, AD_INCONS_LIST_ID);
    }

    pSearchStateSpace->bRebuildOpenList = false;
}
예제 #2
0
void ADPlanner::BuildNewOPENList(ADSearchStateSpace_t* pSearchStateSpace)
{
	ADState *state;
	CKey key;
	CHeap* pheap = pSearchStateSpace->heap;
	CList* pinconslist = pSearchStateSpace->inconslist; 
		
	//move incons into open
	while(pinconslist->firstelement != NULL)
	  {
	    state = (ADState*)pinconslist->firstelement->liststate;
	    
	    //compute f-value
		key = ComputeKey(state);
	    
	    //insert into OPEN
	    pheap->insertheap(state, key);
	    //remove from INCONS
	    pinconslist->remove(state, AD_INCONS_LIST_ID);
	  }
}
예제 #3
0
void ARAPlanner::BuildNewOPENList(ARASearchStateSpace_t* pSearchStateSpace)
{
    ARAState *state;
    CKey key;
    CHeap* pheap = pSearchStateSpace->heap;
    CList* pinconslist = pSearchStateSpace->inconslist;

    //move incons into open
    while (pinconslist->firstelement != NULL) {
        state = (ARAState*)pinconslist->firstelement->liststate;

        //compute f-value
        key.key[0] = state->g + (int)(pSearchStateSpace->eps * state->h);
        //key.key[1] = state->h;

        //insert into OPEN
        pheap->insertheap(state, key);
        //remove from INCONS
        pinconslist->remove(state, ARA_INCONS_LIST_ID);
    }
}