Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
Seminar-HFO
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
Seminar-HFO
Commits
77bcc245
Commit
77bcc245
authored
Apr 08, 2015
by
Matthew Hausknecht
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved action enums into hfo.hpp and put hfo head in src directory.
parent
6afa2197
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
37 deletions
+29
-37
CMakeLists.txt
CMakeLists.txt
+1
-2
example/hfo_example_agent.cpp
example/hfo_example_agent.cpp
+1
-0
src/HFO.hpp
src/HFO.hpp
+26
-9
src/agent.h
src/agent.h
+1
-26
No files found.
CMakeLists.txt
View file @
77bcc245
...
...
@@ -9,7 +9,6 @@ set(SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
set
(
CMAKE_RUNTIME_OUTPUT_DIRECTORY bin
)
include_directories
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/include
${
SOURCE_DIR
}
${
SOURCE_DIR
}
/chain_action
${
LIBRCSC_INCLUDE
}
...
...
@@ -37,7 +36,7 @@ add_executable(sample_coach ${SOURCE_DIR}/main_coach.cpp ${SOURCE_DIR}/sample_co
add_executable
(
sample_player
${
SOURCE_DIR
}
/main_player.cpp
${
SOURCE_DIR
}
/sample_player.cpp
${
SOURCES
}
)
add_executable
(
sample_trainer
${
SOURCE_DIR
}
/main_trainer.cpp
${
SOURCE_DIR
}
/sample_trainer.cpp
${
SOURCES
}
)
add_executable
(
agent
${
SOURCE_DIR
}
/main_agent.cpp
${
SOURCE_DIR
}
/agent.cpp
${
SOURCES
}
)
add_library
(
hfo-lib SHARED
${
CMAKE_CURRENT_SOURCE_DIR
}
/include
/HFO.hpp
${
SOURCE_DIR
}
/HFO.cpp
)
add_library
(
hfo-lib SHARED
${
SOURCE_DIR
}
/HFO.hpp
${
SOURCE_DIR
}
/HFO.cpp
)
set_target_properties
(
hfo-lib PROPERTIES OUTPUT_NAME hfo
)
set_target_properties
(
hfo-lib PROPERTIES LIBRARY_OUTPUT_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
/lib
)
...
...
example/hfo_example_agent.cpp
View file @
77bcc245
#include <iostream>
#include <vector>
#include <HFO.hpp>
#include <cstdlib>
using
namespace
std
;
...
...
include
/HFO.hpp
→
src
/HFO.hpp
View file @
77bcc245
...
...
@@ -2,7 +2,32 @@
#define __HFO_HPP__
#include <vector>
#include "agent.h"
// The actions available to the agent
enum
action_t
{
DASH
,
// Dash(power, relative_direction)
TURN
,
// Turn(direction)
TACKLE
,
// Tackle(direction)
KICK
,
// Kick(power, direction)
QUIT
// Special action to quit the game
};
// The current status of the HFO game
enum
hfo_status_t
{
IN_GAME
,
GOAL
,
CAPTURED_BY_DEFENSE
,
OUT_OF_BOUNDS
,
OUT_OF_TIME
};
struct
Action
{
action_t
action
;
float
arg1
;
float
arg2
;
};
class
HFOEnvironment
{
public:
...
...
@@ -15,14 +40,6 @@ class HFOEnvironment {
// Get the current state of the domain. Returns a reference to feature_vec.
const
std
::
vector
<
float
>&
getState
();
// The actions available to the agent
// enum action_t
// {
// DASH, // Dash(power, relative_direction)
// TURN, // Turn(direction)
// TACKLE, // Tackle(direction)
// KICK // Kick(power, direction)
// };
// Take an action and recieve the resulting game status
hfo_status_t
act
(
Action
action
);
...
...
src/agent.h
View file @
77bcc245
...
...
@@ -30,36 +30,11 @@
#include "action_generator.h"
#include "field_evaluator.h"
#include "communication.h"
#include "HFO.hpp"
#include <rcsc/player/player_agent.h>
#include <vector>
// The actions available to the agent
enum
action_t
{
DASH
,
// Dash(power, relative_direction)
TURN
,
// Turn(direction)
TACKLE
,
// Tackle(direction)
KICK
,
// Kick(power, direction)
QUIT
// Special action to quit the game
};
// The current status of the HFO game
enum
hfo_status_t
{
IN_GAME
,
GOAL
,
CAPTURED_BY_DEFENSE
,
OUT_OF_BOUNDS
,
OUT_OF_TIME
};
struct
Action
{
action_t
action
;
float
arg1
;
float
arg2
;
};
class
Agent
:
public
rcsc
::
PlayerAgent
{
public:
Agent
();
...
...
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