-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbridge_dataset.h
More file actions
43 lines (33 loc) · 991 Bytes
/
Copy pathbridge_dataset.h
File metadata and controls
43 lines (33 loc) · 991 Bytes
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
//
// Created by qzz on 2023/10/9.
//
#ifndef BRIDGE_LEARNING_RLCC_BRIDGE_DATASET_H_
#define BRIDGE_LEARNING_RLCC_BRIDGE_DATASET_H_
#include <array>
#include <mutex>
#include <optional>
#include <vector>
#include "bridge_lib/bridge_utils.h"
namespace ble = bridge_learning_env;
namespace rlcc {
inline constexpr int kDoubleDummyResultSize =
ble::kNumPlayers * ble::kNumDenominations;
struct BridgeData {
std::vector<int> deal{};
std::optional<std::array<int, kDoubleDummyResultSize>> ddt;
};
class BridgeDataset {
public:
explicit BridgeDataset(const std::vector<std::vector<int>>& deals);
BridgeDataset(
const std::vector<std::vector<int>>& deals,
const std::vector<std::array<int, kDoubleDummyResultSize>>& ddts);
int Size() const { return static_cast<int>(dataset_.size()); }
BridgeData Next();
private:
std::vector<BridgeData> dataset_;
std::mutex m_;
int index_ = 0;
};
} // namespace rlcc
#endif //BRIDGE_LEARNING_RLCC_BRIDGE_DATASET_H_