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
02cb7518
Commit
02cb7518
authored
May 26, 2015
by
Matthew Hausknecht
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Redesigned the port allocation arguments.
parent
231a5252
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
12 deletions
+13
-12
bin/Trainer.py
bin/Trainer.py
+3
-3
bin/start.py
bin/start.py
+6
-6
src/agent.cpp
src/agent.cpp
+3
-2
src/agent.h
src/agent.h
+1
-1
No files found.
bin/Trainer.py
View file @
02cb7518
...
@@ -33,8 +33,8 @@ class Trainer(object):
...
@@ -33,8 +33,8 @@ class Trainer(object):
"""
"""
def
__init__
(
self
,
args
,
rng
=
numpy
.
random
.
RandomState
()):
def
__init__
(
self
,
args
,
rng
=
numpy
.
random
.
RandomState
()):
self
.
_rng
=
rng
# The Random Number Generator
self
.
_rng
=
rng
# The Random Number Generator
self
.
_serverPort
=
args
.
basePort
# The port the server is listening on
self
.
_serverPort
=
args
.
port
+
1
# The port the server is listening on
self
.
_coachPort
=
args
.
basePort
+
1
# The coach port to talk with the server
self
.
_coachPort
=
args
.
port
+
2
# The coach port to talk with the server
self
.
_logDir
=
args
.
logDir
# Directory to store logs
self
.
_logDir
=
args
.
logDir
# Directory to store logs
self
.
_numOffense
=
args
.
numOffense
# Number offensive players
self
.
_numOffense
=
args
.
numOffense
# Number offensive players
self
.
_numDefense
=
args
.
numDefense
# Number defensive players
self
.
_numDefense
=
args
.
numDefense
# Number defensive players
...
@@ -66,7 +66,7 @@ class Trainer(object):
...
@@ -66,7 +66,7 @@ class Trainer(object):
self
.
_agentTeam
=
''
# Name of the team the agent is playing for
self
.
_agentTeam
=
''
# Name of the team the agent is playing for
self
.
_agentNumInt
=
-
1
# Agent's internal team number
self
.
_agentNumInt
=
-
1
# Agent's internal team number
self
.
_agentNumExt
=
-
1
# Agent's external team number
self
.
_agentNumExt
=
-
1
# Agent's external team number
self
.
_agentServerPort
=
args
.
basePort
+
8
# Port for agent's server
self
.
_agentServerPort
=
args
.
port
# Port for agent's server
# =============== MISC =============== #
# =============== MISC =============== #
self
.
_offenseTeam
=
''
# Name of the offensive team
self
.
_offenseTeam
=
''
# Name of the offensive team
self
.
_defenseTeam
=
''
# Name of the defensive team
self
.
_defenseTeam
=
''
# Name of the defensive team
...
...
bin/start.py
View file @
02cb7518
...
@@ -43,9 +43,9 @@ def main(args, team1='left', team2='right', rng=numpy.random.RandomState()):
...
@@ -43,9 +43,9 @@ def main(args, team1='left', team2='right', rng=numpy.random.RandomState()):
if
not
os
.
path
.
exists
(
args
.
logDir
):
if
not
os
.
path
.
exists
(
args
.
logDir
):
os
.
makedirs
(
args
.
logDir
)
os
.
makedirs
(
args
.
logDir
)
binary_dir
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
binary_dir
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
server_port
=
args
.
basePort
server_port
=
args
.
port
+
1
coach_port
=
args
.
basePort
+
1
coach_port
=
args
.
port
+
2
olcoach_port
=
args
.
basePort
+
2
olcoach_port
=
args
.
port
+
3
serverOptions
=
' server::port=
%
i server::coach_port=
%
i '
\
serverOptions
=
' server::port=
%
i server::coach_port=
%
i '
\
'server::olcoach_port=
%
i server::coach=1 '
\
'server::olcoach_port=
%
i server::coach=1 '
\
'server::game_log_dir=
%
s server::text_log_dir=
%
s'
\
'server::game_log_dir=
%
s server::text_log_dir=
%
s'
\
...
@@ -108,9 +108,9 @@ def parseArgs(args=None):
...
@@ -108,9 +108,9 @@ def parseArgs(args=None):
help
=
'Don
\'
t use a learning agent.'
)
help
=
'Don
\'
t use a learning agent.'
)
p
.
add_argument
(
'--no-sync'
,
dest
=
'sync'
,
action
=
'store_false'
,
default
=
True
,
p
.
add_argument
(
'--no-sync'
,
dest
=
'sync'
,
action
=
'store_false'
,
default
=
True
,
help
=
'Run server in non-sync mode'
)
help
=
'Run server in non-sync mode'
)
p
.
add_argument
(
'--
base-port'
,
dest
=
'baseP
ort'
,
type
=
int
,
default
=
6000
,
p
.
add_argument
(
'--
port'
,
dest
=
'p
ort'
,
type
=
int
,
default
=
6000
,
help
=
'
Base port for communications. rcssserver will use this
\
help
=
'
Agent server
\'
s port. rcssserver, coach, and ol_coach'
\
port and all other ports will be allocated incrementally
.'
)
' will be incrementally allocated the following ports
.'
)
p
.
add_argument
(
'--log-dir'
,
dest
=
'logDir'
,
default
=
'log/'
,
p
.
add_argument
(
'--log-dir'
,
dest
=
'logDir'
,
default
=
'log/'
,
help
=
'Directory to store logs.'
)
help
=
'Directory to store logs.'
)
return
p
.
parse_args
(
args
=
args
)
return
p
.
parse_args
(
args
=
args
)
...
...
src/agent.cpp
View file @
02cb7518
...
@@ -117,10 +117,11 @@ void error(const char *msg)
...
@@ -117,10 +117,11 @@ void error(const char *msg)
#define ADD_NORM_FEATURE(val, min_val, max_val) \
#define ADD_NORM_FEATURE(val, min_val, max_val) \
assert(featIndx < numFeatures); \
assert(featIndx < numFeatures); \
if (val < min_val || val > max_val) { std::cout << "Violated Feature Bounds: " << val << " Expected min/max: [" << min_val << ", " << max_val << "]" << std::endl;} \
if (val < min_val || val > max_val) { std::cout << "Violated Feature Bounds: " << val << " Expected min/max: [" << min_val << ", " << max_val << "]" << std::endl;} \
assert(val >= min_val); \
assert(val <= max_val); \
feature_vec[featIndx++] = ((val - min_val) / (max_val - min_val)) \
feature_vec[featIndx++] = ((val - min_val) / (max_val - min_val)) \
* (FEAT_MAX - FEAT_MIN) + FEAT_MIN;
* (FEAT_MAX - FEAT_MIN) + FEAT_MIN;
// assert(val >= min_val); \
// assert(val <= max_val); \
#define LOG_FEATURE(val) \
#define LOG_FEATURE(val) \
if (val <= min_feat_val) \
if (val <= min_feat_val) \
...
...
src/agent.h
View file @
02cb7518
...
@@ -107,7 +107,7 @@ protected:
...
@@ -107,7 +107,7 @@ protected:
const
static
float
observedSelfSpeedMax
=
0.46
;
const
static
float
observedSelfSpeedMax
=
0.46
;
const
static
float
observedPlayerSpeedMax
=
0.75
;
const
static
float
observedPlayerSpeedMax
=
0.75
;
const
static
float
observedStaminaMax
=
8000.
;
const
static
float
observedStaminaMax
=
8000.
;
const
static
float
observedBallSpeedMax
=
3
.0
;
const
static
float
observedBallSpeedMax
=
5
.0
;
float
maxHFORadius
;
// Maximum possible distance in HFO playable region
float
maxHFORadius
;
// Maximum possible distance in HFO playable region
// Useful measures defined by the Server Parameters
// Useful measures defined by the Server Parameters
float
pitchLength
,
pitchWidth
,
pitchHalfLength
,
pitchHalfWidth
,
float
pitchLength
,
pitchWidth
,
pitchHalfLength
,
pitchHalfWidth
,
...
...
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