Comments (5)
@Northernwolf, I'm not a maintainer/author but I was playing around with it this morning and I think I have a simple example that you can use to give all agents in the environment a random action for any of these environments, just replace make_env('simple_push')
with the name of the scenario you want to watch:
from make_env import make_env
import numpy as np
env = make_env('simple_push')
for i_episode in range(20):
observation = env.reset()
for t in range(100):
env.render()
agent_actions = []
for i, agent in enumerate(env.world.agents):
# This is a Discrete
# https://github.com/openai/gym/blob/master/gym/spaces/discrete.py
agent_action_space = env.action_space[i]
# Sample returns an int from 0 to agent_action_space.n
action = agent_action_space.sample()
# Environment expects a vector with length == agent_action_space.n
# containing 0 or 1 for each action, 1 meaning take this action
action_vec = np.zeros(agent_action_space.n)
action_vec[action] = 1
agent_actions.append(action_vec)
# Each of these is a vector parallel to env.world.agents, as is agent_actions
observation, reward, done, info = env.step(agent_actions)
print (observation)
print (reward)
print (done)
print (info)
print()
Hope it helps!
from multiagent-particle-envs.
Agree. If you OpenAI guys can release a simple example of random agents in all environment, then it will be a great relief. Hope there will be a explanation of the action space and how to take action in different environments, since it's quiet confusing. Thank you.
from multiagent-particle-envs.
I really wish that they specified if the wanted vector is one-hot encoded or just probabilities of taking that action. It is very unclear from the documentation :((
from multiagent-particle-envs.
I have the same question,What is Discrete mean,a integer?
And in the experiments of paper,how to use the action,and what is the network output?
What is the dimensionality of action,how to use it to change agent position and velocity? apply_action_force 、apply_environment_force in core.py changed it,but how to use it when action is continuous?
Have many other questions in recurrence your experiments, and I email you @ryan-lowe,wish you can give a example of how to use the platform,Thank you!
from multiagent-particle-envs.
Hi
I apologize for taking so long to get to this. We've finally released some code for training agents on this domain, which is publicly available here: https://github.com/openai/maddpg
-Ryan
from multiagent-particle-envs.
Related Issues (20)
- raise NotImplementedError
- FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Jarvis\\Desktop\\r-maac-main\\multiagent\\scenarios\\spread_collect.py'
- This code base is no longer maintained HOT 3
- the code about good_agents & adversaries at simple_tag.py
- What is the input form of the action in the‘simple_reference’? HOT 2
- If want to change the scenario from simple to other, how should I do? HOT 1
- Centralized learning-decentralized execution clarification (engineering perspective)
- how to restore the game process after so many times of episodes?
- Turn the environment into 3D HOT 2
- Questions about agent`s state information in MADDPG
- Running timeout!
- cant run different scenarios except simply.py HOT 1
- NN code
- Use the checkpoint file to continue training
- How to delete a landmark when training HOT 1
- Index error: list index out of range
- Questions about simple_spread agent actions
- Add image as background
- RuntimeWarning: invalid value encountered in logaddexp
- Wrong reward in simple speaker listener HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from multiagent-particle-envs.