# wrighteaglebase
[![Build Status](https://travis-ci.org/wrighteagle2d/wrighteaglebase.svg?branch=master)](https://travis-ci.org/wrighteagle2d/wrighteaglebase)
This is the code release of WrightEagleBASE, which serves as the basic framework of [WrightEagle](https://wrighteagle2d.github.io/).
A video from RoboCup 2015 final -- HELIOS2015 v.s. WrightEagle2015 -- is as follows.
[![RoboCup 2015 Final Video](data/robocup2015final.gif)](http://www.youtube.com/watch?v=Ptzv9NF9opM "RoboCup2015 Soccer Simulation 2D Final")
# Highlights
- WrightEagle has won 6 **world champions** and 5 runners-up in annual RoboCup Soccer Simulation 2D competitions since 2005. Detailed historical results from 2005 to 2013 can be found as follows:
![data/results.png](data/results.png "Historical Results")
- WrightEagle/WrightEagleBASE is developed following the [MAXQ-OP](https://github.com/aijunbai/taxi) online planning algorithm for [Markov Decision Processes](https://en.wikipedia.org/wiki/Markov_decision_process). The [MAXQ-OP](https://github.com/aijunbai/taxi) task structure of the agent:
![data/wrighteagle.png](data/wrighteagle.png "MAXQ Task Graph")
# Binaries
For latest WrightEagle binaries used in [RoboCup Soccer Simulation 2D](https://en.wikipedia.org/wiki/RoboCup_2D_Soccer_Simulation_League) competitions, please refer to: [https://wrighteagle2d.github.io/](https://wrighteagle2d.github.io/)
# References
Researchers are encouraged to cite the following selected publications
when using WrightEagleBASE/WrightEagle codes/binaries/tools/materials in
research.
- **Online planning for large Markov decision processes with
hierarchical decomposition**, Aijun Bai, Feng Wu, and Xiaoping
Chen, _ACM Transactions on Intelligent Systems and Technology (ACM
TIST),6(4):45:1–45:28, July 2015._
\[[pdf](http://aijunbai.github.io/publications/TIST15-Bai.pdf)\]
\[[appendix](http://aijunbai.github.io/publications/TIST15-Bai_app.pdf)\]
\[[bib](http://aijunbai.github.io/publications/TIST15-Bai.bib)\]
- **Towards a Principled Solution to Simulated Robot Soccer**, Aijun
Bai, Feng Wu, and Xiaoping Chen, _RoboCup-2012: Robot Soccer World Cup XVI, Lecture Notes in
Artificial Intelligence, Vol. 7500, Springer Verlag, Berlin, 2013._
\[[pdf](http://aijunbai.github.io/publications/LNAI12-Bai.pdf)\]
\[[bib](http://aijunbai.github.io/publications/LNAI12-Bai.bib)\]
\[[slides](http://aijunbai.github.io/slides/LNAI12-Bai_slides.pdf)\]
- **Online Planning for Large MDPs with MAXQ Decomposition** (Extended
Abstract), Aijun Bai, Feng Wu, and Xiaoping Chen, _Proceedings of the 11th International Conference on Autonomous
Agents and Multiagent Systems (AAMAS), Valencia, Spain, June 2012._
\[[pdf](http://aijunbai.github.io/publications/AAMAS12-Bai.pdf)\]
\[[bib](http://aijunbai.github.io/publications/AAMAS12-Bai.bib)\]
\[[code](https://github.com/aijunbai/maxq-op)\]
- **WrightEagle and UT Austin Villa: RoboCup 2011 Simulation League
Champions**, Aijun Bai, Xiaoping Chen, Patrick MacAlpine, Daniel
Urieli, Samuel Barrett, and Peter Stone, _RoboCup-2011: Robot Soccer World Cup XV, Lecture Notes in
Artificial Intelligence, Vol. 7416, Springer Verlag, Berlin, 2012._
\[[pdf](http://aijunbai.github.io/publications/LNAI11-Bai.pdf)\]
\[[code](https://github.com/wrighteagle2d/wrighteaglebase)\]
- **Bounded Incremental Real-Time Dynamic Programming**, Changjie Fan,
and Xiaoping Chen, _IEEE Proceedings Frontiers in the Convergence of Bioscience and
Information Technologies of 2007 (FBIT), Jeju Island, Korea, 2007._
\[[pdf](http://ieeexplore.ieee.org/xpl/login.jsp?tp=&arnumber=4524180&url=http%3A%2F%2Fieeexplore.ieee.org%2Fxpls%2Fabs_all.jsp%3Farnumber%3D4524180)\]
- **Solving Large-Scale and Sparse-Reward DEC-POMDPs with
Correlation-MDPs**, Feng Wu, and Xiaoping Chen, _Proceedings of
RoboCup Symposium 2007. Atlanta, America, July 2007._
\[[pdf](http://link.springer.com/chapter/10.1007%2F978-3-540-68847-1_18)\]
# Videos
- [Final of RoboCup 2015](https://www.youtube.com/watch?v=Ptzv9NF9opM) (HELIOS2015_0-vs-WrightEagle_3)
- [Final of RoboCup 2014](https://www.youtube.com/watch?v=kRIygFjlD_Q) (WrightEagle_3-vs-Gliders2014_2)
- [Final of RoboCup 2013](https://www.youtube.com/watch?v=BoWoIc4IrtI) (WrightEagle_2-vs-HELIOS2013_0)
- [Final of RoboCup 2012](https://www.youtube.com/watch?v=cDhSjSYPvdE) (HELIOS2012_4-vs-WrightEagle_1)
- [Final of RoboCup 2011](https://www.youtube.com/watch?v=leNDA5tzUfk) (WrightEagle_3-vs-HELIOS2011_2)
- [Final of RoboCup 2010](https://www.youtube.com/watch?v=BVWkndHk3AE) (HELIOS2010_2-vs-WrightEagle_1)
- [Final of RoboCup 2009](https://www.youtube.com/watch?v=Q18Wxs3Da-8&index=7&list=PL4BB027D8BB6A5EB3) (HELIOS2009_1-vs-WrightEagle_2)
- [Final of RoboCup 2008](https://www.youtube.com/watch?v=w1c_8TWX8dY) (Brainstormers08_0_4-vs-WE2008_0_3)
- [Final of RoboCup 2007](https://www.youtube.com/watch?v=ceDDg_l6_J0) (Brainstormers07_3-vs-WE2007_0)
- [Final of RoboCup 2005](https://www.youtube.com/watch?v=FiFj0HQXaGw) (Brainstormers05_3-vs-WE2005_0)
# Install
- `sudo add-apt-repository ppa:gnurubuntu/rubuntu`
- `sudo apt update`
- `sudo apt install rcssserver rcssmonitor rcsslogplayer`
- `git clone https://github.com/wrighteagle2d/wrighteaglebase`
# Compiling
- `cd wrighteaglebase`
- Run `make [debug]` for a debug version with debugging information and assertions
- Run `make release` for a release version
# Usages
A [RoboCup Soccer 2D Simulator](https://sourceforge.net/projects/sserver/files/) (as well as a monitor and a logplayer) is needed to run WrightEagleBASE. Please refer to [https://wavepackage.wordpress.com/2013/06/07/how-to-install-the-robocup-soccer-server-2d/](https://wavepackage.wordpress.com/2013/06/07/how-to-install-the-robocup-soccer-server-2d/) and [https://wavepackage.wordpress.com/2015/07/22/how-to-install-robocup-2d-simulation-server-on-ubuntu-14-04/](https://wavepackage.wordpress.com/2015/07/22/how-to-install-robocup-2d-simulation-server-on-ubuntu-14-04/) for installation instructions.
After installation,
- Run `rcssserver` to start a soccer server which simulates the game
- Run `rcssmonitor` to start a soccer monitor which is used to display the game
- Run `./start.sh` to start a team on the left side with default teamname _WEBase_
- Run `./start.sh -t [TEAMNAME]` to start a team on the right side with teamname _[TEAMNAME]_
After both teams are connected, send a `KickOff` command to the server by hitting `Ctrl+K` in the monitor to start the game!
# Tutorials
- [Introduction to WrightEagleBASE 4.0](http://wrighteagle2d.github.io/materials/14/Introduction-to-WrightEagle-Base.pdf), Rongya Chen, USTC, 2014
- [Introduction to WrightEagleBASE 3.0](http://wrighteagle2d.github.io/materials/12/Introduction-to-WrightEagle-Base.pdf), Jiang Miao, USTC, 2012
- [Brief Introduction to WrightEagleBASE 2.0 (in Chinese)](http://wrighteagle2d.github.io/materials/11/Brief-Introduction-to-WrightEagleBASE.pdf), Aijun Bai, USTC, 2011
- [Introduction to WrightEagleBASE 2.0 (in Chinese)](http://wrighteagle2d.github.io/materials/10/Introduction-to-WrightEagleBASE.pdf), Aijun Bai, USTC, 2010
- [Introduction to WrightEagleBASE 1.0 (in Chinese)](http://wrighteagle2d.github.io/materials/09/WE2009_Base.ppt), Yuhang Wang, USTC, 2009
# Hacks
- `void Player::Run` in `src/Player.cpp` is the main loop consisting of sensing, decision-making and executing
- `ActiveBehavior DecisionTree::Search` in `src/DecisionTree.cpp` is the main decision-making loop
- `void Behavior*::Plan` in `src/Behavior*.cpp` implement planning part of behaviours
- `void Behavior*::Execute` in `src/Behavior*.cpp` implement executing part of behaviours
A good starting point to hack the team is digging into `void Behavior*::Plan` functions.
# Related Project
- MAXQ-OP on standard Taxi domain: [https://github.com/aijunbai/taxi](https://github.com/aijunbai/taxi)