Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
4
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
edceb282
Commit
edceb282
authored
Jan 07, 2020
by
François Chabot
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'agent_config' into 'master'
Agent config See merge request
!142
parents
a2119ec6
2d7115d4
Pipeline
#110904443
passed with stages
in 10 minutes and 1 second
Changes
4
Pipelines
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
7 deletions
+14
-7
orchestrator/lib/aom/agent.cpp
orchestrator/lib/aom/agent.cpp
+4
-2
orchestrator/lib/aom/agent.h
orchestrator/lib/aom/agent.h
+4
-2
orchestrator/lib/aom/trial.cpp
orchestrator/lib/aom/trial.cpp
+5
-2
orchestrator/lib/version.txt
orchestrator/lib/version.txt
+1
-1
No files found.
orchestrator/lib/aom/agent.cpp
View file @
edceb282
...
...
@@ -5,7 +5,7 @@
#include "spdlog/spdlog.h"
namespace
aom
{
Agent
::
Agent
(
Trial
*
owner
,
stub_type
stub
,
std
::
string
config_data
)
Agent
::
Agent
(
Trial
*
owner
,
stub_type
stub
,
std
::
optional
<
std
::
string
>
config_data
)
:
Actor
(
to_string
(
owner
->
id
()))
,
owner_
(
owner
)
,
stub_
(
std
::
move
(
stub
))
...
...
@@ -21,7 +21,9 @@ namespace aom {
cogment
::
AgentStartRequest
req
;
req
.
set_trial_id
(
trial_id
());
req
.
set_actor_id
(
actor_id
());
req
.
mutable_config
()
->
set_content
(
config_data_
);
if
(
config_data_
)
{
req
.
mutable_config
()
->
set_content
(
*
config_data_
);
}
for
(
auto
i
:
owner_
->
actor_counts
())
{
req
.
add_actor_counts
(
i
);
...
...
orchestrator/lib/aom/agent.h
View file @
edceb282
...
...
@@ -5,13 +5,15 @@
#include "aom/stub_pool.h"
#include "cogment/api/agent.egrpc.pb.h"
#include <optional>
namespace
aom
{
class
Trial
;
class
Agent
:
public
Actor
{
public:
using
stub_type
=
std
::
shared_ptr
<
aom
::
Stub_pool
<
cogment
::
Agent
>::
Entry
>
;
Agent
(
Trial
*
owner
,
stub_type
stub
,
std
::
string
config_data
);
Agent
(
Trial
*
owner
,
stub_type
stub
,
std
::
optional
<
std
::
string
>
config_data
);
~
Agent
();
Future
<
void
>
init
()
override
;
...
...
@@ -30,7 +32,7 @@ private:
Trial
*
owner_
;
stub_type
stub_
;
cogment
::
Action
latest_action_
;
std
::
string
config_data_
;
std
::
optional
<
std
::
string
>
config_data_
;
};
}
// namespace aom
...
...
orchestrator/lib/aom/trial.cpp
View file @
edceb282
...
...
@@ -77,9 +77,12 @@ Trial::~Trial() {
human_actor
->
actor_class
=
&
owner_
->
trial_spec_
.
actor_classes
[
class_id
];
actors_per_class
.
at
(
class_id
).
push_back
(
std
::
move
(
human_actor
));
}
else
{
std
::
optional
<
std
::
string
>
config
;
if
(
actor_info
.
has_config
())
{
config
=
actor_info
.
config
().
content
();
}
auto
stub_entry
=
owner_
->
agent_stubs_
.
get_stub
(
url
);
auto
actor
=
std
::
make_unique
<
Agent
>
(
this
,
stub_entry
,
actor_info
.
config
().
content
());
auto
actor
=
std
::
make_unique
<
Agent
>
(
this
,
stub_entry
,
config
);
actor
->
actor_class
=
&
owner_
->
trial_spec_
.
actor_classes
[
class_id
];
actors_per_class
.
at
(
class_id
).
push_back
(
std
::
move
(
actor
));
}
...
...
orchestrator/lib/version.txt
View file @
edceb282
0.2.2-beta
\ No newline at end of file
0.2.3-beta
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment