-
Notifications
You must be signed in to change notification settings - Fork 86
/
messages.proto
124 lines (104 loc) · 1.95 KB
/
messages.proto
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
syntax = "proto3";
import "google/protobuf/any.proto";
package ns3_ai_gym;
//---------Types----------//
enum MsgType {
Unknown = 0;
Init = 1;
ActionSpace = 2;
ObservationSpace = 3;
IsGameOver = 4;
Observation = 5;
Reward = 6;
ExtraInfo = 7;
Action = 8;
StopEnv = 9;
}
enum SpaceType {
NoSpaceType = 0;
Discrete = 1;
Box = 2;
Tuple = 3;
Dict = 4;
}
enum Dtype {
NoDType = 0;
INT = 1;
UINT = 2;
FLOAT = 3;
DOUBLE = 4;
}
//------------------------//
//---Space Descriptions---//
message SpaceDescription {
SpaceType type = 1;
google.protobuf.Any space = 2;
string name = 3; //optional
}
message DiscreteSpace {
int32 n = 1;
}
message BoxSpace {
float low = 1;
float high = 2;
Dtype dtype = 3;
repeated uint32 shape = 4;
}
message TupleSpace {
repeated SpaceDescription element = 1;
}
message DictSpace {
repeated SpaceDescription element = 1;
}
//------------------------//
//----Data Containers-----//
message DataContainer {
SpaceType type = 1;
google.protobuf.Any data = 2;
string name = 3; //optional
}
message DiscreteDataContainer {
int32 data = 1;
}
message BoxDataContainer {
Dtype dtype = 1;
repeated uint32 shape = 2;
repeated int32 intData = 3;
repeated uint32 uintData = 4;
repeated float floatData = 5;
repeated double doubleData = 6;
}
message TupleDataContainer {
repeated DataContainer element = 1;
}
message DictDataContainer {
repeated DataContainer element = 1;
}
//------------------------//
//--------Messages--------//
message SimInitMsg {
// uint64 simProcessId = 1;
// uint64 wafShellProcessId = 2;
SpaceDescription obsSpace = 1;
SpaceDescription actSpace = 2;
}
message SimInitAck {
bool done = 1;
bool stopSimReq = 2;
}
message EnvStateMsg {
DataContainer obsData = 1;
float reward = 2;
bool isGameOver = 3;
enum Reason {
SimulationEnd = 0;
GameOver = 1;
}
Reason reason = 4;
string info = 5;
}
message EnvActMsg {
DataContainer actData = 1;
bool stopSimReq = 2;
}
//------------------------//