@@ -36,24 +36,15 @@ using namespace GraphEngineSpace;
36
36
class CGraphEngine
37
37
{
38
38
public:
39
- #ifndef AI_COMPILER
40
- using CSolverPriorityQueue = CDataStorageBinaryHeap;
41
- using CStringPriorityQueue = CDataStorageBinaryHeap;
42
- #endif
43
- using CPriorityQueue = CDataStorageBucketList<u32 , u32 , 8 *1024 , false >;
44
- using CVertexManager = CVertexManagerFixed<u32 , u32 , 8 >;
45
-
46
- #ifndef AI_COMPILER
47
- using CSolverVertexManager = CVertexManagerHashFixed<u32 , _solver_index_type, 256 , 8 *1024 >;
48
- using CStringVertexManager = CVertexManagerHashFixed<u32 , shared_str, 128 , 1024 >;
49
- #endif
39
+ // common algorithm
40
+ using CPriorityQueue = CDataStorageBucketList<u32 , u32 , 8 *1024 , false >;
41
+ using CVertexManager = CVertexManagerFixed<u32 , u32 , 8 >;
50
42
#ifdef AI_COMPILER
51
- using CVertexAllocator = CVertexAllocatorFixed< 2 *1024 *1024 > ;
43
+ static const size_t VertexAllocatorReserve = 2 *1024 *1024 ;
52
44
#else
53
- using CVertexAllocator = CVertexAllocatorFixed<64 *1024 >;
54
- using CSolverVertexAllocator = CVertexAllocatorFixed<8 *1024 >;
55
- using CStringVertexAllocator = CVertexAllocatorFixed<1024 >;
45
+ static const size_t VertexAllocatorReserve = 64 *1024 ;
56
46
#endif
47
+ using CVertexAllocator = CVertexAllocatorFixed<VertexAllocatorReserve>;
57
48
using AlgorithmStorage = CVertexPath<true >;
58
49
using CAlgorithm = CAStar<
59
50
_dist_type,
@@ -62,21 +53,28 @@ class CGraphEngine
62
53
CVertexAllocator,
63
54
true ,
64
55
AlgorithmStorage>;
65
-
56
+
66
57
#ifndef AI_COMPILER
58
+ // solver algorithm
59
+ using CSolverPriorityQueue = CDataStorageBinaryHeap;
60
+ using CSolverVertexManager = CVertexManagerHashFixed<u32 , _solver_index_type, 256 , 8 *1024 >;
61
+ using CSolverVertexAllocator = CVertexAllocatorFixed<8 *1024 >;
67
62
using SolverAlgorithmStorage = CEdgePath<_solver_edge_type, true >;
68
- using CSolverAlgorithm = CAStar<
69
- _solver_dist_type,
70
- CSolverPriorityQueue,
71
- CSolverVertexManager,
72
- CSolverVertexAllocator,
73
- true ,
63
+ using CSolverAlgorithm = CAStar<
64
+ _solver_dist_type,
65
+ CSolverPriorityQueue,
66
+ CSolverVertexManager,
67
+ CSolverVertexAllocator,
68
+ true ,
74
69
SolverAlgorithmStorage>;
75
-
76
- using _string_dist_type = float ;
70
+ // string algorithm
71
+ using CStringPriorityQueue = CDataStorageBinaryHeap;
72
+ using CStringVertexManager = CVertexManagerHashFixed<u32 , shared_str, 128 , 1024 >;
73
+ using CStringVertexAllocator = CVertexAllocatorFixed<1024 >;
77
74
using StringAlgorithmStorage = AlgorithmStorage;
75
+ using StringAlgorithmDistance = float ;
78
76
using CStringAlgorithm = CAStar<
79
- _string_dist_type ,
77
+ StringAlgorithmDistance ,
80
78
CStringPriorityQueue,
81
79
CStringVertexManager,
82
80
CStringVertexAllocator,
0 commit comments