Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
6
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
cogment
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
31
Issues
31
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
12
Merge Requests
12
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cogment
cogment
Commits
6a4b3da1
Commit
6a4b3da1
authored
Jul 05, 2019
by
François Chabot
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'richer_log' into 'master'
more info in datalog See merge request age-of-minds/aom-framework!36
parents
e9999670
c4da9159
Pipeline
#69630604
passed with stages
in 7 minutes and 33 seconds
Changes
10
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
473 additions
and
15 deletions
+473
-15
orchestrator/lib/aom/datalog/csv_storage.cpp
orchestrator/lib/aom/datalog/csv_storage.cpp
+101
-2
orchestrator/lib/aom/trial.cpp
orchestrator/lib/aom/trial.cpp
+10
-1
orchestrator/protos/aom_framework/protocols.proto
orchestrator/protos/aom_framework/protocols.proto
+3
-0
orchestrator/version.txt
orchestrator/version.txt
+1
-1
sdk_cpp/aom_framework/protocols.pb.cc
sdk_cpp/aom_framework/protocols.pb.cc
+100
-5
sdk_cpp/aom_framework/protocols.pb.h
sdk_cpp/aom_framework/protocols.pb.h
+136
-0
sdk_js/aom_framework/protocols_pb.js
sdk_js/aom_framework/protocols_pb.js
+103
-1
sdk_js/package.json
sdk_js/package.json
+1
-1
sdk_python/aom_framework/protocols_pb2.py
sdk_python/aom_framework/protocols_pb2.py
+17
-3
sdk_python/setup.py
sdk_python/setup.py
+1
-1
No files found.
orchestrator/lib/aom/datalog/csv_storage.cpp
View file @
6a4b3da1
...
...
@@ -4,6 +4,90 @@
#include <stdexcept>
namespace
{
/*
base64.cpp and base64.h
Copyright (C) 2004-2008 René Nyffenegger
This source code is provided 'as-is', without any express or implied
warranty. In no event will the author be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this source code must not be misrepresented; you must not
claim that you wrote the original source code. If you use this source code
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original source code.
3. This notice may not be removed or altered from any source distribution.
René Nyffenegger rene.nyffenegger@adp-gmbh.ch
*/
static
const
std
::
string
base64_chars
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789+/"
;
static
inline
bool
is_base64
(
unsigned
char
c
)
{
return
(
isalnum
(
c
)
||
(
c
==
'+'
)
||
(
c
==
'/'
));
}
std
::
string
base64_encode
(
const
std
::
string
&
data
)
{
std
::
string
ret
;
int
i
=
0
;
int
j
=
0
;
unsigned
char
char_array_3
[
3
];
unsigned
char
char_array_4
[
4
];
unsigned
char
const
*
bytes_to_encode
=
reinterpret_cast
<
const
unsigned
char
*>
(
data
.
data
());
unsigned
int
in_len
=
data
.
length
();
while
(
in_len
--
)
{
char_array_3
[
i
++
]
=
*
(
bytes_to_encode
++
);
if
(
i
==
3
)
{
char_array_4
[
0
]
=
(
char_array_3
[
0
]
&
0xfc
)
>>
2
;
char_array_4
[
1
]
=
((
char_array_3
[
0
]
&
0x03
)
<<
4
)
+
((
char_array_3
[
1
]
&
0xf0
)
>>
4
);
char_array_4
[
2
]
=
((
char_array_3
[
1
]
&
0x0f
)
<<
2
)
+
((
char_array_3
[
2
]
&
0xc0
)
>>
6
);
char_array_4
[
3
]
=
char_array_3
[
2
]
&
0x3f
;
for
(
i
=
0
;
(
i
<
4
)
;
i
++
)
ret
+=
base64_chars
[
char_array_4
[
i
]];
i
=
0
;
}
}
if
(
i
)
{
for
(
j
=
i
;
j
<
3
;
j
++
)
char_array_3
[
j
]
=
'\0'
;
char_array_4
[
0
]
=
(
char_array_3
[
0
]
&
0xfc
)
>>
2
;
char_array_4
[
1
]
=
((
char_array_3
[
0
]
&
0x03
)
<<
4
)
+
((
char_array_3
[
1
]
&
0xf0
)
>>
4
);
char_array_4
[
2
]
=
((
char_array_3
[
1
]
&
0x0f
)
<<
2
)
+
((
char_array_3
[
2
]
&
0xc0
)
>>
6
);
char_array_4
[
3
]
=
char_array_3
[
2
]
&
0x3f
;
for
(
j
=
0
;
(
j
<
i
+
1
);
j
++
)
ret
+=
base64_chars
[
char_array_4
[
j
]];
while
((
i
++
<
3
))
ret
+=
'='
;
}
return
ret
;
}
}
namespace
aom
{
Local_csv_storage
::
Trial_log
::
Trial_log
(
Local_csv_storage
*
owner
,
const
uuids
::
uuid
&
)
...
...
@@ -19,7 +103,7 @@ namespace aom {
}
Local_csv_storage
::
Local_csv_storage
(
const
std
::
string
&
file_name
)
:
file_
(
file_name
,
std
::
ios
::
binary
)
:
file_
(
file_name
,
std
::
ios
::
binary
|
std
::
ofstream
::
app
)
,
flush_pool
(
1
,
1
)
{
if
(
!
file_
.
good
())
{
throw
std
::
runtime_error
(
std
::
string
(
"failed to open csv datalog for writing: "
)
+
file_name
);
...
...
@@ -35,8 +119,23 @@ namespace aom {
}
void
Local_csv_storage
::
send
(
aom_api
::
Datalog_sample
sample
)
{
flush_pool
.
push_job
([
this
,
s
{
std
::
move
(
sample
)}]()
{
file_
<<
fmt
::
format
(
"{},
\n
"
,
s
.
trial_id
());
std
::
string
agent_action
=
base64_encode
(
s
.
agent_action
());
std
::
string
user_action
=
base64_encode
(
s
.
user_action
());
std
::
string
checkpoint
;
std
::
string
delta
;
if
(
s
.
has_env_state
())
{
checkpoint
=
base64_encode
(
s
.
env_state
().
content
());
}
if
(
s
.
has_env_delta
())
{
delta
=
base64_encode
(
s
.
env_delta
().
content
());
}
file_
<<
fmt
::
format
(
"{}, {}, {}, {}, {},
\n
"
,
s
.
trial_id
(),
checkpoint
,
delta
,
user_action
,
agent_action
);
file_
.
flush
();
});
}
...
...
orchestrator/lib/aom/trial.cpp
View file @
6a4b3da1
...
...
@@ -46,7 +46,6 @@ void Trial::request_agent_decision() {
void
Trial
::
agent_decided
(
const
aom_api
::
AgentDecideReply
rep
)
{
agent_decision_
=
std
::
move
(
rep
);
cache_sample
();
try_advance
();
}
...
...
@@ -61,11 +60,21 @@ void Trial::cache_sample() {
log_sample
.
mutable_env_delta
()
->
CopyFrom
(
latest_delta_
);
}
if
(
agent_decision_
)
{
*
log_sample
.
mutable_agent_action
()
=
agent_decision_
->
decision
().
content
();
}
if
(
user_action_
)
{
*
log_sample
.
mutable_user_action
()
=
user_action_
->
content
();
}
session_log_
.
emplace_back
(
std
::
move
(
log_sample
));
}
void
Trial
::
try_advance
()
{
if
(
agent_decision_
&&
user_action_
)
{
cache_sample
();
// Send the update to the environment
aom_api
::
EnvUpdateRequest
req
;
...
...
orchestrator/protos/aom_framework/protocols.proto
View file @
6a4b3da1
...
...
@@ -144,4 +144,7 @@ message Datalog_sample {
// deltas are always relative to the latest env_state.
EnvState
env_state
=
2
;
EnvStateDelta
env_delta
=
3
;
bytes
agent_action
=
4
;
bytes
user_action
=
5
;
}
\ No newline at end of file
orchestrator/version.txt
View file @
6a4b3da1
0.0.8
\ No newline at end of file
0.0.9
\ No newline at end of file
sdk_cpp/aom_framework/protocols.pb.cc
View file @
6a4b3da1
...
...
@@ -715,6 +715,8 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET
(
::
aom_api
::
Datalog_sample
,
trial_id_
),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET
(
::
aom_api
::
Datalog_sample
,
env_state_
),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET
(
::
aom_api
::
Datalog_sample
,
env_delta_
),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET
(
::
aom_api
::
Datalog_sample
,
agent_action_
),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET
(
::
aom_api
::
Datalog_sample
,
user_action_
),
};
static
const
::
google
::
protobuf
::
internal
::
MigrationSchema
schemas
[]
GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE
(
protodesc_cold
)
=
{
{
0
,
-
1
,
sizeof
(
::
aom_api
::
EnvState
)},
...
...
@@ -830,13 +832,14 @@ void AddDescriptorsImpl() {
"ta
\030\003
\001
(
\013
2
\026
.aom_api.EnvStateDelta
\"
<
\n\020
Agen"
"tDecideReply
\022
(
\n\010
decision
\030\001
\001
(
\013
2
\026
.aom_api"
".AgentDecision
\"\024\n\022
AgentRewardRequest
\"\022\n\020
"
"AgentRewardReply
\"
s
\n\016
Datalog_sample
\022\020\n\010
tr"
"ial_id
\030\001
\001
(
\t\022
$
\n\t
env_state
\030\002
\001
(
\013
2
\021
.aom_ap"
"i.EnvState
\022
)
\n\t
env_delta
\030\003
\001
(
\013
2
\026
.aom_api."
"EnvStateDeltab
\006
proto3"
"AgentRewardReply
\"\236\001\n\016
Datalog_sample
\022\020\n\010
t"
"rial_id
\030\001
\001
(
\t\022
$
\n\t
env_state
\030\002
\001
(
\013
2
\021
.aom_a"
"pi.EnvState
\022
)
\n\t
env_delta
\030\003
\001
(
\013
2
\026
.aom_api"
".EnvStateDelta
\022\024\n\014
agent_action
\030\004
\001
(
\014\022\023\n\013
"
"user_action
\030\005
\001
(
\014
b
\006
proto3"
};
::
google
::
protobuf
::
DescriptorPool
::
InternalAddGeneratedFile
(
descriptor
,
16
21
);
descriptor
,
16
65
);
::
google
::
protobuf
::
MessageFactory
::
InternalRegisterGeneratedFile
(
"aom_framework/protocols.proto"
,
&
protobuf_RegisterTypes
);
}
...
...
@@ -7017,6 +7020,8 @@ void Datalog_sample::InitAsDefaultInstance() {
const
int
Datalog_sample
::
kTrialIdFieldNumber
;
const
int
Datalog_sample
::
kEnvStateFieldNumber
;
const
int
Datalog_sample
::
kEnvDeltaFieldNumber
;
const
int
Datalog_sample
::
kAgentActionFieldNumber
;
const
int
Datalog_sample
::
kUserActionFieldNumber
;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
Datalog_sample
::
Datalog_sample
()
...
...
@@ -7034,6 +7039,14 @@ Datalog_sample::Datalog_sample(const Datalog_sample& from)
if
(
from
.
trial_id
().
size
()
>
0
)
{
trial_id_
.
AssignWithDefault
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
from
.
trial_id_
);
}
agent_action_
.
UnsafeSetDefault
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
if
(
from
.
agent_action
().
size
()
>
0
)
{
agent_action_
.
AssignWithDefault
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
from
.
agent_action_
);
}
user_action_
.
UnsafeSetDefault
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
if
(
from
.
user_action
().
size
()
>
0
)
{
user_action_
.
AssignWithDefault
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
from
.
user_action_
);
}
if
(
from
.
has_env_state
())
{
env_state_
=
new
::
aom_api
::
EnvState
(
*
from
.
env_state_
);
}
else
{
...
...
@@ -7049,6 +7062,8 @@ Datalog_sample::Datalog_sample(const Datalog_sample& from)
void
Datalog_sample
::
SharedCtor
()
{
trial_id_
.
UnsafeSetDefault
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
agent_action_
.
UnsafeSetDefault
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
user_action_
.
UnsafeSetDefault
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
::
memset
(
&
env_state_
,
0
,
static_cast
<
size_t
>
(
reinterpret_cast
<
char
*>
(
&
env_delta_
)
-
reinterpret_cast
<
char
*>
(
&
env_state_
))
+
sizeof
(
env_delta_
));
...
...
@@ -7061,6 +7076,8 @@ Datalog_sample::~Datalog_sample() {
void
Datalog_sample
::
SharedDtor
()
{
trial_id_
.
DestroyNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
agent_action_
.
DestroyNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
user_action_
.
DestroyNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
if
(
this
!=
internal_default_instance
())
delete
env_state_
;
if
(
this
!=
internal_default_instance
())
delete
env_delta_
;
}
...
...
@@ -7086,6 +7103,8 @@ void Datalog_sample::Clear() {
(
void
)
cached_has_bits
;
trial_id_
.
ClearToEmptyNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
agent_action_
.
ClearToEmptyNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
user_action_
.
ClearToEmptyNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
if
(
GetArenaNoVirtual
()
==
NULL
&&
env_state_
!=
NULL
)
{
delete
env_state_
;
}
...
...
@@ -7147,6 +7166,30 @@ bool Datalog_sample::MergePartialFromCodedStream(
break
;
}
// bytes agent_action = 4;
case
4
:
{
if
(
static_cast
<
::
google
::
protobuf
::
uint8
>
(
tag
)
==
static_cast
<
::
google
::
protobuf
::
uint8
>
(
34u
/* 34 & 0xFF */
))
{
DO_
(
::
google
::
protobuf
::
internal
::
WireFormatLite
::
ReadBytes
(
input
,
this
->
mutable_agent_action
()));
}
else
{
goto
handle_unusual
;
}
break
;
}
// bytes user_action = 5;
case
5
:
{
if
(
static_cast
<
::
google
::
protobuf
::
uint8
>
(
tag
)
==
static_cast
<
::
google
::
protobuf
::
uint8
>
(
42u
/* 42 & 0xFF */
))
{
DO_
(
::
google
::
protobuf
::
internal
::
WireFormatLite
::
ReadBytes
(
input
,
this
->
mutable_user_action
()));
}
else
{
goto
handle_unusual
;
}
break
;
}
default:
{
handle_unusual:
if
(
tag
==
0
)
{
...
...
@@ -7195,6 +7238,18 @@ void Datalog_sample::SerializeWithCachedSizes(
3
,
this
->
_internal_env_delta
(),
output
);
}
// bytes agent_action = 4;
if
(
this
->
agent_action
().
size
()
>
0
)
{
::
google
::
protobuf
::
internal
::
WireFormatLite
::
WriteBytesMaybeAliased
(
4
,
this
->
agent_action
(),
output
);
}
// bytes user_action = 5;
if
(
this
->
user_action
().
size
()
>
0
)
{
::
google
::
protobuf
::
internal
::
WireFormatLite
::
WriteBytesMaybeAliased
(
5
,
this
->
user_action
(),
output
);
}
if
((
_internal_metadata_
.
have_unknown_fields
()
&&
::
google
::
protobuf
::
internal
::
GetProto3PreserveUnknownsDefault
()))
{
::
google
::
protobuf
::
internal
::
WireFormat
::
SerializeUnknownFields
(
(
::
google
::
protobuf
::
internal
::
GetProto3PreserveUnknownsDefault
()
?
_internal_metadata_
.
unknown_fields
()
:
_internal_metadata_
.
default_instance
()),
output
);
...
...
@@ -7234,6 +7289,20 @@ void Datalog_sample::SerializeWithCachedSizes(
3
,
this
->
_internal_env_delta
(),
deterministic
,
target
);
}
// bytes agent_action = 4;
if
(
this
->
agent_action
().
size
()
>
0
)
{
target
=
::
google
::
protobuf
::
internal
::
WireFormatLite
::
WriteBytesToArray
(
4
,
this
->
agent_action
(),
target
);
}
// bytes user_action = 5;
if
(
this
->
user_action
().
size
()
>
0
)
{
target
=
::
google
::
protobuf
::
internal
::
WireFormatLite
::
WriteBytesToArray
(
5
,
this
->
user_action
(),
target
);
}
if
((
_internal_metadata_
.
have_unknown_fields
()
&&
::
google
::
protobuf
::
internal
::
GetProto3PreserveUnknownsDefault
()))
{
target
=
::
google
::
protobuf
::
internal
::
WireFormat
::
SerializeUnknownFieldsToArray
(
(
::
google
::
protobuf
::
internal
::
GetProto3PreserveUnknownsDefault
()
?
_internal_metadata_
.
unknown_fields
()
:
_internal_metadata_
.
default_instance
()),
target
);
...
...
@@ -7258,6 +7327,20 @@ size_t Datalog_sample::ByteSizeLong() const {
this
->
trial_id
());
}
// bytes agent_action = 4;
if
(
this
->
agent_action
().
size
()
>
0
)
{
total_size
+=
1
+
::
google
::
protobuf
::
internal
::
WireFormatLite
::
BytesSize
(
this
->
agent_action
());
}
// bytes user_action = 5;
if
(
this
->
user_action
().
size
()
>
0
)
{
total_size
+=
1
+
::
google
::
protobuf
::
internal
::
WireFormatLite
::
BytesSize
(
this
->
user_action
());
}
// .aom_api.EnvState env_state = 2;
if
(
this
->
has_env_state
())
{
total_size
+=
1
+
...
...
@@ -7303,6 +7386,14 @@ void Datalog_sample::MergeFrom(const Datalog_sample& from) {
trial_id_
.
AssignWithDefault
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
from
.
trial_id_
);
}
if
(
from
.
agent_action
().
size
()
>
0
)
{
agent_action_
.
AssignWithDefault
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
from
.
agent_action_
);
}
if
(
from
.
user_action
().
size
()
>
0
)
{
user_action_
.
AssignWithDefault
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
from
.
user_action_
);
}
if
(
from
.
has_env_state
())
{
mutable_env_state
()
->::
aom_api
::
EnvState
::
MergeFrom
(
from
.
env_state
());
}
...
...
@@ -7337,6 +7428,10 @@ void Datalog_sample::InternalSwap(Datalog_sample* other) {
using
std
::
swap
;
trial_id_
.
Swap
(
&
other
->
trial_id_
,
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
GetArenaNoVirtual
());
agent_action_
.
Swap
(
&
other
->
agent_action_
,
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
GetArenaNoVirtual
());
user_action_
.
Swap
(
&
other
->
user_action_
,
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
GetArenaNoVirtual
());
swap
(
env_state_
,
other
->
env_state_
);
swap
(
env_delta_
,
other
->
env_delta_
);
_internal_metadata_
.
Swap
(
&
other
->
_internal_metadata_
);
...
...
sdk_cpp/aom_framework/protocols.pb.h
View file @
6a4b3da1
...
...
@@ -3028,6 +3028,34 @@ class Datalog_sample : public ::google::protobuf::Message /* @@protoc_insertion_
::
std
::
string
*
release_trial_id
();
void
set_allocated_trial_id
(
::
std
::
string
*
trial_id
);
// bytes agent_action = 4;
void
clear_agent_action
();
static
const
int
kAgentActionFieldNumber
=
4
;
const
::
std
::
string
&
agent_action
()
const
;
void
set_agent_action
(
const
::
std
::
string
&
value
);
#if LANG_CXX11
void
set_agent_action
(
::
std
::
string
&&
value
);
#endif
void
set_agent_action
(
const
char
*
value
);
void
set_agent_action
(
const
void
*
value
,
size_t
size
);
::
std
::
string
*
mutable_agent_action
();
::
std
::
string
*
release_agent_action
();
void
set_allocated_agent_action
(
::
std
::
string
*
agent_action
);
// bytes user_action = 5;
void
clear_user_action
();
static
const
int
kUserActionFieldNumber
=
5
;
const
::
std
::
string
&
user_action
()
const
;
void
set_user_action
(
const
::
std
::
string
&
value
);
#if LANG_CXX11
void
set_user_action
(
::
std
::
string
&&
value
);
#endif
void
set_user_action
(
const
char
*
value
);
void
set_user_action
(
const
void
*
value
,
size_t
size
);
::
std
::
string
*
mutable_user_action
();
::
std
::
string
*
release_user_action
();
void
set_allocated_user_action
(
::
std
::
string
*
user_action
);
// .aom_api.EnvState env_state = 2;
bool
has_env_state
()
const
;
void
clear_env_state
();
...
...
@@ -3057,6 +3085,8 @@ class Datalog_sample : public ::google::protobuf::Message /* @@protoc_insertion_
::
google
::
protobuf
::
internal
::
InternalMetadataWithArena
_internal_metadata_
;
::
google
::
protobuf
::
internal
::
ArenaStringPtr
trial_id_
;
::
google
::
protobuf
::
internal
::
ArenaStringPtr
agent_action_
;
::
google
::
protobuf
::
internal
::
ArenaStringPtr
user_action_
;
::
aom_api
::
EnvState
*
env_state_
;
::
aom_api
::
EnvStateDelta
*
env_delta_
;
mutable
::
google
::
protobuf
::
internal
::
CachedSize
_cached_size_
;
...
...
@@ -4969,6 +4999,112 @@ inline void Datalog_sample::set_allocated_env_delta(::aom_api::EnvStateDelta* en
// @@protoc_insertion_point(field_set_allocated:aom_api.Datalog_sample.env_delta)
}
// bytes agent_action = 4;
inline
void
Datalog_sample
::
clear_agent_action
()
{
agent_action_
.
ClearToEmptyNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
}
inline
const
::
std
::
string
&
Datalog_sample
::
agent_action
()
const
{
// @@protoc_insertion_point(field_get:aom_api.Datalog_sample.agent_action)
return
agent_action_
.
GetNoArena
();
}
inline
void
Datalog_sample
::
set_agent_action
(
const
::
std
::
string
&
value
)
{
agent_action_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
value
);
// @@protoc_insertion_point(field_set:aom_api.Datalog_sample.agent_action)
}
#if LANG_CXX11
inline
void
Datalog_sample
::
set_agent_action
(
::
std
::
string
&&
value
)
{
agent_action_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
::
std
::
move
(
value
));
// @@protoc_insertion_point(field_set_rvalue:aom_api.Datalog_sample.agent_action)
}
#endif
inline
void
Datalog_sample
::
set_agent_action
(
const
char
*
value
)
{
GOOGLE_DCHECK
(
value
!=
NULL
);
agent_action_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
::
std
::
string
(
value
));
// @@protoc_insertion_point(field_set_char:aom_api.Datalog_sample.agent_action)
}
inline
void
Datalog_sample
::
set_agent_action
(
const
void
*
value
,
size_t
size
)
{
agent_action_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
::
std
::
string
(
reinterpret_cast
<
const
char
*>
(
value
),
size
));
// @@protoc_insertion_point(field_set_pointer:aom_api.Datalog_sample.agent_action)
}
inline
::
std
::
string
*
Datalog_sample
::
mutable_agent_action
()
{
// @@protoc_insertion_point(field_mutable:aom_api.Datalog_sample.agent_action)
return
agent_action_
.
MutableNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
}
inline
::
std
::
string
*
Datalog_sample
::
release_agent_action
()
{
// @@protoc_insertion_point(field_release:aom_api.Datalog_sample.agent_action)
return
agent_action_
.
ReleaseNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
}
inline
void
Datalog_sample
::
set_allocated_agent_action
(
::
std
::
string
*
agent_action
)
{
if
(
agent_action
!=
NULL
)
{
}
else
{
}
agent_action_
.
SetAllocatedNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
agent_action
);
// @@protoc_insertion_point(field_set_allocated:aom_api.Datalog_sample.agent_action)
}
// bytes user_action = 5;
inline
void
Datalog_sample
::
clear_user_action
()
{
user_action_
.
ClearToEmptyNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
}
inline
const
::
std
::
string
&
Datalog_sample
::
user_action
()
const
{
// @@protoc_insertion_point(field_get:aom_api.Datalog_sample.user_action)
return
user_action_
.
GetNoArena
();
}
inline
void
Datalog_sample
::
set_user_action
(
const
::
std
::
string
&
value
)
{
user_action_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
value
);
// @@protoc_insertion_point(field_set:aom_api.Datalog_sample.user_action)
}
#if LANG_CXX11
inline
void
Datalog_sample
::
set_user_action
(
::
std
::
string
&&
value
)
{
user_action_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
::
std
::
move
(
value
));
// @@protoc_insertion_point(field_set_rvalue:aom_api.Datalog_sample.user_action)
}
#endif
inline
void
Datalog_sample
::
set_user_action
(
const
char
*
value
)
{
GOOGLE_DCHECK
(
value
!=
NULL
);
user_action_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
::
std
::
string
(
value
));
// @@protoc_insertion_point(field_set_char:aom_api.Datalog_sample.user_action)
}
inline
void
Datalog_sample
::
set_user_action
(
const
void
*
value
,
size_t
size
)
{
user_action_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
::
std
::
string
(
reinterpret_cast
<
const
char
*>
(
value
),
size
));
// @@protoc_insertion_point(field_set_pointer:aom_api.Datalog_sample.user_action)
}
inline
::
std
::
string
*
Datalog_sample
::
mutable_user_action
()
{
// @@protoc_insertion_point(field_mutable:aom_api.Datalog_sample.user_action)
return
user_action_
.
MutableNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
}
inline
::
std
::
string
*
Datalog_sample
::
release_user_action
()
{
// @@protoc_insertion_point(field_release:aom_api.Datalog_sample.user_action)
return
user_action_
.
ReleaseNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
}
inline
void
Datalog_sample
::
set_allocated_user_action
(
::
std
::
string
*
user_action
)
{
if
(
user_action
!=
NULL
)
{
}
else
{
}
user_action_
.
SetAllocatedNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
user_action
);
// @@protoc_insertion_point(field_set_allocated:aom_api.Datalog_sample.user_action)
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif // __GNUC__
...
...
sdk_js/aom_framework/protocols_pb.js
View file @
6a4b3da1
...
...
@@ -4249,7 +4249,9 @@ proto.aom_api.Datalog_sample.toObject = function(includeInstance, msg) {
var
f
,
obj
=
{
trialId
:
jspb
.
Message
.
getFieldWithDefault
(
msg
,
1
,
""
),
envState
:
(
f
=
msg
.
getEnvState
())
&&
proto
.
aom_api
.
EnvState
.
toObject
(
includeInstance
,
f
),
envDelta
:
(
f
=
msg
.
getEnvDelta
())
&&
proto
.
aom_api
.
EnvStateDelta
.
toObject
(
includeInstance
,
f
)
envDelta
:
(
f
=
msg
.
getEnvDelta
())
&&
proto
.
aom_api
.
EnvStateDelta
.
toObject
(
includeInstance
,
f
),
agentAction
:
msg
.
getAgentAction_asB64
(),
userAction
:
msg
.
getUserAction_asB64
()
};
if
(
includeInstance
)
{
...
...
@@ -4300,6 +4302,14 @@ proto.aom_api.Datalog_sample.deserializeBinaryFromReader = function(msg, reader)
reader
.
readMessage
(
value
,
proto
.
aom_api
.
EnvStateDelta
.
deserializeBinaryFromReader
);
msg
.
setEnvDelta
(
value
);
break
;
case
4
:
var
value
=
/** @type {!Uint8Array} */
(
reader
.
readBytes
());
msg
.
setAgentAction
(
value
);
break
;
case
5
:
var
value
=
/** @type {!Uint8Array} */
(
reader
.
readBytes
());
msg
.
setUserAction
(
value
);
break
;
default
:
reader
.
skipField
();
break
;
...
...
@@ -4352,6 +4362,20 @@ proto.aom_api.Datalog_sample.serializeBinaryToWriter = function(message, writer)
proto
.
aom_api
.
EnvStateDelta
.
serializeBinaryToWriter
);
}
f
=
message
.
getAgentAction_asU8
();
if
(
f
.
length
>
0
)
{
writer
.
writeBytes
(
4
,
f
);
}
f
=
message
.
getUserAction_asU8
();
if
(
f
.
length
>
0
)
{
writer
.
writeBytes
(
5
,
f
);
}
};
...
...
@@ -4430,4 +4454,82 @@ proto.aom_api.Datalog_sample.prototype.hasEnvDelta = function() {
};
/**
* optional bytes agent_action = 4;
* @return {!(string|Uint8Array)}
*/
proto
.
aom_api
.
Datalog_sample
.
prototype
.
getAgentAction
=
function
()
{
return
/** @type {!(string|Uint8Array)} */
(
jspb
.
Message
.
getFieldWithDefault
(
this
,
4
,
""
));
};
/**
* optional bytes agent_action = 4;
* This is a type-conversion wrapper around `getAgentAction()`
* @return {string}
*/