Giter Club home page Giter Club logo

hfo's Introduction

RoboCup 2D Half Field Offense

Build Status

3 on 3 HFO

Half Field Offense in RoboCup 2D Soccer is a subtask in RoboCup simulated soccer, modeling a situation in which the offense of one team has to get past the defense of the opposition in order to shoot goals. This repository offers the ability to quickly and easily interface your learning agent with the HFO domain. Interfaces are provided for C++ and Python.

Dependencies

  • Boost-system, filesystem
  • Qt4 [Required for SoccerWindow2 visualizer]: To not build the visualizer, add cmake flag -DBUILD_SOCCERWINDOW=False

Install

mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4
make install

Python Install [required for python interface]

From the main HFO directory: pip install [--user] .

Demos

From the main HFO directory:

./example/passing_agents.sh

Start a 1v1 game played by Agent2D:

./bin/HFO --offense-npcs=1 --defense-npcs=1 --no-sync

Start an example agent on the empty goal task. This agent will move forwards slowly. First start the server: ./bin/HFO --offense-agents=1 --no-sync & and then connect the agent: ./example/hfo_example_agent

Or do both in a single command:

(./bin/HFO --offense-agents=1 --no-sync &) && ./example/hfo_example_agent

Example Agents

Example agents are provided in the example directory. Below are two minimal examples:

C++ Agent

HFOEnvironment hfo;
hfo.connectToServer(...);
for (int episode=0; episode<5; episode++) {
  status_t status = IN_GAME;
  while (status == IN_GAME) {
    const std::vector<float>& feature_vec = hfo.getState();
    hfo.act(DASH, 20.0, 0.0);
    status = hfo.step();
  }
  cout << "Episode " << episode << " ended";
}

Python Agent

hfo = hfo.HFOEnvironment()
hfo.connectServer(...)
for episode in xrange(5):
  status = IN_GAME
  while status == IN_GAME:
    features = hfo.getState()
    hfo.act(DASH, 20.0, 0.0)
    status = hfo.step()
  print 'Episode', episode, 'ended'

Documentation

The state and action spaces provided by the HFO domain are documented in the manual.

hfo's People

Contributors

mhauskn avatar sanmit avatar uniq10 avatar cowhi avatar f-leno avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.