Skip to content

Commit db490c0

Browse files
authored
Merge branch 'master' into structure
2 parents 4c55804 + cdf543d commit db490c0

File tree

7 files changed

+111
-94
lines changed

7 files changed

+111
-94
lines changed

ChangeLog.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ChangeLog
22

3-
## [0.1.3] - 2024-09-03
3+
## [0.1.4] - 2024-09-03
44

55
### Added
66
-
@@ -18,6 +18,19 @@
1818
- Add ```ignore_preprocess``` to the ```PlayerActions``` message.
1919
- Player Agents now first check whether they require preprocess actions, send the ```bool``` as the ```need_preprocess``` field in the ```State``` message. Then, if the server sends the ```ignore_preprocess=false (default value)``` to the proxy, the proxy will call ```doPreprocess``` method. If ther server sends the ```ignore_preprocess=true``` to the proxy, the proxy will not call the ```doPreprocess``` method and execute the ```PlayerActoins```.
2020

21+
22+
## [0.1.3] - 2024-09-02
23+
24+
### Added
25+
-
26+
27+
### Fixed
28+
- bug fixed in start files (by [NaderZare](https://github.com/naderzare), [ArefSayareh](https://github.com/Arefsa78))
29+
30+
### Changed
31+
- change input arguments names in start files (by [NaderZare](https://github.com/naderzare), [ArefSayareh](https://github.com/Arefsa78))
32+
33+
2134
## [0.1.2] - 2024-09-01
2235

2336
### Added

src/coach/main_coach.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,16 @@ main( int argc, char **argv )
8585
std::string rpc_type = "thrift";
8686

8787
for (int i = 0; i < argc; ++i) {
88-
if (std::string(argv[i]) == "--g-port") {
88+
if (std::string(argv[i]) == "--rpc-port") {
8989
grpc_port = std::stoi(argv[i+1]);
9090
}
91-
if (std::string(argv[i]) == "--diff-g-port") {
91+
if (std::string(argv[i]) == "--rpc-port-step") {
9292
use_same_grpc_port = false;
9393
}
94-
if (std::string(argv[i]) == "--gp20") {
94+
if (std::string(argv[i]) == "--rpc-add-20-to-port-for-right") {
9595
add_20_to_grpc_port_if_right_side = true;
9696
}
97-
if (std::string(argv[i]) == "--g-ip") {
97+
if (std::string(argv[i]) == "--rpc-host") {
9898
grpc_ip = argv[i+1];
9999
}
100100
if (std::string(argv[i]) == "--rpc-type") {

src/player/main_player.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,16 @@ main( int argc, char **argv )
8484
std::string rpc_type = "thrift";
8585

8686
for (int i = 0; i < argc; ++i) {
87-
if (std::string(argv[i]) == "--g-port") {
87+
if (std::string(argv[i]) == "--rpc-port") {
8888
grpc_port = std::stoi(argv[i+1]);
8989
}
90-
if (std::string(argv[i]) == "--diff-g-port") {
90+
if (std::string(argv[i]) == "--rpc-port-step") {
9191
use_same_grpc_port = false;
9292
}
93-
if (std::string(argv[i]) == "--gp20") {
93+
if (std::string(argv[i]) == "--rpc-add-20-to-port-for-right") {
9494
add_20_to_grpc_port_if_right_side = true;
9595
}
96-
if (std::string(argv[i]) == "--g-ip") {
96+
if (std::string(argv[i]) == "--rpc-host") {
9797
grpc_ip = argv[i+1];
9898
}
9999
if (std::string(argv[i]) == "--rpc-type") {

src/start-agent.sh.in

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ coach="${DIR}/sample_coach"
2626
teamname="SSP"
2727
host="localhost"
2828
port=6000
29-
g_ip="localhost"
30-
g_port=50051
31-
diff_g_port="false"
32-
gp20="false"
29+
rpc_host="localhost"
30+
rpc_port=50051
31+
rpc_port_step="false"
32+
rpc_add_20_to_port_for_right="false"
3333
rpc_type="thrift"
3434
coach_port=""
3535
debug_server_host=""
@@ -82,10 +82,10 @@ usage()
8282
echo " --log-dir DIRECTORY specifies debug log directory (default: /tmp)"
8383
echo " --debug-log-ext EXTENSION specifies debug log file extension (default: .log)"
8484
echo " --fullstate FULLSTATE_TYPE specifies fullstate model handling"
85-
echo " --g-ip GRPC IP specifies grpc IP (default: localhost)"
86-
echo " --g-port GRPC PORT specifies grpc port (default: 50051)"
87-
echo " --diff-g-port specifies different grpc port for each player (default: false)"
88-
echo " --gp20 add 20 to GRPC Port if team run on right side (default: false)"
85+
echo " --rpc-host RPC host specifies rpc host (default: localhost)"
86+
echo " --rpc-port RPC PORT specifies rpc port (default: 50051)"
87+
echo " --rpc-port-step specifies different rpc port for each player (default: false)"
88+
echo " --rpc-add-20-to-port-for-right add 20 to RPC Port if team run on right side (default: false)"
8989
echo " --rpc-type type of rpc framework (default: thrift) or grpc"
9090
echo " --goalie specifies to run as a goalie"
9191
echo " --player specifies to run as a player"
@@ -101,27 +101,27 @@ do
101101
usage
102102
exit 0
103103
;;
104-
--g-ip)
104+
--rpc-host)
105105
if [ $# -lt 2 ]; then
106106
usage
107107
exit 1
108108
fi
109-
g_ip="${2}"
109+
rpc_host="${2}"
110110
shift 1
111111
;;
112-
--g-port)
112+
--rpc-port)
113113
if [ $# -lt 2 ]; then
114114
usage
115115
exit 1
116116
fi
117-
g_port="${2}"
117+
rpc_port="${2}"
118118
shift 1
119119
;;
120-
--diff-g-port)
121-
diff_g_port="true"
120+
--rpc-port-step)
121+
rpc_port_step="true"
122122
;;
123-
--gp20)
124-
gp20="true"
123+
--rpc-add-20-to-port-for-right)
124+
rpc_add_20_to_port_for_right="true"
125125
;;
126126
--rpc-type)
127127
if [ $# -lt 2 ]; then
@@ -344,14 +344,14 @@ opt="${opt} --debug_server_host ${debug_server_host}"
344344
opt="${opt} --debug_server_port ${debug_server_port}"
345345
opt="${opt} ${offline_logging}"
346346
opt="${opt} ${debugopt}"
347-
opt="${opt} --g-ip ${g_ip}"
348-
opt="${opt} --g-port ${g_port}"
347+
opt="${opt} --rpc-host ${rpc_host}"
348+
opt="${opt} --rpc-port ${rpc_port}"
349349
opt="${opt} --rpc-type ${rpc_type}"
350-
if [ "${same_g_port}" = "true" ]; then
351-
opt="${opt} --diff-g-port"
350+
if [ "${rpc_port_step}" = "true" ]; then
351+
opt="${opt} --rpc-port-step"
352352
fi
353-
if [ "${gp20}" = "true" ]; then
354-
opt="${opt} --gp20"
353+
if [ "${rpc_add_20_to_port_for_right}" = "true" ]; then
354+
opt="${opt} --rpc-add-20-to-port-for-right"
355355
fi
356356

357357
ping -c 1 $host
@@ -374,14 +374,14 @@ if [ "${is_coach}" = "true" ]; then
374374
coachopt="${coachopt} --debug_server_port ${debug_server_port}"
375375
coachopt="${coachopt} ${offline_logging}"
376376
coachopt="${coachopt} ${debugopt}"
377-
coachopt="${coachopt} --g-ip ${g_ip}"
378-
coachopt="${coachopt} --g-port ${g_port}"
377+
coachopt="${coachopt} --rpc-host ${rpc_host}"
378+
coachopt="${coachopt} --rpc-port ${rpc_port}"
379379
coachopt="${coachopt} --rpc-type ${rpc_type}"
380-
if [ "${same_g_port}" = "true" ]; then
381-
coachopt="${coachopt} --diff-g-port"
380+
if [ "${rpc_port_step}" = "true" ]; then
381+
coachopt="${coachopt} --rpc-port-step"
382382
fi
383-
if [ "${gp20}" = "true" ]; then
384-
coachopt="${coachopt} --gp20"
383+
if [ "${rpc_add_20_to_port_for_right}" = "true" ]; then
384+
coachopt="${coachopt} --rpc-add-20-to-port-for-right"
385385
fi
386386
$coach ${coachopt} &
387387
fi

src/start.sh.in

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ coach="${DIR}/sample_coach"
2626
teamname="SSP"
2727
host="localhost"
2828
port=6000
29-
g_ip="localhost"
30-
g_port=50051
31-
diff_g_port="false"
32-
gp20="false"
29+
rpc_host="localhost"
30+
rpc_port=50051
31+
rpc_port_step="false"
32+
rpc_add_20_to_port_for_right="false"
3333
rpc_type="thrift"
3434
coach_port=""
3535
debug_server_host=""
@@ -84,10 +84,10 @@ usage()
8484
echo " --log-dir DIRECTORY specifies debug log directory (default: /tmp)"
8585
echo " --debug-log-ext EXTENSION specifies debug log file extension (default: .log)"
8686
echo " --fullstate FULLSTATE_TYPE specifies fullstate model handling"
87-
echo " --g-ip GRPC IP specifies grpc IP (default: localhost)"
88-
echo " --g-port GRPC PORT specifies grpc port (default: 50051)"
89-
echo " --diff-g-port specifies different grpc port for each player (default: false)"
90-
echo " --gp20 add 20 to GRPC Port if team run on right side (default: false)"
87+
echo " --rpc-host RPC host specifies rpc host (default: localhost)"
88+
echo " --rpc-port RPC PORT specifies rpc port (default: 50051)"
89+
echo " --rpc-port-step specifies different rpc port for each player (default: false)"
90+
echo " --rpc-add-20-to-port-for-right add 20 to RPC Port if team run on right side (default: false)"
9191
echo " --rpc-type type of rpc framework (default: thrift) or grpc"
9292
echo " FULLSTATE_TYPE is one of [ignore|reference|override].") 1>&2
9393
}
@@ -100,27 +100,27 @@ do
100100
usage
101101
exit 0
102102
;;
103-
--g-ip)
103+
--rpc-host)
104104
if [ $# -lt 2 ]; then
105105
usage
106106
exit 1
107107
fi
108-
g_ip="${2}"
108+
rpc_host="${2}"
109109
shift 1
110110
;;
111-
--g-port)
111+
--rpc-port)
112112
if [ $# -lt 2 ]; then
113113
usage
114114
exit 1
115115
fi
116-
g_port="${2}"
116+
rpc_port="${2}"
117117
shift 1
118118
;;
119-
--diff-g-port)
120-
diff_g_port="true"
119+
--rpc-port-step)
120+
rpc_port_step="true"
121121
;;
122-
--gp20)
123-
gp20="true"
122+
--rpc-add-20-to-port-for-right)
123+
rpc_add_20_to_port_for_right="true"
124124
;;
125125
--rpc-type)
126126
if [ $# -lt 2 ]; then
@@ -351,14 +351,14 @@ opt="${opt} --debug_server_host ${debug_server_host}"
351351
opt="${opt} --debug_server_port ${debug_server_port}"
352352
opt="${opt} ${offline_logging}"
353353
opt="${opt} ${debugopt}"
354-
opt="${opt} --g-ip ${g_ip}"
355-
opt="${opt} --g-port ${g_port}"
354+
opt="${opt} --rpc-host ${rpc_host}"
355+
opt="${opt} --rpc-port ${rpc_port}"
356356
opt="${opt} --rpc-type ${rpc_type}"
357-
if [ "${same_g_port}" = "true" ]; then
358-
opt="${opt} --diff-g-port"
357+
if [ "${rpc_port_step}" = "true" ]; then
358+
opt="${opt} --rpc-port-step"
359359
fi
360-
if [ "${gp20}" = "true" ]; then
361-
opt="${opt} --gp20"
360+
if [ "${rpc_add_20_to_port_for_right}" = "true" ]; then
361+
opt="${opt} --rpc-add-20-to-port-for-right"
362362
fi
363363

364364
ping -c 1 $host
@@ -408,14 +408,14 @@ if [ "${usecoach}" = "true" ]; then
408408
coachopt="${coachopt} --debug_server_port ${debug_server_port}"
409409
coachopt="${coachopt} ${offline_logging}"
410410
coachopt="${coachopt} ${debugopt}"
411-
coachopt="${coachopt} --g-ip ${g_ip}"
412-
coachopt="${coachopt} --g-port ${g_port}"
411+
coachopt="${coachopt} --rpc-host ${rpc_host}"
412+
coachopt="${coachopt} --rpc-port ${rpc_port}"
413413
coachopt="${coachopt} --rpc-type ${rpc_type}"
414-
if [ "${same_g_port}" = "true" ]; then
415-
coachopt="${coachopt} --diff-g-port"
414+
if [ "${rpc_port_step}" = "true" ]; then
415+
coachopt="${coachopt} --rpc-port-step"
416416
fi
417-
if [ "${gp20}" = "true" ]; then
418-
coachopt="${coachopt} --gp20"
417+
if [ "${rpc_add_20_to_port_for_right}" = "true" ]; then
418+
coachopt="${coachopt} --rpc-add-20-to-port-for-right"
419419
fi
420420

421421
if [ X"${offline_mode}" != X'' ]; then

src/train.sh.in

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ coach="${DIR}/sample_coach"
1818
trainer="${DIR}/sample_trainer"
1919
teamname="TRAINER_MODE"
2020
host="localhost"
21-
g_port=50051
22-
diff_g_port="false"
23-
gp20="false"
21+
rpc_host="localhost"
22+
rpc_port=50051
23+
rpc_port_step="false"
24+
rpc_add_20_to_port_for_right="false"
2425
rpc_type="thrift"
2526
config="${DIR}/player.conf"
2627
config_dir="${DIR}/formations-dt"
@@ -40,9 +41,10 @@ usage()
4041
echo "Possible options are:"
4142
echo " --help print this"
4243
echo " -h, --host HOST specifies server host"
43-
echo " --g_port GRPC PORT specifies grpc port (default: 50051)"
44-
echo " --diff_g_port specifies different grpc port for each player (default: false)"
45-
echo " --gp20 add 20 to GRPC Port if team run on right side (default: false)"
44+
echo " --rpc-host RPC host specifies rpc host (default: localhost)"
45+
echo " --rpc-port RPC PORT specifies rpc port (default: 50051)"
46+
echo " --rpc-port-step specifies different rpc port for each player (default: false)"
47+
echo " --rpc-add-20-to-port-for-right add 20 to RPC Port if team run on right side (default: false)"
4648
echo " --rpc-type type of rpc framework (default: thrift) or grpc"
4749
echo " -t, --teamname TEAMNAME specifies team name") 1>&2
4850
}
@@ -73,27 +75,27 @@ do
7375
teamname=$2
7476
shift 1
7577
;;
76-
--g-ip)
78+
--rpc-host)
7779
if [ $# -lt 2 ]; then
7880
usage
7981
exit 1
8082
fi
81-
g_ip="${2}"
83+
rpc_host="${2}"
8284
shift 1
8385
;;
84-
--g-port)
86+
--rpc-port)
8587
if [ $# -lt 2 ]; then
8688
usage
8789
exit 1
8890
fi
89-
g_port="${2}"
91+
rpc_port="${2}"
9092
shift 1
9193
;;
92-
--diff-g-port)
93-
diff_g_port="true"
94+
--rpc-port-step)
95+
rpc_port_step="true"
9496
;;
95-
--gp20)
96-
gp20="true"
97+
--rpc-add-20-to-port-for-right)
98+
rpc_add_20_to_port_for_right="true"
9799
;;
98100
--rpc-type)
99101
if [ $# -lt 2 ]; then
@@ -115,13 +117,14 @@ done
115117
OPT="-h ${host} -t ${teamname}"
116118
OPT="${OPT} --player-config ${config} --config_dir ${config_dir}"
117119
OPT="${OPT} ${debugopt}"
118-
opt="${opt} --g-port ${g_port}"
120+
opt="${opt} --rpc-host ${rpc_host}"
121+
opt="${opt} --rpc-port ${rpc_port}"
119122
opt="${opt} --rpc-type ${rpc_type}"
120-
if [ "${same_g_port}" = "true" ]; then
121-
OPT="${OPT} --diff-g-port"
123+
if [ "${rpc_port_step}" = "true" ]; then
124+
opt="${opt} --rpc-port-step"
122125
fi
123-
if [ "${gp20}" = "true" ]; then
124-
OPT="${OPT} --gp20"
126+
if [ "${rpc_add_20_to_port_for_right}" = "true" ]; then
127+
opt="${opt} --rpc-add-20-to-port-for-right"
125128
fi
126129
#if [ $number -gt 0 ]; then
127130
# $player ${OPT} -g &
@@ -138,12 +141,13 @@ fi
138141
$player ${OPT} -n 1 --rpc-type ${rpc_type} &
139142
$sleepprog $sleeptime
140143
trainer_opt="-h $host -t $teamname"
141-
trainer_opt="${trainer_opt} --g-port ${g_port}"
144+
trainer_opt="${trainer_opt} --rpc-host ${rpc_host}"
145+
trainer_opt="${trainer_opt} --rpc-port ${rpc_port}"
142146
trainer_opt="${trainer_opt} --rpc-type ${rpc_type}"
143-
if [ "${same_g_port}" = "true" ]; then
144-
trainer_opt="${trainer_opt} --diff-g-port"
147+
if [ "${rpc_port_step}" = "true" ]; then
148+
trainer_opt="${trainer_opt} --rpc-port-step"
145149
fi
146-
if [ "${gp20}" = "true" ]; then
147-
trainer_opt="${trainer_opt} --gp20"
150+
if [ "${rpc_add_20_to_port_for_right}" = "true" ]; then
151+
trainer_opt="${trainer_opt} --rpc-add-20-to-port-for-right"
148152
fi
149153
$trainer $trainer_opt &

0 commit comments

Comments
 (0)