|
DigitalCurling3
1.0.0
A curling simulation system for curling AIs
|
Digital Curling ライブラリはこの名前空間の中に定義されます More...
Namespaces | |
| coordinate | |
| 座標変換に関連するものを定義する名前空間 | |
| moves | |
| ApplyMove() に渡す行動を定義する名前空間 | |
| players | |
| IPlayerFactory を継承したクラスを定義する名前空間 | |
| polymorphic_json | |
| インターフェースを介したJSON変換を行うためのものを定義する名前空間 | |
| simulators | |
| ISimulatorFactory を継承したクラスを定義する名前空間 | |
Classes | |
| struct | ApplyMoveResult |
| ApplyMove() の返り値 More... | |
| struct | GameResult |
| 試合の結果を格納する. More... | |
| struct | GameSetting |
| 試合設定 More... | |
| struct | GameState |
| 試合の状態を表す More... | |
| class | IPlayer |
| 理想的なショットを与えられた際に,乱数を加えたりしてプレイヤーによるブレを付与する More... | |
| class | IPlayerFactory |
| IPlayer を構築するためのクラスです More... | |
| class | IPlayerStorage |
| IPlayer の状態を保存するストレージ More... | |
| class | ISimulator |
| ストーンの挙動を再現する物理シミュレータを扱うためのインターフェイス More... | |
| class | ISimulatorFactory |
| ISimulator を構築するためのクラスです More... | |
| class | ISimulatorStorage |
| ISimulator の状態を保存するストレージ More... | |
| struct | Transform |
| 位置,角度を格納します. More... | |
| struct | Vector2 |
| 2次元ベクトル More... | |
Typedefs | |
| using | Move = std::variant< moves::Shot, moves::Concede > |
| ターンごとにチームが採る行動 More... | |
Enumerations | |
| enum | Team : std::int8_t { Team::k0 = 0, Team::k1 = 1, Team::kInvalid } |
| チームを識別するために用いる列挙体です. More... | |
Functions | |
| void | ApplyMove (GameSetting const &setting, ISimulator &simulator, IPlayer &player, GameState &state, Move &move, std::chrono::milliseconds const &thinking_time_used, ApplyMoveResult *result=nullptr, std::function< void(ISimulator const &)> on_step=nullptr) |
| 試合を1ターン進めます More... | |
| Team | GetOpponentTeam (Team team) |
| 相手チームを得る More... | |
| std::string | ToString (Team team) |
| チームを文字列に変換する More... | |
| template<class T > | |
| std::underlying_type_t< T > | ToUType (T value) |
enum class を std::underlying_type_t に変換する More... | |
| constexpr Vector2 | operator- (Vector2 v) |
| ベクトルを反転します More... | |
| constexpr Vector2 | operator+ (Vector2 v1, Vector2 v2) |
| ベクトル同士の加算を行います More... | |
| constexpr Vector2 | operator- (Vector2 v1, Vector2 v2) |
| ベクトル同士の減算を行います More... | |
| constexpr Vector2 | operator* (float f, Vector2 v) |
| ベクトルとスカラー値の乗算を行います More... | |
| constexpr Vector2 | operator* (Vector2 v, float f) |
| ベクトルとスカラー値の乗算を行います More... | |
| constexpr Vector2 | operator/ (Vector2 v, float f) |
| ベクトルとスカラー値の除算を行います More... | |
| std::string | GetVersion () |
| バージョンを得る More... | |
| std::uint32_t | GetVersionMajor () |
| メジャーバージョンを得る More... | |
| std::uint32_t | GetVersionMinor () |
| マイナーバージョンを得る More... | |
| std::uint32_t | GetVersionPatch () |
| パッチバージョンを得る More... | |
Variables | |
| constexpr float | kPi = 3.14159265359f |
| 円周率 | |
Digital Curling ライブラリはこの名前空間の中に定義されます
| using digitalcurling3::Move = typedef std::variant<moves::Shot, moves::Concede> |
ターンごとにチームが採る行動
|
strong |
| void digitalcurling3::ApplyMove | ( | GameSetting const & | setting, |
| ISimulator & | simulator, | ||
| IPlayer & | player, | ||
| GameState & | state, | ||
| Move & | move, | ||
| std::chrono::milliseconds const & | thinking_time_used, | ||
| ApplyMoveResult * | result = nullptr, |
||
| std::function< void(ISimulator const &)> | on_step = nullptr |
||
| ) |
試合を1ターン進めます
複数のスレッドで同時に実行する場合は,すべての引数にスレッド毎に作成したインスタンスを指定してください.
引数の simulator や shot_randomizer のメンバ関数を呼び出した際に例外が送出された場合の動作は保証しません.
| [in] | setting | この試合設定に基づいて試合を進めます. |
| [in,out] | simulator | このインスタンスを使用して,ストーンのシミュレーションを行います. 呼出し後はすべてのストーンが停止し,プレイエリア外のストーンが除外された時点の状態になります. |
| [in,out] | player | このインスタンスの IPlayer::Play() を呼び出してショットの初速に乱数を加えたり,ショットの初速上限を適用したりします. |
| [in,out] | state | 現在の試合状態を指定します.呼出し後は1ターン後の状態になります. |
| [in,out] | move | この行動が適用されます.呼出し後は実際に行われた行動が格納されます ( moves::Shot の場合に player を用いて乱数が加えられます) |
| [in] | thinking_time_used | このターンに使用した思考時間(ミリ秒) |
| [out] | result | 返り値.このターンで起こったことに関する情報が格納されます. |
| [in] | on_step | シミュレーションのステップごとに呼び出されるコールバックです. コールバックの引数には ApplyMove() に渡したシミュレータが渡されます. このコールバックを使用することで, ApplyMove() 中のストーンの軌跡などの情報を得ることができます. |
| std::out_of_range | GameState::scores の std::vector のサイズが足りない(< GameSetting::max_end)とき |
| std::invalid_argument | 上記以外で引数が不正なとき |
相手チームを得る
| [in] | team | チーム |
| std::string digitalcurling3::GetVersion | ( | ) |
バージョンを得る
| std::uint32_t digitalcurling3::GetVersionMajor | ( | ) |
メジャーバージョンを得る
| std::uint32_t digitalcurling3::GetVersionMinor | ( | ) |
マイナーバージョンを得る
| std::uint32_t digitalcurling3::GetVersionPatch | ( | ) |
パッチバージョンを得る
ベクトルとスカラー値の乗算を行います
| [in] | f | スカラー値 |
| [in] | v | ベクトル |
ベクトルとスカラー値の乗算を行います
| [in] | v | ベクトル |
| [in] | f | スカラー値 |
ベクトル同士の加算を行います
| [in] | v1 | ベクトル1 |
| [in] | v2 | ベクトル2 |
ベクトルを反転します
| [in] | v | ベクトル |
ベクトル同士の減算を行います
| [in] | v1 | ベクトル1 |
| [in] | v2 | ベクトル2 |
ベクトルとスカラー値の除算を行います
| [in] | v | ベクトル |
| [in] | f | スカラー値 |
|
inline |
チームを文字列に変換する
| [in] | team | チーム |
"team0" , k1: "team1" , kInvalid: "invalid"
|
inline |
enum class を std::underlying_type_t に変換する
| [in] | value | enum class |
static_cast<std::underlying_type_t<T>>(value)