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
8ad9a9e7
You need to sign in or sign up before continuing.
Commit
8ad9a9e7
authored
Mar 04, 2015
by
Matthew Hausknecht
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a method to get state features from the agent.
parent
e226996c
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
249 additions
and
146 deletions
+249
-146
src/agent.cpp
src/agent.cpp
+214
-88
src/agent.h
src/agent.h
+35
-58
No files found.
src/agent.cpp
View file @
8ad9a9e7
This diff is collapsed.
Click to expand it.
src/agent.h
View file @
8ad9a9e7
...
@@ -34,67 +34,44 @@
...
@@ -34,67 +34,44 @@
#include <rcsc/player/player_agent.h>
#include <rcsc/player/player_agent.h>
#include <vector>
#include <vector>
class
Agent
class
Agent
:
public
rcsc
::
PlayerAgent
{
:
public
rcsc
::
PlayerAgent
{
private:
Communication
::
Ptr
M_communication
;
FieldEvaluator
::
ConstPtr
M_field_evaluator
;
ActionGenerator
::
ConstPtr
M_action_generator
;
public:
public:
Agent
();
Agent
();
virtual
~
Agent
();
virtual
std
::
vector
<
float
>
getState
();
~
Agent
()
;
virtual
FieldEvaluator
::
ConstPtr
getFieldEvaluator
()
const
;
protected:
protected:
// You can override this method. But you must call
/*!
// PlayerAgent::initImpl() in this method.
You can override this method.
virtual
bool
initImpl
(
rcsc
::
CmdLineParser
&
cmd_parser
);
But you must call PlayerAgent::initImpl() in this method.
*/
// main decision
virtual
virtual
void
actionImpl
();
bool
initImpl
(
rcsc
::
CmdLineParser
&
cmd_parser
);
// communication decision
//! main decision
virtual
void
communicationImpl
();
virtual
virtual
void
handleActionStart
();
void
actionImpl
();
virtual
void
handleActionEnd
();
virtual
void
handleServerParam
();
//! communication decision
virtual
void
handlePlayerParam
();
virtual
virtual
void
handlePlayerType
();
void
communicationImpl
();
virtual
FieldEvaluator
::
ConstPtr
createFieldEvaluator
()
const
;
virtual
ActionGenerator
::
ConstPtr
createActionGenerator
()
const
;
virtual
void
handleActionStart
();
private:
virtual
// Add the angle and distance to the landmark to the feature_vec
void
handleActionEnd
();
void
addLandmarkFeature
(
const
rcsc
::
Vector2D
&
landmark
,
const
rcsc
::
Vector2D
&
self_pos
,
virtual
std
::
vector
<
float
>&
feature_vec
);
void
handleServerParam
();
virtual
void
handlePlayerParam
();
virtual
void
handlePlayerType
();
virtual
FieldEvaluator
::
ConstPtr
createFieldEvaluator
()
const
;
virtual
ActionGenerator
::
ConstPtr
createActionGenerator
()
const
;
private:
bool
doPreprocess
();
bool
doPreprocess
();
bool
doShoot
();
bool
doShoot
();
bool
doForceKick
();
bool
doForceKick
();
bool
doHeardPassReceive
();
bool
doHeardPassReceive
();
public:
Communication
::
Ptr
M_communication
;
virtual
FieldEvaluator
::
ConstPtr
M_field_evaluator
;
FieldEvaluator
::
ConstPtr
getFieldEvaluator
()
const
;
ActionGenerator
::
ConstPtr
M_action_generator
;
};
};
#endif
#endif
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