Comments (3)
The core of the controller is how it behaves when receiving each kind of message. Currently, we have the following landscape:
REQUEST_INIT_MSG
: Bookkeeping with agent interval data. Sent when the experiment is starting.REQUEST_REGISTER_MSG
: More bookkeeping with agent interval data. Sent when the experiment is starting.REQUEST_GAME_START_MSG
: Bookkeeping with agent game state. Sent when the game is starting.POLICY_MSG
: Load the policy sent in the message. Sent when the experiment is starting.STATE_MSG
: Sent by the adapter so the controller can choose an action. Sent while the game is running.ACTION_MSG
: Sent by the controller with the selected action. Sent while the game is running.REQUEST_BEHAVIOR_COUNT_MSG
: Get current behavior selection statistics. Sent when the game has finished.REQUEST_POLICY_MSG
: Never used.
Here is what I think would make sense:
START_EXPERIMENT_MSG
: Bookkeeping to start a new experiment, mergingREQUEST_INIT_MSG
andREQUEST_REGISTER_MSG
. It should work to reset a running experiment as well.START_GAME_MSG
: Bookkeeping to start a new game, as done byREQUEST_GAME_START_MSG
andPOLICY_MSG
. It should work to reset a running game as well.STATE_MSG
: Current game state sent while the game is running.ACTION_MSG
: Selected action sent while the game is running.REWARD_MSG
: Received reward sent while the game is running.FINISH_GAME_MSG
: Bookkeeping to finish the current game. This message should also sent the current agent policy, as done byREQUEST_POLICY_MSG
.FINISH_EXPERIMENT_MSG
: Bookkeeping to finish the current experiment. It should stop the controller process.ACK_MSG
: Sent by the controller after receiving a message that doesn't need to be replied.
I'm not really sure what to do with REQUEST_BEHAVIOR_COUNT_MSG
. This kind of message is specific to agents implementing Behavior Q-Learning and should be implemented only by them. Maybe, a message type to log statistics can be generic enough for any agent.
from multiagent-rl.
Commit becbeae is the first effort into refactoring the controller by implementing the messages explained above. Things are still missing though:
- Remove remaining message types from controller -
REQUEST_BEHAVIOR_COUNT_MSG
,REQUEST_POLICY_MSG
andPOLICY_MSG
- and move their functionality to the agents. - Game state should be encapsulated in the adapter instead of the controller, so the later can become more decoupled from the Pac-Man simulator.
from multiagent-rl.
There are still two controller behaviors with logic specific to the Pac-Man game:
_receive_state
_choose_action
After that, the controller will be pretty much experiment agnostic.
from multiagent-rl.
Related Issues (20)
- Re-structure modules
- Make simulation.py stop with CTRL-C
- Use absolute imports instead of changing the modules path
- Separate learn from action selection HOT 1
- Execute agent action selection in different threads
- Make simulation.py accept the same CLI arguments as adapter.py
- Create README.md for Pac-Man experiment HOT 1
- Remove all hardcoded imports to pacman package
- Create another reinforcement learning experiment HOT 1
- Fix Q-learning in windy experiment HOT 1
- Create setup.py to distribute as a package
- Update wiki after refactoring
- Use numpy in Q-learning
- Implement policy save and load in Windy World
- Remove package metadata
- Port to Python 3 HOT 1
- Investigate why Pac-Man isn't learning with basic Q-learning HOT 5
- Use inproc instead of TCP for ZMQ
- undergraduate thesis 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-rl.