예제 #1
0
  void search()
  {
    if (searched)
      return;
    searched = true;

    Node *start_node = new (node_pool.malloc()) Node(domain.get_start_state(),
                                                     0,
                                                     0);
    domain.compute_heuristic(*start_node);
    goal = idastar_search(start_node);
  }
예제 #2
0
void *VarCommand::operator new(size_t aSize)
{
	return varcommandpool.malloc();
}
예제 #3
0
void SimpleParticle::operator delete(void* block)
{
	particlePool.free(block);
}
예제 #4
0
void *PickupGrantUpdate::operator new(size_t aSize)
{
	return killpool.malloc();
}
예제 #5
0
void *Pickup::operator new(size_t aSize)
{
	return pool.malloc();
}
예제 #6
0
void *Weapon::operator new(size_t aSize)
{
	return pool.malloc();
}
예제 #7
0
  BoundedResult
  cost_bounded_search(Node *start_node,
                      const Cost bound)
  {
    if (start_node->get_state() == domain.get_goal_state()) {
      BoundedResult res(start_node);
      assert(res.is_goal());
      return res;
    }

    std::vector<Node *> succs;
    domain.compute_successors(*start_node, succs, node_pool);

    num_expanded += 1;
    num_generated += succs.size();


#ifdef OUTPUT_SEARCH_PROGRESS
      if (get_num_expanded() % 1000000 == 0) {
        std::cerr << "progress update:" << std::endl;
        std::cerr << get_num_expanded() << " total nodes expanded" << std::endl
                  << get_num_generated() << " total nodes generated" << std::endl;
      }
#endif


    boost::optional<Cost> new_cutoff;
    
    for (unsigned i = 0; i < succs.size(); i += 1) {
      Node *succ = succs[i];

#ifdef IDA_STAR_CYCLE_CHECKING
      if (start_node->is_descendent_of(succ)) {
        node_pool.free(succ);
        continue;
      }
#endif      

      domain.compute_heuristic(*start_node, *succ);

      if (succ->get_f() <= bound) {
        BoundedResult res = cost_bounded_search(succ, bound);
        if (res.is_goal()) {
          assert(!res.is_cutoff());
          assert(!res.is_failure());
          return res;
        }
        else if (res.is_cutoff()) {
          assert(!res.is_goal());
          assert(!res.is_failure());

          if (new_cutoff)
            new_cutoff = std::min(*new_cutoff, res.get_cutoff());
          else
            new_cutoff = res.get_cutoff();
        }
      }
      else {
        if (new_cutoff)
          new_cutoff = std::min(*new_cutoff, succ->get_f());
        else
          new_cutoff = succ->get_f();
      }

      node_pool.free(succ);
    } /* end for */

    if (new_cutoff) {
      BoundedResult res(*new_cutoff);
      assert(res.is_cutoff());
      assert(!res.is_goal());
      assert(!res.is_failure());
      return res;
    }
    else {
      // std::cerr << "returning failure!" << std::endl;
      BoundedResult res;
      assert(res.is_failure());
      assert(!res.is_cutoff());
      assert(!res.is_failure());
      return res;
    }
  }
예제 #8
0
void Collidable::operator delete(void *aPtr)
{
	pool.free(aPtr);
}
예제 #9
0
void VarInteger::operator delete(void *aPtr)
{
	varintegerpool.free(aPtr);
}
예제 #10
0
void *VarInteger::operator new(size_t aSize)
{
	return varintegerpool.malloc();
}
예제 #11
0
void VarCommand::operator delete(void *aPtr)
{
	varcommandpool.free(aPtr);
}
		void destroy(){
			if(Ptr!=NULL)Pool.destroy(Ptr);
			Ptr=NULL;
		}
		~shared_array_memory(){Pool.destroy(Ptr);}
		shared_array_memory(size_type Size_,const T& t_):Ptr(Pool.construct(array_type(Size_,t_))){}
		shared_array_memory():Ptr(Pool.construct()){}
예제 #16
0
void *Spawner::operator new(size_t aSize)
{
	return pool.malloc();
}
예제 #17
0
void Spawner::operator delete(void *aPtr)
{
	pool.free(aPtr);
}
예제 #18
0
void *VarFloat::operator new(size_t aSize)
{
	return varfloatpool.malloc();
}
예제 #19
0
void *Collidable::operator new(size_t aSize)
{
	return pool.malloc();
}
예제 #20
0
void VarFloat::operator delete(void *aPtr)
{
	varfloatpool.free(aPtr);
}
예제 #21
0
void *VarString::operator new(size_t aSize)
{
	return varstringpool.malloc();
}
예제 #22
0
void VarString::operator delete(void *aPtr)
{
	varstringpool.free(aPtr);
}
예제 #23
0
void Weapon::operator delete(void *aPtr)
{
	pool.free(aPtr);
}
예제 #24
0
void *VarScope::operator new(size_t aSize)
{
	return varscopepool.malloc();
}
예제 #25
0
void Pickup::operator delete(void *aPtr)
{
	pool.free(aPtr);
}
예제 #26
0
void VarScope::operator delete(void *aPtr)
{
	varscopepool.free(aPtr);
}
예제 #27
0
void PickupGrantUpdate::operator delete(void *aPtr)
{
	killpool.free(aPtr);
}
예제 #28
0
void* SimpleParticle::operator new(size_t count)
{
	assert(count <= sizeof(SimpleParticle));
	return particlePool.malloc();
}