コード例 #1
0
ファイル: adplanner.cpp プロジェクト: sgXmachina/sbpl
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
ファイル: adplanner.cpp プロジェクト: janfrs/kwc-ros-pkg
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
ファイル: araplanner.cpp プロジェクト: CNURobotics/sbpl
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);
    }
}