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
1a421360
You need to sign in or sign up before continuing.
Commit
1a421360
authored
Aug 12, 2017
by
drallensmith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Further cleanup
parent
7e600ca6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
24 deletions
+18
-24
src/agent.cpp
src/agent.cpp
+18
-23
src/agent.h
src/agent.h
+0
-1
No files found.
src/agent.cpp
View file @
1a421360
...
...
@@ -165,14 +165,6 @@ int Agent::getUnum() {
return
world
().
self
().
unum
();
}
void
Agent
::
setLastActionStatusCollision
(
bool
may_fix
,
bool
likely_success
)
{
if
(
likely_success
||
may_fix
)
{
last_action_status
=
true
;
}
else
{
last_action_status
=
false
;
}
}
bool
Agent
::
initImpl
(
CmdLineParser
&
cmd_parser
)
{
bool
result
=
PlayerAgent
::
initImpl
(
cmd_parser
);
...
...
@@ -270,10 +262,12 @@ void Agent::actionImpl() {
switch
(
requested_action
)
{
case
DASH
:
setLastActionStatusCollision
(
may_fix
,
this
->
doDash
(
params
[
0
],
params
[
1
]));
last_action_status
=
this
->
doDash
(
params
[
0
],
params
[
1
]);
last_action_status
|=
wm
.
self
().
collidesWithPost
();
// Can sometimes get out of collision
break
;
case
TURN
:
setLastActionStatusCollision
(
may_fix
,
this
->
doTurn
(
params
[
0
]));
last_action_status
=
this
->
doTurn
(
params
[
0
]);
last_action_status
|=
wm
.
self
().
collidesWithPost
();
// ditto
break
;
case
TACKLE
:
last_action_status
=
this
->
doTackle
(
params
[
0
],
false
);
...
...
@@ -290,22 +284,23 @@ void Agent::actionImpl() {
break
;
case
MOVE_TO
:
if
(
feature_extractor
!=
NULL
)
{
setLastActionStatusCollision
(
may_fix
,
Body_GoToPoint
(
Vector2D
(
feature_extractor
->
absoluteXPos
(
params
[
0
]),
last_action_status
=
Body_GoToPoint
(
Vector2D
(
feature_extractor
->
absoluteXPos
(
params
[
0
]),
feature_extractor
->
absoluteYPos
(
params
[
1
])),
0.25
,
ServerParam
::
i
().
maxDashPower
()).
execute
(
this
));
ServerParam
::
i
().
maxDashPower
()).
execute
(
this
);
last_action_status
|=
wm
.
self
().
collidesWithPost
();
// can get out of collision w/post
}
break
;
case
DRIBBLE_TO
:
if
(
feature_extractor
!=
NULL
)
{
setLastActionStatusCollision
(
may_fix
,
Body_Dribble
(
Vector2D
(
feature_extractor
->
absoluteXPos
(
params
[
0
]),
last_action_status
=
Body_Dribble
(
Vector2D
(
feature_extractor
->
absoluteXPos
(
params
[
0
]),
feature_extractor
->
absoluteYPos
(
params
[
1
])),
1.0
,
ServerParam
::
i
().
maxDashPower
(),
2
).
execute
(
this
));
ServerParam
::
i
().
maxDashPower
(),
2
).
execute
(
this
);
last_action_status
|=
wm
.
self
().
collidesWithPost
();
// ditto
}
break
;
case
INTERCEPT
:
setLastActionStatusCollision
(
may_fix
,
Body_Intercept
().
execute
(
this
));
last_action_status
=
Body_Intercept
().
execute
(
this
);
last_action_status
|=
wm
.
self
().
collidesWithPost
();
// ditto
break
;
case
MOVE
:
last_action_status
=
this
->
doMove
();
...
...
@@ -914,13 +909,13 @@ Agent::doDribble()
M_action_generator
=
ActionGenerator
::
ConstPtr
(
g
);
ActionChainHolder
::
instance
().
setFieldEvaluator
(
M_field_evaluator
);
ActionChainHolder
::
instance
().
setActionGenerator
(
M_action_generator
);
success
=
doPreprocess
();
bool
preprocess_
success
=
doPreprocess
();
ActionChainHolder
::
instance
().
update
(
world
()
);
if
(
Bhv_ChainAction
(
ActionChainHolder
::
instance
().
graph
()).
execute
(
this
))
{
if
(
Bhv_ChainAction
(
ActionChainHolder
::
instance
().
graph
()).
execute
(
this
)
||
preprocess_success
)
{
return
true
;
}
else
{
return
success
;
}
return
false
;
}
/*-------------------------------------------------------------------*/
...
...
src/agent.h
View file @
1a421360
...
...
@@ -99,7 +99,6 @@ protected:
bool
doDefendGoal
();
bool
doGoToBall
();
bool
doNewAction1
();
void
setLastActionStatusCollision
(
bool
may_fix
,
bool
likely_success
);
Communication
::
Ptr
M_communication
;
...
...
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