MicroMouse Maze Library  3703225
クラス | 名前空間 | マクロ定義 | 型定義 | 関数 | 変数
Maze.h ファイル

マイクロマウスの迷路を扱うクラスを定義 [詳解]

#include <array>
#include <bitset>
#include <cmath>
#include <cstdint>
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
Maze.h の依存先関係図:
被依存関係図:

[ソースコード]

クラス

class  MazeLib::Direction
 迷路上の方向を表す。 [詳解]
 
struct  MazeLib::Position
 迷路の区画の位置(座標)を定義。 [詳解]
 
struct  MazeLib::Pose
 PositionDirection をまとめた型。位置姿勢。 [詳解]
 
struct  MazeLib::WallIndex
 区画ベースではなく、壁ベースの管理ID [詳解]
 
struct  MazeLib::WallRecord
 区画位置、方向、壁の有無を保持する構造体。 [詳解]
 
class  MazeLib::Maze
 迷路の壁情報を管理するクラス [詳解]
 

名前空間

 MazeLib
 迷路探索ライブラリはすべてこの名前空間に格納されている。
 

マクロ定義

#define MAZE_DEBUG_PROFILING   0
 
#define MAZE_DEBUG_PROFILING_START(id)
 
#define MAZE_DEBUG_PROFILING_END(id)
 
#define C_RE   "\e[31m"
 ANSI Escape Sequence RED [詳解]
 
#define C_GR   "\e[32m"
 ANSI Escape Sequence GREEN [詳解]
 
#define C_YE   "\e[33m"
 ANSI Escape Sequence YELLOW [詳解]
 
#define C_BL   "\e[34m"
 ANSI Escape Sequence BLUE [詳解]
 
#define C_MA   "\e[35m"
 ANSI Escape Sequence MAGENTA [詳解]
 
#define C_CY   "\e[36m"
 ANSI Escape Sequence CYAN [詳解]
 
#define C_NO   "\e[0m"
 ANSI Escape Sequence RESET [詳解]
 
#define MAZE_LOG_LEVEL   4
 ログ出力の選択 [詳解]
 
#define MAZE_LOG_STREAM_BASE(s, l, c)    (s << c "[" l "][" __FILE__ ":" << __LINE__ << "]" C_NO "\t")
 
#define MAZE_LOGE   MAZE_LOG_STREAM_BASE(std::cout, "E", C_RE)
 
#define MAZE_LOGW   MAZE_LOG_STREAM_BASE(std::cout, "W", C_YE)
 
#define MAZE_LOGI   MAZE_LOG_STREAM_BASE(std::cout, "I", C_GR)
 
#define MAZE_LOGD   MAZE_LOG_STREAM_BASE(std::cout, "D", C_BL)
 

型定義

using MazeLib::Directions = std::vector< Direction >
 Direction 構造体の動的配列、集合 [詳解]
 
using MazeLib::Positions = std::vector< Position >
 Position 構造体の動的配列、集合 [詳解]
 
using MazeLib::WallIndexes = std::vector< WallIndex >
 WallIndex の動的配列、集合 [詳解]
 
using MazeLib::WallRecords = std::vector< WallRecord >
 WallRecord 構造体の動的配列の定義 [詳解]
 

関数

std::ostream & MazeLib::operator<< (std::ostream &os, const Directions &obj)
 Directions の stream 表示 [詳解]
 

変数

static constexpr int MazeLib::MAZE_SIZE = 16
 迷路の1辺の区画数の定数。 [詳解]
 
static constexpr int MazeLib::MAZE_SIZE_BIT = std::ceil(std::log2(MAZE_SIZE))
 迷路の1辺の区画数の bit 数。bit shift などに用いる。 [詳解]
 
static constexpr int MazeLib::MAZE_SIZE_MAX = std::pow(2, MAZE_SIZE_BIT)
 迷路の1辺の区画数の最大値。2のbit数乗の値。 [詳解]
 
int x
 区画のx座標 [詳解]
 
int y
 区画のy座標 [詳解]
 
unsigned int d
 壁の方向 [詳解]
 
unsigned int b
 壁の有無 [詳解]
 

詳解

マイクロマウスの迷路を扱うクラスを定義

著者
Ryotaro Onuki kerik.nosp@m.un11.nosp@m.+gith.nosp@m.ub@g.nosp@m.mail..nosp@m.com
日付
2017-10-30

マクロ定義詳解

◆ C_BL

#define C_BL   "\e[34m"

ANSI Escape Sequence BLUE

◆ C_CY

#define C_CY   "\e[36m"

ANSI Escape Sequence CYAN

◆ C_GR

#define C_GR   "\e[32m"

ANSI Escape Sequence GREEN

◆ C_MA

#define C_MA   "\e[35m"

ANSI Escape Sequence MAGENTA

◆ C_NO

#define C_NO   "\e[0m"

ANSI Escape Sequence RESET

◆ C_RE

#define C_RE   "\e[31m"

ANSI Escape Sequence RED

◆ C_YE

#define C_YE   "\e[33m"

ANSI Escape Sequence YELLOW

◆ MAZE_DEBUG_PROFILING

#define MAZE_DEBUG_PROFILING   0

◆ MAZE_DEBUG_PROFILING_END

#define MAZE_DEBUG_PROFILING_END (   id)

◆ MAZE_DEBUG_PROFILING_START

#define MAZE_DEBUG_PROFILING_START (   id)

◆ MAZE_LOG_LEVEL

#define MAZE_LOG_LEVEL   4

ログ出力の選択

0: None, 1: Error, 2: Warn, 3: Info, 4: Debug

◆ MAZE_LOG_STREAM_BASE

#define MAZE_LOG_STREAM_BASE (   s,
  l,
 
)     (s << c "[" l "][" __FILE__ ":" << __LINE__ << "]" C_NO "\t")

◆ MAZE_LOGD

#define MAZE_LOGD   MAZE_LOG_STREAM_BASE(std::cout, "D", C_BL)

◆ MAZE_LOGE

#define MAZE_LOGE   MAZE_LOG_STREAM_BASE(std::cout, "E", C_RE)

◆ MAZE_LOGI

#define MAZE_LOGI   MAZE_LOG_STREAM_BASE(std::cout, "I", C_GR)

◆ MAZE_LOGW

#define MAZE_LOGW   MAZE_LOG_STREAM_BASE(std::cout, "W", C_YE)

変数詳解

◆ b

unsigned int b

壁の有無

◆ d

unsigned int d

壁の方向

◆ x

int x

区画のx座標

◆ y

int y

区画のy座標