Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Neural MMO
neural-mmo-starter-kit
Commits
30f72fde
Commit
30f72fde
authored
Dec 03, 2021
by
Siddhartha Laghuvarapu
Browse files
Add neural baseline agent
parent
9c7e5386
Changes
2
Hide whitespace changes
Inline
Side-by-side
agents/neural_baseline_agent.py
View file @
30f72fde
...
...
@@ -31,11 +31,11 @@ class NeuralBaselineMultiAgent(NeuralMMOMultiAgent):
self
.
config
=
projekt
.
config
.
CompetitionRound2
()
max_agents
=
8
self
.
agent_types
=
[
"neural"
for
i
in
range
(
max_agents
)]
self
.
agent
s
=
[
loadModel
(
self
.
config
)
for
i
in
range
(
max_agents
)]
self
.
agent
=
loadModel
(
self
.
config
)
def
register_reset
(
self
,
observations
,
agent_idx
):
agent_observations
=
observations
[
agent_idx
]
actions
,
self
.
state
,
_
=
self
.
agent
s
[
agent_idx
]
.
compute_actions
(
actions
,
self
.
state
,
_
=
self
.
agent
.
compute_actions
(
{
0
:
agent_observations
},
state
=
{},
policy_id
=
"policy_0"
)
return
actions
[
0
]
...
...
config.py
View file @
30f72fde
...
...
@@ -2,7 +2,7 @@ from agents import NeuralBaselineMultiAgent, ScriptedBaselineMultiAgent, Scripte
class
LocalEvaluationConfig
:
player_agents
=
[
Scripted
BaselineMultiAgent
Random
]
player_agents
=
[
Neural
BaselineMultiAgent
]
opponents
=
[]
opponents
+=
[
ScriptedBaselineMultiAgent
]
*
15
...
...
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