File: PathConstants.h

package info (click to toggle)
spring 88.0%2Bdfsg1-1.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 41,524 kB
  • sloc: cpp: 343,114; ansic: 38,414; python: 12,257; java: 12,203; awk: 5,748; sh: 1,204; xml: 997; perl: 405; objc: 192; makefile: 181; php: 134; sed: 2
file content (54 lines) | stat: -rwxr-xr-x 2,028 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */

#ifndef PATH_CONSTANTS_HDR
#define PATH_CONSTANTS_HDR

#include <limits>
#include "Sim/Misc/GlobalConstants.h"

static const float PATHCOST_INFINITY = std::numeric_limits<float>::infinity();

// NOTE:
//     PF and PE both use a PathNodeBuffer of size MAX_SEARCHED_NODES,
//     thus MAX_SEARCHED_NODES_{PF, PE} MUST be <= MAX_SEARCHED_NODES
static const unsigned int MAX_SEARCHED_NODES    = 65536U;
static const unsigned int MAX_SEARCHED_NODES_PF = MAX_SEARCHED_NODES;
static const unsigned int MAX_SEARCHED_NODES_PE = MAX_SEARCHED_NODES;

// PathManager distance thresholds (to use PF or PE)
const float ESTIMATE_DISTANCE     = 55;
const float MIN_ESTIMATE_DISTANCE = 40;
const float DETAILED_DISTANCE     = 25;
const float MIN_DETAILED_DISTANCE = 12;

const unsigned int PATHESTIMATOR_VERSION = 51;
const unsigned int SQUARES_TO_UPDATE = 600;
const unsigned int MAX_SEARCHED_NODES_ON_REFINE = 2000;


// PE-only flags
const unsigned int PATHDIR_LEFT       = 0; // +x
const unsigned int PATHDIR_LEFT_UP    = 1; // +x+z
const unsigned int PATHDIR_UP         = 2; // +z
const unsigned int PATHDIR_RIGHT_UP   = 3; // -x+z
const unsigned int PATHDIR_RIGHT      = 4; // -x
const unsigned int PATHDIR_RIGHT_DOWN = 5; // -x-z
const unsigned int PATHDIR_DOWN       = 6; // -z
const unsigned int PATHDIR_LEFT_DOWN  = 7; // +x-z

// PF-only flags
const unsigned int PATHOPT_RIGHT     =   1;      //-x
const unsigned int PATHOPT_LEFT      =   2;      //+x
const unsigned int PATHOPT_UP        =   4;      //+z
const unsigned int PATHOPT_DOWN      =   8;      //-z
const unsigned int PATHOPT_DIRECTION = (PATHOPT_RIGHT | PATHOPT_LEFT | PATHOPT_UP | PATHOPT_DOWN);

// PF and PE flags
const unsigned int PATHOPT_START     =  16;
const unsigned int PATHOPT_OPEN      =  32;
const unsigned int PATHOPT_CLOSED    =  64;
const unsigned int PATHOPT_FORBIDDEN = 128;
const unsigned int PATHOPT_BLOCKED   = 256;
const unsigned int PATHOPT_OBSOLETE  = 512;

#endif