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
e79acb54
Commit
e79acb54
authored
Jun 26, 2016
by
Matthew Hausknecht
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reintroduce osx compatibility.
parent
30f6e304
Changes
26
Show whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
183 additions
and
3 deletions
+183
-3
CMakeLists.txt
CMakeLists.txt
+3
-0
bin/Trainer.py
bin/Trainer.py
+3
-1
example/passing_agents.sh
example/passing_agents.sh
+1
-1
src/bhv_basic_tackle.cpp
src/bhv_basic_tackle.cpp
+6
-0
src/bhv_force_pass.cpp
src/bhv_force_pass.cpp
+16
-0
src/bhv_goalie_free_kick.cpp
src/bhv_goalie_free_kick.cpp
+6
-0
src/bhv_penalty_kick.cpp
src/bhv_penalty_kick.cpp
+4
-0
src/bhv_prepare_set_play_kick.cpp
src/bhv_prepare_set_play_kick.cpp
+4
-0
src/chain_action/actgen_direct_pass.cpp
src/chain_action/actgen_direct_pass.cpp
+5
-0
src/chain_action/actgen_simple_dribble.cpp
src/chain_action/actgen_simple_dribble.cpp
+5
-0
src/chain_action/action_chain_holder.cpp
src/chain_action/action_chain_holder.cpp
+10
-0
src/chain_action/bhv_chain_action.cpp
src/chain_action/bhv_chain_action.cpp
+5
-0
src/chain_action/bhv_pass_kick_find_receiver.cpp
src/chain_action/bhv_pass_kick_find_receiver.cpp
+5
-0
src/chain_action/clear_generator.cpp
src/chain_action/clear_generator.cpp
+4
-0
src/chain_action/cross_generator.cpp
src/chain_action/cross_generator.cpp
+8
-0
src/chain_action/field_analyzer.cpp
src/chain_action/field_analyzer.cpp
+8
-0
src/chain_action/self_pass_generator.cpp
src/chain_action/self_pass_generator.cpp
+8
-0
src/chain_action/shoot_generator.cpp
src/chain_action/shoot_generator.cpp
+8
-0
src/chain_action/short_dribble_generator.cpp
src/chain_action/short_dribble_generator.cpp
+8
-0
src/chain_action/strict_check_pass_generator.cpp
src/chain_action/strict_check_pass_generator.cpp
+4
-0
src/chain_action/tackle_generator.cpp
src/chain_action/tackle_generator.cpp
+8
-0
src/sample_coach.cpp
src/sample_coach.cpp
+8
-0
src/sample_communication.cpp
src/sample_communication.cpp
+4
-0
src/sample_trainer.cpp
src/sample_trainer.cpp
+18
-1
src/soccer_role.cpp
src/soccer_role.cpp
+4
-0
src/strategy.cpp
src/strategy.cpp
+20
-0
No files found.
CMakeLists.txt
View file @
e79acb54
...
@@ -7,6 +7,9 @@ option(INSTALL_ADDITIONAL_TEAMS "Install additional team binaries" ON)
...
@@ -7,6 +7,9 @@ option(INSTALL_ADDITIONAL_TEAMS "Install additional team binaries" ON)
add_definitions
(
-DELOG -std=c++11
)
add_definitions
(
-DELOG -std=c++11
)
find_package
(
BOOST 1.45.0 COMPONENTS scoped_ptr
)
include_directories
(
${
Boost_INCLUDE_DIRS
}
)
ExternalProject_Add
(
rcssserver
ExternalProject_Add
(
rcssserver
GIT_REPOSITORY
"https://github.com/mhauskn/rcssserver.git"
GIT_REPOSITORY
"https://github.com/mhauskn/rcssserver.git"
GIT_TAG
"master"
GIT_TAG
"master"
...
...
bin/Trainer.py
View file @
e79acb54
...
@@ -305,7 +305,9 @@ class Trainer(object):
...
@@ -305,7 +305,9 @@ class Trainer(object):
def
disconnectPlayer
(
self
,
player
,
player_num
,
on_offense
):
def
disconnectPlayer
(
self
,
player
,
player_num
,
on_offense
):
"""Wait on a launched player to disconnect from the server. """
"""Wait on a launched player to disconnect from the server. """
team_name
=
self
.
_offenseTeamName
if
on_offense
else
self
.
_defenseTeamName
team_name
=
self
.
_offenseTeamName
if
on_offense
else
self
.
_defenseTeamName
while
(
team_name
,
str
(
player_num
))
in
self
.
_connectedPlayers
:
self
.
send
(
'(disconnect_player
%
s
%
d)'
%
(
team_name
,
player_num
))
self
.
send
(
'(disconnect_player
%
s
%
d)'
%
(
team_name
,
player_num
))
self
.
getConnectedPlayers
()
player
.
kill
()
player
.
kill
()
def
getConnectedPlayers
(
self
):
def
getConnectedPlayers
(
self
):
...
...
example/passing_agents.sh
View file @
e79acb54
#!/bin/bash
#!/bin/bash
./bin/HFO
--offense-agents
=
2
--no-sync
&
./bin/HFO
--offense-agents
=
2
--no-sync
--fullstate
&
sleep
5
sleep
5
./example/communication_agent 6000 &
./example/communication_agent 6000 &
sleep
5
sleep
5
...
...
src/bhv_basic_tackle.cpp
View file @
e79acb54
...
@@ -193,9 +193,15 @@ Bhv_BasicTackle::executeOld( PlayerAgent * agent )
...
@@ -193,9 +193,15 @@ Bhv_BasicTackle::executeOld( PlayerAgent * agent )
bool
bool
Bhv_BasicTackle
::
executeV12
(
PlayerAgent
*
agent
)
Bhv_BasicTackle
::
executeV12
(
PlayerAgent
*
agent
)
{
{
#ifdef __APPLE__
static
GameTime
s_last_execute_time
(
0
,
0
);
static
bool
s_result
=
false
;
static
AngleDeg
s_best_angle
=
0.0
;
#else
static
thread_local
GameTime
s_last_execute_time
(
0
,
0
);
static
thread_local
GameTime
s_last_execute_time
(
0
,
0
);
static
thread_local
bool
s_result
=
false
;
static
thread_local
bool
s_result
=
false
;
static
thread_local
AngleDeg
s_best_angle
=
0.0
;
static
thread_local
AngleDeg
s_best_angle
=
0.0
;
#endif
const
WorldModel
&
wm
=
agent
->
world
();
const
WorldModel
&
wm
=
agent
->
world
();
...
...
src/bhv_force_pass.cpp
View file @
e79acb54
...
@@ -122,11 +122,19 @@ Force_Pass::get_best_pass( const WorldModel & world,
...
@@ -122,11 +122,19 @@ Force_Pass::get_best_pass( const WorldModel & world,
double
*
first_speed
,
double
*
first_speed
,
int
*
receiver
)
int
*
receiver
)
{
{
#ifdef __APPLE__
static
GameTime
S_last_calc_time
(
0
,
0
);
static
bool
S_last_calc_valid
=
false
;
static
Vector2D
S_last_calc_target
;
static
double
S_last_calc_speed
=
0.0
;
static
int
S_last_calc_receiver
=
Unum_Unknown
;
#else
static
thread_local
GameTime
S_last_calc_time
(
0
,
0
);
static
thread_local
GameTime
S_last_calc_time
(
0
,
0
);
static
thread_local
bool
S_last_calc_valid
=
false
;
static
thread_local
bool
S_last_calc_valid
=
false
;
static
thread_local
Vector2D
S_last_calc_target
;
static
thread_local
Vector2D
S_last_calc_target
;
static
thread_local
double
S_last_calc_speed
=
0.0
;
static
thread_local
double
S_last_calc_speed
=
0.0
;
static
thread_local
int
S_last_calc_receiver
=
Unum_Unknown
;
static
thread_local
int
S_last_calc_receiver
=
Unum_Unknown
;
#endif
if
(
S_last_calc_time
==
world
.
time
()
)
if
(
S_last_calc_time
==
world
.
time
()
)
{
{
...
@@ -208,11 +216,19 @@ bool
...
@@ -208,11 +216,19 @@ bool
Force_Pass
::
get_pass_to_player
(
const
WorldModel
&
world
,
Force_Pass
::
get_pass_to_player
(
const
WorldModel
&
world
,
int
receiver_unum
)
int
receiver_unum
)
{
{
#ifdef __APPLE__
static
GameTime
S_last_calc_time
(
0
,
0
);
static
bool
S_last_calc_valid
=
false
;
static
Vector2D
S_last_calc_target
;
static
double
S_last_calc_speed
=
0.0
;
static
int
S_last_calc_receiver
=
Unum_Unknown
;
#else
static
thread_local
GameTime
S_last_calc_time
(
0
,
0
);
static
thread_local
GameTime
S_last_calc_time
(
0
,
0
);
static
thread_local
bool
S_last_calc_valid
=
false
;
static
thread_local
bool
S_last_calc_valid
=
false
;
static
thread_local
Vector2D
S_last_calc_target
;
static
thread_local
Vector2D
S_last_calc_target
;
static
thread_local
double
S_last_calc_speed
=
0.0
;
static
thread_local
double
S_last_calc_speed
=
0.0
;
static
thread_local
int
S_last_calc_receiver
=
Unum_Unknown
;
static
thread_local
int
S_last_calc_receiver
=
Unum_Unknown
;
#endif
if
(
S_last_calc_time
==
world
.
time
()
)
if
(
S_last_calc_time
==
world
.
time
()
)
{
{
...
...
src/bhv_goalie_free_kick.cpp
View file @
e79acb54
...
@@ -53,9 +53,15 @@
...
@@ -53,9 +53,15 @@
bool
bool
Bhv_GoalieFreeKick
::
execute
(
rcsc
::
PlayerAgent
*
agent
)
Bhv_GoalieFreeKick
::
execute
(
rcsc
::
PlayerAgent
*
agent
)
{
{
#ifdef __APPLE__
static
bool
s_first_move
=
false
;
static
bool
s_second_move
=
false
;
static
int
s_second_wait_count
=
0
;
#else
static
thread_local
bool
s_first_move
=
false
;
static
thread_local
bool
s_first_move
=
false
;
static
thread_local
bool
s_second_move
=
false
;
static
thread_local
bool
s_second_move
=
false
;
static
thread_local
int
s_second_wait_count
=
0
;
static
thread_local
int
s_second_wait_count
=
0
;
#endif
rcsc
::
dlog
.
addText
(
rcsc
::
Logger
::
TEAM
,
rcsc
::
dlog
.
addText
(
rcsc
::
Logger
::
TEAM
,
__FILE__
": Bhf_GoalieFreeKick"
);
__FILE__
": Bhf_GoalieFreeKick"
);
...
...
src/bhv_penalty_kick.cpp
View file @
e79acb54
...
@@ -622,7 +622,11 @@ bool
...
@@ -622,7 +622,11 @@ bool
Bhv_PenaltyKick
::
doDribble
(
PlayerAgent
*
agent
)
Bhv_PenaltyKick
::
doDribble
(
PlayerAgent
*
agent
)
{
{
static
const
int
CONTINUAL_COUNT
=
20
;
static
const
int
CONTINUAL_COUNT
=
20
;
#ifdef __APPLE__
static
int
S_target_continual_count
=
CONTINUAL_COUNT
;
#else
static
thread_local
int
S_target_continual_count
=
CONTINUAL_COUNT
;
static
thread_local
int
S_target_continual_count
=
CONTINUAL_COUNT
;
#endif
const
ServerParam
&
SP
=
ServerParam
::
i
();
const
ServerParam
&
SP
=
ServerParam
::
i
();
const
WorldModel
&
wm
=
agent
->
world
();
const
WorldModel
&
wm
=
agent
->
world
();
...
...
src/bhv_prepare_set_play_kick.cpp
View file @
e79acb54
...
@@ -51,7 +51,11 @@ using namespace rcsc;
...
@@ -51,7 +51,11 @@ using namespace rcsc;
bool
bool
Bhv_PrepareSetPlayKick
::
execute
(
PlayerAgent
*
agent
)
Bhv_PrepareSetPlayKick
::
execute
(
PlayerAgent
*
agent
)
{
{
#ifdef __APPLE__
static
int
s_rest_wait_cycle
=
-
1
;
#else
static
thread_local
int
s_rest_wait_cycle
=
-
1
;
static
thread_local
int
s_rest_wait_cycle
=
-
1
;
#endif
// not reach the ball side
// not reach the ball side
if
(
Bhv_GoToStaticBall
(
M_ball_place_angle
).
execute
(
agent
)
)
if
(
Bhv_GoToStaticBall
(
M_ball_place_angle
).
execute
(
agent
)
)
...
...
src/chain_action/actgen_direct_pass.cpp
View file @
e79acb54
...
@@ -113,8 +113,13 @@ ActGen_DirectPass::generate( std::vector< ActionStatePair > * result,
...
@@ -113,8 +113,13 @@ ActGen_DirectPass::generate( std::vector< ActionStatePair > * result,
const
std
::
vector
<
ActionStatePair
>
&
path
)
const
const
std
::
vector
<
ActionStatePair
>
&
path
)
const
{
{
static
const
int
VALID_PLAYER_THRESHOLD
=
10
;
static
const
int
VALID_PLAYER_THRESHOLD
=
10
;
#ifdef __APPLE__
static
GameTime
s_last_call_time
(
0
,
0
);
static
int
s_action_count
=
0
;
#else
static
thread_local
GameTime
s_last_call_time
(
0
,
0
);
static
thread_local
GameTime
s_last_call_time
(
0
,
0
);
static
thread_local
int
s_action_count
=
0
;
static
thread_local
int
s_action_count
=
0
;
#endif
if
(
current_wm
.
time
()
!=
s_last_call_time
)
if
(
current_wm
.
time
()
!=
s_last_call_time
)
{
{
...
...
src/chain_action/actgen_simple_dribble.cpp
View file @
e79acb54
...
@@ -56,8 +56,13 @@ ActGen_SimpleDribble::generate( std::vector< ActionStatePair > * result,
...
@@ -56,8 +56,13 @@ ActGen_SimpleDribble::generate( std::vector< ActionStatePair > * result,
const
WorldModel
&
current_wm
,
const
WorldModel
&
current_wm
,
const
std
::
vector
<
ActionStatePair
>
&
path
)
const
const
std
::
vector
<
ActionStatePair
>
&
path
)
const
{
{
#ifdef __APPLE__
static
GameTime
s_last_call_time
(
0
,
0
);
static
int
s_action_count
=
0
;
#else
static
thread_local
GameTime
s_last_call_time
(
0
,
0
);
static
thread_local
GameTime
s_last_call_time
(
0
,
0
);
static
thread_local
int
s_action_count
=
0
;
static
thread_local
int
s_action_count
=
0
;
#endif
if
(
current_wm
.
time
()
!=
s_last_call_time
)
if
(
current_wm
.
time
()
!=
s_last_call_time
)
{
{
...
...
src/chain_action/action_chain_holder.cpp
View file @
e79acb54
...
@@ -57,7 +57,11 @@ ActionChainHolder::ActionChainHolder()
...
@@ -57,7 +57,11 @@ ActionChainHolder::ActionChainHolder()
ActionChainHolder
&
ActionChainHolder
&
ActionChainHolder
::
instance
()
ActionChainHolder
::
instance
()
{
{
#ifdef __APPLE__
static
ActionChainHolder
s_instance
;
#else
static
thread_local
ActionChainHolder
s_instance
;
static
thread_local
ActionChainHolder
s_instance
;
#endif
return
s_instance
;
return
s_instance
;
}
}
...
@@ -119,9 +123,15 @@ ActionChainHolder::actionGenerator() const
...
@@ -119,9 +123,15 @@ ActionChainHolder::actionGenerator() const
void
void
ActionChainHolder
::
update
(
const
WorldModel
&
wm
)
ActionChainHolder
::
update
(
const
WorldModel
&
wm
)
{
{
#ifdef __APPLE__
static
GameTime
s_update_time
(
0
,
0
);
static
FieldEvaluator
::
ConstPtr
s_update_evaluator
;
static
ActionGenerator
::
ConstPtr
s_update_generator
;
#else
static
thread_local
GameTime
s_update_time
(
0
,
0
);
static
thread_local
GameTime
s_update_time
(
0
,
0
);
static
thread_local
FieldEvaluator
::
ConstPtr
s_update_evaluator
;
static
thread_local
FieldEvaluator
::
ConstPtr
s_update_evaluator
;
static
thread_local
ActionGenerator
::
ConstPtr
s_update_generator
;
static
thread_local
ActionGenerator
::
ConstPtr
s_update_generator
;
#endif
if
(
s_update_time
==
wm
.
time
()
if
(
s_update_time
==
wm
.
time
()
&&
s_update_evaluator
==
M_evaluator
&&
s_update_evaluator
==
M_evaluator
...
...
src/chain_action/bhv_chain_action.cpp
View file @
e79acb54
...
@@ -484,8 +484,13 @@ Bhv_ChainAction::doTurnToForward( PlayerAgent * agent )
...
@@ -484,8 +484,13 @@ Bhv_ChainAction::doTurnToForward( PlayerAgent * agent )
Vector2D
Vector2D
Bhv_ChainAction
::
getKeepBallVel
(
const
WorldModel
&
wm
)
Bhv_ChainAction
::
getKeepBallVel
(
const
WorldModel
&
wm
)
{
{
#ifdef __APPLE__
static
GameTime
s_update_time
(
0
,
0
);
static
Vector2D
s_best_ball_vel
(
0.0
,
0.0
);
#else
static
thread_local
GameTime
s_update_time
(
0
,
0
);
static
thread_local
GameTime
s_update_time
(
0
,
0
);
static
thread_local
Vector2D
s_best_ball_vel
(
0.0
,
0.0
);
static
thread_local
Vector2D
s_best_ball_vel
(
0.0
,
0.0
);
#endif
if
(
s_update_time
==
wm
.
time
()
)
if
(
s_update_time
==
wm
.
time
()
)
{
{
...
...
src/chain_action/bhv_pass_kick_find_receiver.cpp
View file @
e79acb54
...
@@ -661,8 +661,13 @@ Bhv_PassKickFindReceiver::doKeepBall( rcsc::PlayerAgent * agent,
...
@@ -661,8 +661,13 @@ Bhv_PassKickFindReceiver::doKeepBall( rcsc::PlayerAgent * agent,
rcsc
::
Vector2D
rcsc
::
Vector2D
Bhv_PassKickFindReceiver
::
getKeepBallVel
(
const
rcsc
::
WorldModel
&
wm
)
Bhv_PassKickFindReceiver
::
getKeepBallVel
(
const
rcsc
::
WorldModel
&
wm
)
{
{
#ifdef __APPLE__
static
GameTime
s_update_time
(
0
,
0
);
static
Vector2D
s_best_ball_vel
(
0.0
,
0.0
);
#else
static
thread_local
GameTime
s_update_time
(
0
,
0
);
static
thread_local
GameTime
s_update_time
(
0
,
0
);
static
thread_local
Vector2D
s_best_ball_vel
(
0.0
,
0.0
);
static
thread_local
Vector2D
s_best_ball_vel
(
0.0
,
0.0
);
#endif
if
(
s_update_time
==
wm
.
time
()
)
if
(
s_update_time
==
wm
.
time
()
)
{
{
...
...
src/chain_action/clear_generator.cpp
View file @
e79acb54
...
@@ -73,7 +73,11 @@ ClearGenerator::ClearGenerator()
...
@@ -73,7 +73,11 @@ ClearGenerator::ClearGenerator()
ClearGenerator
&
ClearGenerator
&
ClearGenerator
::
instance
()
ClearGenerator
::
instance
()
{
{
#ifdef __APPLE__
static
ClearGenerator
s_instance
;
#else
static
thread_local
ClearGenerator
s_instance
;
static
thread_local
ClearGenerator
s_instance
;
#endif
return
s_instance
;
return
s_instance
;
}
}
...
...
src/chain_action/cross_generator.cpp
View file @
e79acb54
...
@@ -91,7 +91,11 @@ CrossGenerator::CrossGenerator()
...
@@ -91,7 +91,11 @@ CrossGenerator::CrossGenerator()
CrossGenerator
&
CrossGenerator
&
CrossGenerator
::
instance
()
CrossGenerator
::
instance
()
{
{
#ifdef __APPLE__
static
CrossGenerator
s_instance
;
#else
static
thread_local
CrossGenerator
s_instance
;
static
thread_local
CrossGenerator
s_instance
;
#endif
return
s_instance
;
return
s_instance
;
}
}
...
@@ -117,7 +121,11 @@ CrossGenerator::clear()
...
@@ -117,7 +121,11 @@ CrossGenerator::clear()
void
void
CrossGenerator
::
generate
(
const
WorldModel
&
wm
)
CrossGenerator
::
generate
(
const
WorldModel
&
wm
)
{
{
#ifdef __APPLE__
static
GameTime
s_update_time
(
-
1
,
0
);
#else
static
thread_local
GameTime
s_update_time
(
-
1
,
0
);
static
thread_local
GameTime
s_update_time
(
-
1
,
0
);
#endif
if
(
s_update_time
==
wm
.
time
()
)
if
(
s_update_time
==
wm
.
time
()
)
{
{
return
;
return
;
...
...
src/chain_action/field_analyzer.cpp
View file @
e79acb54
...
@@ -72,7 +72,11 @@ FieldAnalyzer::FieldAnalyzer()
...
@@ -72,7 +72,11 @@ FieldAnalyzer::FieldAnalyzer()
FieldAnalyzer
&
FieldAnalyzer
&
FieldAnalyzer
::
instance
()
FieldAnalyzer
::
instance
()
{
{
#ifdef __APPLE__
static
FieldAnalyzer
s_instance
;
#else
static
thread_local
FieldAnalyzer
s_instance
;
static
thread_local
FieldAnalyzer
s_instance
;
#endif
return
s_instance
;
return
s_instance
;
}
}
...
@@ -1204,7 +1208,11 @@ FieldAnalyzer::get_blocker( const WorldModel & wm,
...
@@ -1204,7 +1208,11 @@ FieldAnalyzer::get_blocker( const WorldModel & wm,
void
void
FieldAnalyzer
::
update
(
const
WorldModel
&
wm
)
FieldAnalyzer
::
update
(
const
WorldModel
&
wm
)
{
{
#ifdef __APPLE__
static
GameTime
s_update_time
(
0
,
0
);
#else
static
thread_local
GameTime
s_update_time
(
0
,
0
);
static
thread_local
GameTime
s_update_time
(
0
,
0
);
#endif
if
(
s_update_time
==
wm
.
time
()
)
if
(
s_update_time
==
wm
.
time
()
)
{
{
...
...
src/chain_action/self_pass_generator.cpp
View file @
e79acb54
...
@@ -96,7 +96,11 @@ SelfPassGenerator::SelfPassGenerator()
...
@@ -96,7 +96,11 @@ SelfPassGenerator::SelfPassGenerator()
SelfPassGenerator
&
SelfPassGenerator
&
SelfPassGenerator
::
instance
()
SelfPassGenerator
::
instance
()
{
{
#ifdef __APPLE__
static
SelfPassGenerator
s_instance
;
#else
static
thread_local
SelfPassGenerator
s_instance
;
static
thread_local
SelfPassGenerator
s_instance
;
#endif
return
s_instance
;
return
s_instance
;
}
}
...
@@ -166,7 +170,11 @@ SelfPassGenerator::createCourses( const WorldModel & wm )
...
@@ -166,7 +170,11 @@ SelfPassGenerator::createCourses( const WorldModel & wm )
static
const
int
ANGLE_DIVS
=
60
;
static
const
int
ANGLE_DIVS
=
60
;
static
const
double
ANGLE_STEP
=
360.0
/
ANGLE_DIVS
;
static
const
double
ANGLE_STEP
=
360.0
/
ANGLE_DIVS
;
#ifdef __APPLE__
static
std
::
vector
<
Vector2D
>
self_cache
(
24
);
#else
static
thread_local
std
::
vector
<
Vector2D
>
self_cache
(
24
);
static
thread_local
std
::
vector
<
Vector2D
>
self_cache
(
24
);
#endif
const
ServerParam
&
SP
=
ServerParam
::
i
();
const
ServerParam
&
SP
=
ServerParam
::
i
();
...
...
src/chain_action/shoot_generator.cpp
View file @
e79acb54
...
@@ -76,7 +76,11 @@ ShootGenerator::ShootGenerator()
...
@@ -76,7 +76,11 @@ ShootGenerator::ShootGenerator()
ShootGenerator
&
ShootGenerator
&
ShootGenerator
::
instance
()
ShootGenerator
::
instance
()
{
{
#ifdef __APPLE__
static
ShootGenerator
s_instance
;
#else
static
thread_local
ShootGenerator
s_instance
;
static
thread_local
ShootGenerator
s_instance
;
#endif
return
s_instance
;
return
s_instance
;
}
}
...
@@ -98,7 +102,11 @@ ShootGenerator::clear()
...
@@ -98,7 +102,11 @@ ShootGenerator::clear()
void
void
ShootGenerator
::
generate
(
const
WorldModel
&
wm
,
bool
consider_shot_distance
)
ShootGenerator
::
generate
(
const
WorldModel
&
wm
,
bool
consider_shot_distance
)
{
{
#ifdef __APPLE__
static
GameTime
s_update_time
(
0
,
0
);
#else
static
thread_local
GameTime
s_update_time
(
0
,
0
);
static
thread_local
GameTime
s_update_time
(
0
,
0
);
#endif
if
(
s_update_time
==
wm
.
time
()
)
if
(
s_update_time
==
wm
.
time
()
)
{
{
...
...
src/chain_action/short_dribble_generator.cpp
View file @
e79acb54
...
@@ -98,7 +98,11 @@ ShortDribbleGenerator::ShortDribbleGenerator()
...
@@ -98,7 +98,11 @@ ShortDribbleGenerator::ShortDribbleGenerator()
ShortDribbleGenerator
&
ShortDribbleGenerator
&
ShortDribbleGenerator
::
instance
()
ShortDribbleGenerator
::
instance
()
{
{
#ifdef __APPLE__
static
ShortDribbleGenerator
s_instance
;
#else
static
thread_local
ShortDribbleGenerator
s_instance
;
static
thread_local
ShortDribbleGenerator
s_instance
;
#endif
return
s_instance
;
return
s_instance
;
}
}
...
@@ -526,7 +530,11 @@ ShortDribbleGenerator::simulateKickTurnsDashes( const WorldModel & wm,
...
@@ -526,7 +530,11 @@ ShortDribbleGenerator::simulateKickTurnsDashes( const WorldModel & wm,
static
const
int
min_dash
=
2
;
static
const
int
min_dash
=
2
;
//static const int min_dash = 1;
//static const int min_dash = 1;
#ifdef __APPLE__
static
std
::
vector
<
Vector2D
>
self_cache
;
#else
static
thread_local
std
::
vector
<
Vector2D
>
self_cache
;
static
thread_local
std
::
vector
<
Vector2D
>
self_cache
;
#endif
//
//
// create self position cache
// create self position cache
...
...
src/chain_action/strict_check_pass_generator.cpp
View file @
e79acb54
...
@@ -153,7 +153,11 @@ StrictCheckPassGenerator::StrictCheckPassGenerator()
...
@@ -153,7 +153,11 @@ StrictCheckPassGenerator::StrictCheckPassGenerator()
StrictCheckPassGenerator
&
StrictCheckPassGenerator
&
StrictCheckPassGenerator
::
instance
()
StrictCheckPassGenerator
::
instance
()
{
{
#ifdef __APPLE__
static
StrictCheckPassGenerator
s_instance
;
#else
static
thread_local
StrictCheckPassGenerator
s_instance
;
static
thread_local
StrictCheckPassGenerator
s_instance
;
#endif
return
s_instance
;
return
s_instance
;
}
}
...
...
src/chain_action/tackle_generator.cpp
View file @
e79acb54
...
@@ -184,7 +184,11 @@ TackleGenerator::TackleGenerator()
...
@@ -184,7 +184,11 @@ TackleGenerator::TackleGenerator()
TackleGenerator
&
TackleGenerator
&
TackleGenerator
::
instance
()
TackleGenerator
::
instance
()
{
{
#ifdef __APPLE__
static
TackleGenerator
s_instance
;
#else
static
thread_local
TackleGenerator
s_instance
;
static
thread_local
TackleGenerator
s_instance
;
#endif
return
s_instance
;
return
s_instance
;
}
}
...
@@ -206,7 +210,11 @@ TackleGenerator::clear()
...
@@ -206,7 +210,11 @@ TackleGenerator::clear()
void
void
TackleGenerator
::
generate
(
const
WorldModel
&
wm
)
TackleGenerator
::
generate
(
const
WorldModel
&
wm
)
{
{
#ifdef __APPLE__
static
GameTime
s_update_time
(
0
,
0
);
#else
static
thread_local
GameTime
s_update_time
(
0
,
0
);
static
thread_local
GameTime
s_update_time
(
0
,
0
);
#endif
if
(
s_update_time
==
wm
.
time
()
)
if
(
s_update_time
==
wm
.
time
()
)
{
{
...
...
src/sample_coach.cpp
View file @
e79acb54
...
@@ -248,7 +248,11 @@ SampleCoach::handlePlayerType()
...
@@ -248,7 +248,11 @@ SampleCoach::handlePlayerType()
void
void
SampleCoach
::
doSubstitute
()
SampleCoach
::
doSubstitute
()
{
{
#ifdef __APPLE__
static
bool
S_first_substituted
=
false
;
#else
static
thread_local
bool
S_first_substituted
=
false
;
static
thread_local
bool
S_first_substituted
=
false
;
#endif
if
(
!
S_first_substituted
if
(
!
S_first_substituted
&&
world
().
time
().
cycle
()
==
0
&&
world
().
time
().
cycle
()
==
0
...
@@ -646,7 +650,11 @@ SampleCoach::sayPlayerTypes()
...
@@ -646,7 +650,11 @@ SampleCoach::sayPlayerTypes()
(say (freeform "(player_type ...)"))
(say (freeform "(player_type ...)"))
*/
*/
#ifdef __APPLE__
static
GameTime
s_last_send_time
(
0
,
0
);
#else
static
thread_local
GameTime
s_last_send_time
(
0
,
0
);
static
thread_local
GameTime
s_last_send_time
(
0
,
0
);
#endif
if
(
!
config
().
useFreeform
()
)
if
(
!
config
().
useFreeform
()
)
{
{
...
...
src/sample_communication.cpp
View file @
e79acb54
...
@@ -1534,7 +1534,11 @@ SampleCommunication::sayDefenseLine( PlayerAgent * agent )
...
@@ -1534,7 +1534,11 @@ SampleCommunication::sayDefenseLine( PlayerAgent * agent )
bool
bool
SampleCommunication
::
sayPlayers
(
PlayerAgent
*
agent
)
SampleCommunication
::
sayPlayers
(
PlayerAgent
*
agent
)
{
{
#ifdef __APPLE__
static
GameTime
s_last_time
(
-
1
,
0
);
#else
static
thread_local
GameTime
s_last_time
(
-
1
,
0
);
static
thread_local
GameTime
s_last_time
(
-
1
,
0
);
#endif
const
int
len
=
agent
->
effector
().
getSayMessageLength
();
const
int
len
=
agent
->
effector
().
getSayMessageLength
();
if
(
len
+
OnePlayerMessage
::
slength
()
>
ServerParam
::
i
().
playerSayMsgSize
()
)
if
(
len
+
OnePlayerMessage
::
slength
()
>
ServerParam
::
i
().
playerSayMsgSize
()
)
...
...
src/sample_trainer.cpp
View file @
e79acb54
...
@@ -132,10 +132,15 @@ SampleTrainer::sampleAction()
...
@@ -132,10 +132,15 @@ SampleTrainer::sampleAction()
{
{
// sample training to test a ball interception.
// sample training to test a ball interception.
#ifdef __APPLE__
static
int
s_state
=
0
;
static
int
s_wait_counter
=
0
;
static
Vector2D
s_last_player_move_pos
;
#else
static
thread_local
int
s_state
=
0
;
static
thread_local
int
s_state
=
0
;
static
thread_local
int
s_wait_counter
=
0
;
static
thread_local
int
s_wait_counter
=
0
;
static
thread_local
Vector2D
s_last_player_move_pos
;
static
thread_local
Vector2D
s_last_player_move_pos
;
#endif
if
(
world
().
existKickablePlayer
()
)
if
(
world
().
existKickablePlayer
()
)
{
{
...
@@ -171,7 +176,11 @@ SampleTrainer::sampleAction()
...
@@ -171,7 +176,11 @@ SampleTrainer::sampleAction()
}
}
// change player type
// change player type
{
{
#ifdef __APPLE__
static
int
type
=
0
;
#else
static
thread_local
int
type
=
0
;
static
thread_local
int
type
=
0
;
#endif
doChangePlayerType
(
world
().
teamNameLeft
(),
1
,
type
);
doChangePlayerType
(
world
().
teamNameLeft
(),
1
,
type
);
type
=
(
type
+
1
)
%
PlayerParam
::
i
().
playerTypes
();
type
=
(
type
+
1
)
%
PlayerParam
::
i
().
playerTypes
();
}
}
...
@@ -233,7 +242,11 @@ SampleTrainer::recoverForever()
...
@@ -233,7 +242,11 @@ SampleTrainer::recoverForever()
void
void
SampleTrainer
::
doSubstitute
()
SampleTrainer
::
doSubstitute
()
{
{
#ifdef __APPLE__
static
bool
s_substitute
=
false
;
#else
static
thread_local
bool
s_substitute
=
false
;
static
thread_local
bool
s_substitute
=
false
;
#endif
if
(
!
s_substitute
if
(
!
s_substitute
&&
world
().
time
().
cycle
()
==
0
&&
world
().
time
().
cycle
()
==
0
&&
world
().
time
().
stopped
()
>=
10
)
&&
world
().
time
().
stopped
()
>=
10
)
...
@@ -257,7 +270,11 @@ SampleTrainer::doSubstitute()
...
@@ -257,7 +270,11 @@ SampleTrainer::doSubstitute()
&&
world
().
time
().
cycle
()
%
100
==
1
&&
world
().
time
().
cycle
()
%
100
==
1
&&
!
world
().
teamNameLeft
().
empty
()
)
&&
!
world
().
teamNameLeft
().
empty
()
)
{
{
#ifdef __APPLE__
static
int
type
=
0
;
#else
static
thread_local
int
type
=
0
;
static
thread_local
int
type
=
0
;
#endif
doChangePlayerType
(
world
().
teamNameLeft
(),
1
,
type
);
doChangePlayerType
(
world
().
teamNameLeft
(),
1
,
type
);
type
=
(
type
+
1
)
%
PlayerParam
::
i
().
playerTypes
();
type
=
(
type
+
1
)
%
PlayerParam
::
i
().
playerTypes
();
}
}
...
...
src/soccer_role.cpp
View file @
e79acb54
...
@@ -56,7 +56,11 @@
...
@@ -56,7 +56,11 @@
SoccerRole
::
Creators
&
SoccerRole
::
Creators
&
SoccerRole
::
creators
()
SoccerRole
::
creators
()
{
{
#ifdef __APPLE__
static
Creators
s_instance
;
#else
static
thread_local
Creators
s_instance
;
static
thread_local
Creators
s_instance
;
#endif
return
s_instance
;
return
s_instance
;
}
}
...
...
src/strategy.cpp
View file @
e79acb54
...
@@ -140,7 +140,11 @@ Strategy::Strategy()
...
@@ -140,7 +140,11 @@ Strategy::Strategy()
Strategy
&
Strategy
&
Strategy
::
instance
()
Strategy
::
instance
()
{
{
#ifdef __APPLE__
static
Strategy
s_instance
;
#else
static
thread_local
Strategy
s_instance
;
static
thread_local
Strategy
s_instance
;
#endif
return
s_instance
;
return
s_instance
;
}
}
...
@@ -183,7 +187,11 @@ Strategy::init( CmdLineParser & cmd_parser )
...
@@ -183,7 +187,11 @@ Strategy::init( CmdLineParser & cmd_parser )
bool
bool
Strategy
::
read
(
const
std
::
string
&
formation_dir
)
Strategy
::
read
(
const
std
::
string
&
formation_dir
)
{
{
#ifdef __APPLE__
static
bool
s_initialized
=
false
;
#else
static
thread_local
bool
s_initialized
=
false
;
static
thread_local
bool
s_initialized
=
false
;
#endif
if
(
s_initialized
)
if
(
s_initialized
)
{
{
...
@@ -434,7 +442,11 @@ Strategy::createFormation( const std::string & type_name ) const
...
@@ -434,7 +442,11 @@ Strategy::createFormation( const std::string & type_name ) const
void
void
Strategy
::
update
(
const
WorldModel
&
wm
)
Strategy
::
update
(
const
WorldModel
&
wm
)
{
{
#ifdef __APPLE__
static
GameTime
s_update_time
(
-
1
,
0
);
#else
static
thread_local
GameTime
s_update_time
(
-
1
,
0
);
static
thread_local
GameTime
s_update_time
(
-
1
,
0
);
#endif
if
(
s_update_time
==
wm
.
time
()
)
if
(
s_update_time
==
wm
.
time
()
)
{
{
...
@@ -625,7 +637,11 @@ Strategy::updateSituation( const WorldModel & wm )
...
@@ -625,7 +637,11 @@ Strategy::updateSituation( const WorldModel & wm )
void
void
Strategy
::
updatePosition
(
const
WorldModel
&
wm
)
Strategy
::
updatePosition
(
const
WorldModel
&
wm
)
{
{
#ifdef __APPLE__
static
GameTime
s_update_time
(
0
,
0
);
#else
static
thread_local
GameTime
s_update_time
(
0
,
0
);
static
thread_local
GameTime
s_update_time
(
0
,
0
);
#endif
if
(
s_update_time
==
wm
.
time
()
)
if
(
s_update_time
==
wm
.
time
()
)
{
{
return
;
return
;
...
@@ -1129,7 +1145,11 @@ Strategy::get_ball_area( const Vector2D & ball_pos )
...
@@ -1129,7 +1145,11 @@ Strategy::get_ball_area( const Vector2D & ball_pos )
double
double
Strategy
::
get_normal_dash_power
(
const
WorldModel
&
wm
)
Strategy
::
get_normal_dash_power
(
const
WorldModel
&
wm
)
{
{
#ifdef __APPLE__
static
bool
s_recover_mode
=
false
;
#else
static
thread_local
bool
s_recover_mode
=
false
;
static
thread_local
bool
s_recover_mode
=
false
;
#endif
if
(
wm
.
self
().
staminaModel
().
capacityIsEmpty
()
)
if
(
wm
.
self
().
staminaModel
().
capacityIsEmpty
()
)
{
{
...
...
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