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
603077ea
Commit
603077ea
authored
Mar 07, 2016
by
Matthew Hausknecht
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Threadsafe library update. Requires c++11
parent
90625ed0
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
60 additions
and
60 deletions
+60
-60
CMakeLists.txt
CMakeLists.txt
+1
-1
src/bhv_basic_tackle.cpp
src/bhv_basic_tackle.cpp
+3
-3
src/bhv_force_pass.cpp
src/bhv_force_pass.cpp
+10
-10
src/bhv_goalie_free_kick.cpp
src/bhv_goalie_free_kick.cpp
+3
-3
src/bhv_penalty_kick.cpp
src/bhv_penalty_kick.cpp
+1
-1
src/bhv_prepare_set_play_kick.cpp
src/bhv_prepare_set_play_kick.cpp
+1
-1
src/chain_action/actgen_direct_pass.cpp
src/chain_action/actgen_direct_pass.cpp
+2
-2
src/chain_action/actgen_simple_dribble.cpp
src/chain_action/actgen_simple_dribble.cpp
+2
-2
src/chain_action/action_chain_holder.cpp
src/chain_action/action_chain_holder.cpp
+4
-4
src/chain_action/bhv_chain_action.cpp
src/chain_action/bhv_chain_action.cpp
+2
-2
src/chain_action/bhv_pass_kick_find_receiver.cpp
src/chain_action/bhv_pass_kick_find_receiver.cpp
+2
-2
src/chain_action/clear_generator.cpp
src/chain_action/clear_generator.cpp
+1
-1
src/chain_action/cross_generator.cpp
src/chain_action/cross_generator.cpp
+2
-2
src/chain_action/field_analyzer.cpp
src/chain_action/field_analyzer.cpp
+2
-2
src/chain_action/self_pass_generator.cpp
src/chain_action/self_pass_generator.cpp
+2
-2
src/chain_action/shoot_generator.cpp
src/chain_action/shoot_generator.cpp
+2
-2
src/chain_action/short_dribble_generator.cpp
src/chain_action/short_dribble_generator.cpp
+2
-2
src/chain_action/strict_check_pass_generator.cpp
src/chain_action/strict_check_pass_generator.cpp
+1
-1
src/chain_action/tackle_generator.cpp
src/chain_action/tackle_generator.cpp
+2
-2
src/sample_coach.cpp
src/sample_coach.cpp
+2
-2
src/sample_communication.cpp
src/sample_communication.cpp
+1
-1
src/sample_trainer.cpp
src/sample_trainer.cpp
+6
-6
src/soccer_role.cpp
src/soccer_role.cpp
+1
-1
src/strategy.cpp
src/strategy.cpp
+5
-5
No files found.
CMakeLists.txt
View file @
603077ea
...
@@ -5,7 +5,7 @@ include(ExternalProject)
...
@@ -5,7 +5,7 @@ include(ExternalProject)
option
(
BUILD_SOCCERWINDOW
"Build Soccerwindow Visualizer"
ON
)
option
(
BUILD_SOCCERWINDOW
"Build Soccerwindow Visualizer"
ON
)
option
(
INSTALL_ADDITIONAL_TEAMS
"Install additional team binaries"
ON
)
option
(
INSTALL_ADDITIONAL_TEAMS
"Install additional team binaries"
ON
)
add_definitions
(
-DELOG
)
add_definitions
(
-DELOG
-std=c++11
)
ExternalProject_Add
(
rcssserver
ExternalProject_Add
(
rcssserver
GIT_REPOSITORY
"https://github.com/mhauskn/rcssserver.git"
GIT_REPOSITORY
"https://github.com/mhauskn/rcssserver.git"
...
...
src/bhv_basic_tackle.cpp
View file @
603077ea
...
@@ -193,9 +193,9 @@ Bhv_BasicTackle::executeOld( PlayerAgent * agent )
...
@@ -193,9 +193,9 @@ Bhv_BasicTackle::executeOld( PlayerAgent * agent )
bool
bool
Bhv_BasicTackle
::
executeV12
(
PlayerAgent
*
agent
)
Bhv_BasicTackle
::
executeV12
(
PlayerAgent
*
agent
)
{
{
static
GameTime
s_last_execute_time
(
0
,
0
);
static
thread_local
GameTime
s_last_execute_time
(
0
,
0
);
static
bool
s_result
=
false
;
static
thread_local
bool
s_result
=
false
;
static
AngleDeg
s_best_angle
=
0.0
;
static
thread_local
AngleDeg
s_best_angle
=
0.0
;
const
WorldModel
&
wm
=
agent
->
world
();
const
WorldModel
&
wm
=
agent
->
world
();
...
...
src/bhv_force_pass.cpp
View file @
603077ea
...
@@ -122,11 +122,11 @@ Force_Pass::get_best_pass( const WorldModel & world,
...
@@ -122,11 +122,11 @@ Force_Pass::get_best_pass( const WorldModel & world,
double
*
first_speed
,
double
*
first_speed
,
int
*
receiver
)
int
*
receiver
)
{
{
static
GameTime
S_last_calc_time
(
0
,
0
);
static
thread_local
GameTime
S_last_calc_time
(
0
,
0
);
static
bool
S_last_calc_valid
=
false
;
static
thread_local
bool
S_last_calc_valid
=
false
;
static
Vector2D
S_last_calc_target
;
static
thread_local
Vector2D
S_last_calc_target
;
static
double
S_last_calc_speed
=
0.0
;
static
thread_local
double
S_last_calc_speed
=
0.0
;
static
int
S_last_calc_receiver
=
Unum_Unknown
;
static
thread_local
int
S_last_calc_receiver
=
Unum_Unknown
;
if
(
S_last_calc_time
==
world
.
time
()
)
if
(
S_last_calc_time
==
world
.
time
()
)
{
{
...
@@ -208,11 +208,11 @@ bool
...
@@ -208,11 +208,11 @@ 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
)
{
{
static
GameTime
S_last_calc_time
(
0
,
0
);
static
thread_local
GameTime
S_last_calc_time
(
0
,
0
);
static
bool
S_last_calc_valid
=
false
;
static
thread_local
bool
S_last_calc_valid
=
false
;
static
Vector2D
S_last_calc_target
;
static
thread_local
Vector2D
S_last_calc_target
;
static
double
S_last_calc_speed
=
0.0
;
static
thread_local
double
S_last_calc_speed
=
0.0
;
static
int
S_last_calc_receiver
=
Unum_Unknown
;
static
thread_local
int
S_last_calc_receiver
=
Unum_Unknown
;
if
(
S_last_calc_time
==
world
.
time
()
)
if
(
S_last_calc_time
==
world
.
time
()
)
{
{
...
...
src/bhv_goalie_free_kick.cpp
View file @
603077ea
...
@@ -53,9 +53,9 @@
...
@@ -53,9 +53,9 @@
bool
bool
Bhv_GoalieFreeKick
::
execute
(
rcsc
::
PlayerAgent
*
agent
)
Bhv_GoalieFreeKick
::
execute
(
rcsc
::
PlayerAgent
*
agent
)
{
{
static
bool
s_first_move
=
false
;
static
thread_local
bool
s_first_move
=
false
;
static
bool
s_second_move
=
false
;
static
thread_local
bool
s_second_move
=
false
;
static
int
s_second_wait_count
=
0
;
static
thread_local
int
s_second_wait_count
=
0
;
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 @
603077ea
...
@@ -622,7 +622,7 @@ bool
...
@@ -622,7 +622,7 @@ bool
Bhv_PenaltyKick
::
doDribble
(
PlayerAgent
*
agent
)
Bhv_PenaltyKick
::
doDribble
(
PlayerAgent
*
agent
)
{
{
static
const
int
CONTINUAL_COUNT
=
20
;
static
const
int
CONTINUAL_COUNT
=
20
;
static
int
S_target_continual_count
=
CONTINUAL_COUNT
;
static
thread_local
int
S_target_continual_count
=
CONTINUAL_COUNT
;
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 @
603077ea
...
@@ -51,7 +51,7 @@ using namespace rcsc;
...
@@ -51,7 +51,7 @@ using namespace rcsc;
bool
bool
Bhv_PrepareSetPlayKick
::
execute
(
PlayerAgent
*
agent
)
Bhv_PrepareSetPlayKick
::
execute
(
PlayerAgent
*
agent
)
{
{
static
int
s_rest_wait_cycle
=
-
1
;
static
thread_local
int
s_rest_wait_cycle
=
-
1
;
// 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 @
603077ea
...
@@ -113,8 +113,8 @@ ActGen_DirectPass::generate( std::vector< ActionStatePair > * result,
...
@@ -113,8 +113,8 @@ 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
;
static
GameTime
s_last_call_time
(
0
,
0
);
static
thread_local
GameTime
s_last_call_time
(
0
,
0
);
static
int
s_action_count
=
0
;
static
thread_local
int
s_action_count
=
0
;
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 @
603077ea
...
@@ -56,8 +56,8 @@ ActGen_SimpleDribble::generate( std::vector< ActionStatePair > * result,
...
@@ -56,8 +56,8 @@ 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
{
{
static
GameTime
s_last_call_time
(
0
,
0
);
static
thread_local
GameTime
s_last_call_time
(
0
,
0
);
static
int
s_action_count
=
0
;
static
thread_local
int
s_action_count
=
0
;
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 @
603077ea
...
@@ -57,7 +57,7 @@ ActionChainHolder::ActionChainHolder()
...
@@ -57,7 +57,7 @@ ActionChainHolder::ActionChainHolder()
ActionChainHolder
&
ActionChainHolder
&
ActionChainHolder
::
instance
()
ActionChainHolder
::
instance
()
{
{
static
ActionChainHolder
s_instance
;
static
thread_local
ActionChainHolder
s_instance
;
return
s_instance
;
return
s_instance
;
}
}
...
@@ -119,9 +119,9 @@ ActionChainHolder::actionGenerator() const
...
@@ -119,9 +119,9 @@ ActionChainHolder::actionGenerator() const
void
void
ActionChainHolder
::
update
(
const
WorldModel
&
wm
)
ActionChainHolder
::
update
(
const
WorldModel
&
wm
)
{
{
static
GameTime
s_update_time
(
0
,
0
);
static
thread_local
GameTime
s_update_time
(
0
,
0
);
static
FieldEvaluator
::
ConstPtr
s_update_evaluator
;
static
thread_local
FieldEvaluator
::
ConstPtr
s_update_evaluator
;
static
ActionGenerator
::
ConstPtr
s_update_generator
;
static
thread_local
ActionGenerator
::
ConstPtr
s_update_generator
;
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 @
603077ea
...
@@ -484,8 +484,8 @@ Bhv_ChainAction::doTurnToForward( PlayerAgent * agent )
...
@@ -484,8 +484,8 @@ Bhv_ChainAction::doTurnToForward( PlayerAgent * agent )
Vector2D
Vector2D
Bhv_ChainAction
::
getKeepBallVel
(
const
WorldModel
&
wm
)
Bhv_ChainAction
::
getKeepBallVel
(
const
WorldModel
&
wm
)
{
{
static
GameTime
s_update_time
(
0
,
0
);
static
thread_local
GameTime
s_update_time
(
0
,
0
);
static
Vector2D
s_best_ball_vel
(
0.0
,
0.0
);
static
thread_local
Vector2D
s_best_ball_vel
(
0.0
,
0.0
);
if
(
s_update_time
==
wm
.
time
()
)
if
(
s_update_time
==
wm
.
time
()
)
{
{
...
...
src/chain_action/bhv_pass_kick_find_receiver.cpp
View file @
603077ea
...
@@ -661,8 +661,8 @@ Bhv_PassKickFindReceiver::doKeepBall( rcsc::PlayerAgent * agent,
...
@@ -661,8 +661,8 @@ Bhv_PassKickFindReceiver::doKeepBall( rcsc::PlayerAgent * agent,
rcsc
::
Vector2D
rcsc
::
Vector2D
Bhv_PassKickFindReceiver
::
getKeepBallVel
(
const
rcsc
::
WorldModel
&
wm
)
Bhv_PassKickFindReceiver
::
getKeepBallVel
(
const
rcsc
::
WorldModel
&
wm
)
{
{
static
GameTime
s_update_time
(
0
,
0
);
static
thread_local
GameTime
s_update_time
(
0
,
0
);
static
Vector2D
s_best_ball_vel
(
0.0
,
0.0
);
static
thread_local
Vector2D
s_best_ball_vel
(
0.0
,
0.0
);
if
(
s_update_time
==
wm
.
time
()
)
if
(
s_update_time
==
wm
.
time
()
)
{
{
...
...
src/chain_action/clear_generator.cpp
View file @
603077ea
...
@@ -73,7 +73,7 @@ ClearGenerator::ClearGenerator()
...
@@ -73,7 +73,7 @@ ClearGenerator::ClearGenerator()
ClearGenerator
&
ClearGenerator
&
ClearGenerator
::
instance
()
ClearGenerator
::
instance
()
{
{
static
ClearGenerator
s_instance
;
static
thread_local
ClearGenerator
s_instance
;
return
s_instance
;
return
s_instance
;
}
}
...
...
src/chain_action/cross_generator.cpp
View file @
603077ea
...
@@ -91,7 +91,7 @@ CrossGenerator::CrossGenerator()
...
@@ -91,7 +91,7 @@ CrossGenerator::CrossGenerator()
CrossGenerator
&
CrossGenerator
&
CrossGenerator
::
instance
()
CrossGenerator
::
instance
()
{
{
static
CrossGenerator
s_instance
;
static
thread_local
CrossGenerator
s_instance
;
return
s_instance
;
return
s_instance
;
}
}
...
@@ -117,7 +117,7 @@ CrossGenerator::clear()
...
@@ -117,7 +117,7 @@ CrossGenerator::clear()
void
void
CrossGenerator
::
generate
(
const
WorldModel
&
wm
)
CrossGenerator
::
generate
(
const
WorldModel
&
wm
)
{
{
static
GameTime
s_update_time
(
-
1
,
0
);
static
thread_local
GameTime
s_update_time
(
-
1
,
0
);
if
(
s_update_time
==
wm
.
time
()
)
if
(
s_update_time
==
wm
.
time
()
)
{
{
return
;
return
;
...
...
src/chain_action/field_analyzer.cpp
View file @
603077ea
...
@@ -72,7 +72,7 @@ FieldAnalyzer::FieldAnalyzer()
...
@@ -72,7 +72,7 @@ FieldAnalyzer::FieldAnalyzer()
FieldAnalyzer
&
FieldAnalyzer
&
FieldAnalyzer
::
instance
()
FieldAnalyzer
::
instance
()
{
{
static
FieldAnalyzer
s_instance
;
static
thread_local
FieldAnalyzer
s_instance
;
return
s_instance
;
return
s_instance
;
}
}
...
@@ -1204,7 +1204,7 @@ FieldAnalyzer::get_blocker( const WorldModel & wm,
...
@@ -1204,7 +1204,7 @@ FieldAnalyzer::get_blocker( const WorldModel & wm,
void
void
FieldAnalyzer
::
update
(
const
WorldModel
&
wm
)
FieldAnalyzer
::
update
(
const
WorldModel
&
wm
)
{
{
static
GameTime
s_update_time
(
0
,
0
);
static
thread_local
GameTime
s_update_time
(
0
,
0
);
if
(
s_update_time
==
wm
.
time
()
)
if
(
s_update_time
==
wm
.
time
()
)
{
{
...
...
src/chain_action/self_pass_generator.cpp
View file @
603077ea
...
@@ -96,7 +96,7 @@ SelfPassGenerator::SelfPassGenerator()
...
@@ -96,7 +96,7 @@ SelfPassGenerator::SelfPassGenerator()
SelfPassGenerator
&
SelfPassGenerator
&
SelfPassGenerator
::
instance
()
SelfPassGenerator
::
instance
()
{
{
static
SelfPassGenerator
s_instance
;
static
thread_local
SelfPassGenerator
s_instance
;
return
s_instance
;
return
s_instance
;
}
}
...
@@ -166,7 +166,7 @@ SelfPassGenerator::createCourses( const WorldModel & wm )
...
@@ -166,7 +166,7 @@ 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
;
static
std
::
vector
<
Vector2D
>
self_cache
(
24
);
static
thread_local
std
::
vector
<
Vector2D
>
self_cache
(
24
);
const
ServerParam
&
SP
=
ServerParam
::
i
();
const
ServerParam
&
SP
=
ServerParam
::
i
();
...
...
src/chain_action/shoot_generator.cpp
View file @
603077ea
...
@@ -76,7 +76,7 @@ ShootGenerator::ShootGenerator()
...
@@ -76,7 +76,7 @@ ShootGenerator::ShootGenerator()
ShootGenerator
&
ShootGenerator
&
ShootGenerator
::
instance
()
ShootGenerator
::
instance
()
{
{
static
ShootGenerator
s_instance
;
static
thread_local
ShootGenerator
s_instance
;
return
s_instance
;
return
s_instance
;
}
}
...
@@ -98,7 +98,7 @@ ShootGenerator::clear()
...
@@ -98,7 +98,7 @@ ShootGenerator::clear()
void
void
ShootGenerator
::
generate
(
const
WorldModel
&
wm
,
bool
consider_shot_distance
)
ShootGenerator
::
generate
(
const
WorldModel
&
wm
,
bool
consider_shot_distance
)
{
{
static
GameTime
s_update_time
(
0
,
0
);
static
thread_local
GameTime
s_update_time
(
0
,
0
);
if
(
s_update_time
==
wm
.
time
()
)
if
(
s_update_time
==
wm
.
time
()
)
{
{
...
...
src/chain_action/short_dribble_generator.cpp
View file @
603077ea
...
@@ -98,7 +98,7 @@ ShortDribbleGenerator::ShortDribbleGenerator()
...
@@ -98,7 +98,7 @@ ShortDribbleGenerator::ShortDribbleGenerator()
ShortDribbleGenerator
&
ShortDribbleGenerator
&
ShortDribbleGenerator
::
instance
()
ShortDribbleGenerator
::
instance
()
{
{
static
ShortDribbleGenerator
s_instance
;
static
thread_local
ShortDribbleGenerator
s_instance
;
return
s_instance
;
return
s_instance
;
}
}
...
@@ -526,7 +526,7 @@ ShortDribbleGenerator::simulateKickTurnsDashes( const WorldModel & wm,
...
@@ -526,7 +526,7 @@ 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;
static
std
::
vector
<
Vector2D
>
self_cache
;
static
thread_local
std
::
vector
<
Vector2D
>
self_cache
;
//
//
// create self position cache
// create self position cache
...
...
src/chain_action/strict_check_pass_generator.cpp
View file @
603077ea
...
@@ -153,7 +153,7 @@ StrictCheckPassGenerator::StrictCheckPassGenerator()
...
@@ -153,7 +153,7 @@ StrictCheckPassGenerator::StrictCheckPassGenerator()
StrictCheckPassGenerator
&
StrictCheckPassGenerator
&
StrictCheckPassGenerator
::
instance
()
StrictCheckPassGenerator
::
instance
()
{
{
static
StrictCheckPassGenerator
s_instance
;
static
thread_local
StrictCheckPassGenerator
s_instance
;
return
s_instance
;
return
s_instance
;
}
}
...
...
src/chain_action/tackle_generator.cpp
View file @
603077ea
...
@@ -184,7 +184,7 @@ TackleGenerator::TackleGenerator()
...
@@ -184,7 +184,7 @@ TackleGenerator::TackleGenerator()
TackleGenerator
&
TackleGenerator
&
TackleGenerator
::
instance
()
TackleGenerator
::
instance
()
{
{
static
TackleGenerator
s_instance
;
static
thread_local
TackleGenerator
s_instance
;
return
s_instance
;
return
s_instance
;
}
}
...
@@ -206,7 +206,7 @@ TackleGenerator::clear()
...
@@ -206,7 +206,7 @@ TackleGenerator::clear()
void
void
TackleGenerator
::
generate
(
const
WorldModel
&
wm
)
TackleGenerator
::
generate
(
const
WorldModel
&
wm
)
{
{
static
GameTime
s_update_time
(
0
,
0
);
static
thread_local
GameTime
s_update_time
(
0
,
0
);
if
(
s_update_time
==
wm
.
time
()
)
if
(
s_update_time
==
wm
.
time
()
)
{
{
...
...
src/sample_coach.cpp
View file @
603077ea
...
@@ -248,7 +248,7 @@ SampleCoach::handlePlayerType()
...
@@ -248,7 +248,7 @@ SampleCoach::handlePlayerType()
void
void
SampleCoach
::
doSubstitute
()
SampleCoach
::
doSubstitute
()
{
{
static
bool
S_first_substituted
=
false
;
static
thread_local
bool
S_first_substituted
=
false
;
if
(
!
S_first_substituted
if
(
!
S_first_substituted
&&
world
().
time
().
cycle
()
==
0
&&
world
().
time
().
cycle
()
==
0
...
@@ -646,7 +646,7 @@ SampleCoach::sayPlayerTypes()
...
@@ -646,7 +646,7 @@ SampleCoach::sayPlayerTypes()
(say (freeform "(player_type ...)"))
(say (freeform "(player_type ...)"))
*/
*/
static
GameTime
s_last_send_time
(
0
,
0
);
static
thread_local
GameTime
s_last_send_time
(
0
,
0
);
if
(
!
config
().
useFreeform
()
)
if
(
!
config
().
useFreeform
()
)
{
{
...
...
src/sample_communication.cpp
View file @
603077ea
...
@@ -1534,7 +1534,7 @@ SampleCommunication::sayDefenseLine( PlayerAgent * agent )
...
@@ -1534,7 +1534,7 @@ SampleCommunication::sayDefenseLine( PlayerAgent * agent )
bool
bool
SampleCommunication
::
sayPlayers
(
PlayerAgent
*
agent
)
SampleCommunication
::
sayPlayers
(
PlayerAgent
*
agent
)
{
{
static
GameTime
s_last_time
(
-
1
,
0
);
static
thread_local
GameTime
s_last_time
(
-
1
,
0
);
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 @
603077ea
...
@@ -132,10 +132,10 @@ SampleTrainer::sampleAction()
...
@@ -132,10 +132,10 @@ SampleTrainer::sampleAction()
{
{
// sample training to test a ball interception.
// sample training to test a ball interception.
static
int
s_state
=
0
;
static
thread_local
int
s_state
=
0
;
static
int
s_wait_counter
=
0
;
static
thread_local
int
s_wait_counter
=
0
;
static
Vector2D
s_last_player_move_pos
;
static
thread_local
Vector2D
s_last_player_move_pos
;
if
(
world
().
existKickablePlayer
()
)
if
(
world
().
existKickablePlayer
()
)
{
{
...
@@ -171,7 +171,7 @@ SampleTrainer::sampleAction()
...
@@ -171,7 +171,7 @@ SampleTrainer::sampleAction()
}
}
// change player type
// change player type
{
{
static
int
type
=
0
;
static
thread_local
int
type
=
0
;
doChangePlayerType
(
world
().
teamNameLeft
(),
1
,
type
);
doChangePlayerType
(
world
().
teamNameLeft
(),
1
,
type
);
type
=
(
type
+
1
)
%
PlayerParam
::
i
().
playerTypes
();
type
=
(
type
+
1
)
%
PlayerParam
::
i
().
playerTypes
();
}
}
...
@@ -233,7 +233,7 @@ SampleTrainer::recoverForever()
...
@@ -233,7 +233,7 @@ SampleTrainer::recoverForever()
void
void
SampleTrainer
::
doSubstitute
()
SampleTrainer
::
doSubstitute
()
{
{
static
bool
s_substitute
=
false
;
static
thread_local
bool
s_substitute
=
false
;
if
(
!
s_substitute
if
(
!
s_substitute
&&
world
().
time
().
cycle
()
==
0
&&
world
().
time
().
cycle
()
==
0
&&
world
().
time
().
stopped
()
>=
10
)
&&
world
().
time
().
stopped
()
>=
10
)
...
@@ -257,7 +257,7 @@ SampleTrainer::doSubstitute()
...
@@ -257,7 +257,7 @@ SampleTrainer::doSubstitute()
&&
world
().
time
().
cycle
()
%
100
==
1
&&
world
().
time
().
cycle
()
%
100
==
1
&&
!
world
().
teamNameLeft
().
empty
()
)
&&
!
world
().
teamNameLeft
().
empty
()
)
{
{
static
int
type
=
0
;
static
thread_local
int
type
=
0
;
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 @
603077ea
...
@@ -56,7 +56,7 @@
...
@@ -56,7 +56,7 @@
SoccerRole
::
Creators
&
SoccerRole
::
Creators
&
SoccerRole
::
creators
()
SoccerRole
::
creators
()
{
{
static
Creators
s_instance
;
static
thread_local
Creators
s_instance
;
return
s_instance
;
return
s_instance
;
}
}
...
...
src/strategy.cpp
View file @
603077ea
...
@@ -140,7 +140,7 @@ Strategy::Strategy()
...
@@ -140,7 +140,7 @@ Strategy::Strategy()
Strategy
&
Strategy
&
Strategy
::
instance
()
Strategy
::
instance
()
{
{
static
Strategy
s_instance
;
static
thread_local
Strategy
s_instance
;
return
s_instance
;
return
s_instance
;
}
}
...
@@ -183,7 +183,7 @@ Strategy::init( CmdLineParser & cmd_parser )
...
@@ -183,7 +183,7 @@ Strategy::init( CmdLineParser & cmd_parser )
bool
bool
Strategy
::
read
(
const
std
::
string
&
formation_dir
)
Strategy
::
read
(
const
std
::
string
&
formation_dir
)
{
{
static
bool
s_initialized
=
false
;
static
thread_local
bool
s_initialized
=
false
;
if
(
s_initialized
)
if
(
s_initialized
)
{
{
...
@@ -434,7 +434,7 @@ Strategy::createFormation( const std::string & type_name ) const
...
@@ -434,7 +434,7 @@ Strategy::createFormation( const std::string & type_name ) const
void
void
Strategy
::
update
(
const
WorldModel
&
wm
)
Strategy
::
update
(
const
WorldModel
&
wm
)
{
{
static
GameTime
s_update_time
(
-
1
,
0
);
static
thread_local
GameTime
s_update_time
(
-
1
,
0
);
if
(
s_update_time
==
wm
.
time
()
)
if
(
s_update_time
==
wm
.
time
()
)
{
{
...
@@ -625,7 +625,7 @@ Strategy::updateSituation( const WorldModel & wm )
...
@@ -625,7 +625,7 @@ Strategy::updateSituation( const WorldModel & wm )
void
void
Strategy
::
updatePosition
(
const
WorldModel
&
wm
)
Strategy
::
updatePosition
(
const
WorldModel
&
wm
)
{
{
static
GameTime
s_update_time
(
0
,
0
);
static
thread_local
GameTime
s_update_time
(
0
,
0
);
if
(
s_update_time
==
wm
.
time
()
)
if
(
s_update_time
==
wm
.
time
()
)
{
{
return
;
return
;
...
@@ -1129,7 +1129,7 @@ Strategy::get_ball_area( const Vector2D & ball_pos )
...
@@ -1129,7 +1129,7 @@ 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
)
{
{
static
bool
s_recover_mode
=
false
;
static
thread_local
bool
s_recover_mode
=
false
;
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