Skip to content

Commit 6db02ff

Browse files
authored
Merge pull request #12 from CLSFramework/develop
Develop
2 parents 26c46cc + d128287 commit 6db02ff

File tree

11 files changed

+117
-20257
lines changed

11 files changed

+117
-20257
lines changed

.github/workflows/generate.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Generate Thrift Code
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
generate:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
with:
16+
token: ${{ secrets.GITHUB_TOKEN }}
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: '3.x'
22+
23+
- name: Install Thrift
24+
run: |
25+
sudo apt-get install -y thrift-compiler
26+
python3 -m pip install --upgrade pip
27+
pip install -r requirements.txt
28+
29+
- name: Run generate.sh
30+
run: |
31+
chmod +x ./generate.sh
32+
./generate.sh
33+
34+
- name: Check for changes
35+
run: |
36+
git config --global user.name "github-actions[bot]"
37+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
38+
git add soccer/*
39+
if ! git diff --cached --quiet; then
40+
git commit -m "Automated update: Generated Thrift classes"
41+
else
42+
echo "No changes detected, skipping commit."
43+
fi
44+
45+
- name: Push changes
46+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
47+
run: |
48+
git push origin main
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ soccer/__pycache__/
1212
scripts/proxy
1313
scripts/rcssserver
1414
__pycache__/
15+
logs/

generate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
thrift --gen py -out ./ ./idl/*.thrift
44

5-
python type_generator.py
5+
python3 type_generator.py

idl/soccer_service.thrift

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// version 1.6
1+
// version 1.7
22

33
namespace cpp soccer
44
namespace py soccer
@@ -761,6 +761,58 @@ struct HeliosGoalieKick {}
761761

762762
struct HeliosShoot {}
763763

764+
struct OpponentEffector {
765+
1: list<double> negetive_effect_by_distance,
766+
2: bool negetive_effect_by_distance_based_on_first_layer,
767+
3: list<double> negetive_effect_by_reach_steps,
768+
4: bool negetive_effect_by_reach_steps_based_on_first_layer
769+
}
770+
771+
struct ActionTypeEffector {
772+
1: double direct_pass,
773+
2: double lead_pass,
774+
3: double through_pass,
775+
4: double short_dribble,
776+
5: double long_dribble,
777+
6: double cross,
778+
7: double hold
779+
}
780+
781+
struct TeammateEffector {
782+
1: map<i32, double> coefficients,
783+
2: bool apply_based_on_first_layer
784+
}
785+
786+
struct PlannerEvaluationEffector {
787+
1: optional OpponentEffector opponent_effector,
788+
2: optional ActionTypeEffector action_type_effector,
789+
3: optional TeammateEffector teammate_effector
790+
}
791+
792+
struct HeliosFieldEvaluator {
793+
1: double x_coefficient,
794+
2: double ball_dist_to_goal_coefficient,
795+
3: double effective_max_ball_dist_to_goal
796+
}
797+
798+
struct MatrixFieldEvaluatorY {
799+
1: list<double> evals
800+
}
801+
802+
struct MatrixFieldEvaluator {
803+
1: list<MatrixFieldEvaluatorY> evals
804+
}
805+
806+
struct PlannerFieldEvaluator {
807+
1: optional HeliosFieldEvaluator helios_field_evaluator,
808+
2: optional MatrixFieldEvaluator matrix_field_evaluator
809+
}
810+
811+
struct PlannerEvaluation {
812+
1: PlannerEvaluationEffector effectors,
813+
2: PlannerFieldEvaluator field_evaluators
814+
}
815+
764816
struct HeliosOffensivePlanner {
765817
1: bool direct_pass,
766818
2: bool lead_pass,
@@ -771,7 +823,10 @@ struct HeliosOffensivePlanner {
771823
7: bool simple_pass,
772824
8: bool simple_dribble,
773825
9: bool simple_shoot
774-
10: bool server_side_decision
826+
10: bool server_side_decision,
827+
11: i32 max_depth,
828+
12: i32 max_nodes,
829+
13: PlannerEvaluation evaluation
775830
}
776831

777832
struct HeliosBasicOffensive {}
@@ -861,7 +916,9 @@ struct PlayerActions {
861916
1: list<PlayerAction> actions,
862917
2: bool ignore_preprocess,
863918
3: bool ignore_doforcekick,
864-
4: bool ignore_doHeardPassRecieve
919+
4: bool ignore_doHeardPassRecieve,
920+
5: bool ignore_doIntention,
921+
6: bool ignore_shootInPreprocess
865922
}
866923

867924
struct ChangePlayerType {
@@ -1289,4 +1346,5 @@ service Game {
12891346
RegisterResponse Register(1: RegisterRequest request),
12901347
Empty SendByeCommand(1: RegisterResponse register_response),
12911348
BestPlannerActionResponse GetBestPlannerAction(1: BestPlannerActionRequest best_planner_action_request)
1292-
}
1349+
}
1350+

server.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ def GetPlayerActions(self, state: State):
4444
if state.world_model.myself.is_goalie:
4545
actions.append(PlayerAction(helios_goalie=HeliosGoalie()))
4646
elif state.world_model.myself.is_kickable:
47+
# First action is the most important one
48+
actions.append(PlayerAction(helios_shoot=HeliosShoot()))
4749
actions.append(PlayerAction(helios_offensive_planner=HeliosOffensivePlanner(lead_pass=True,
4850
direct_pass=True,
4951
through_pass=True,
@@ -53,8 +55,7 @@ def GetPlayerActions(self, state: State):
5355
simple_shoot=True,
5456
simple_dribble=True,
5557
cross=True,
56-
server_side_decision=True)))
57-
actions.append(PlayerAction(helios_shoot=HeliosShoot()))
58+
server_side_decision=False)))
5859
else:
5960
actions.append(PlayerAction(helios_basic_move=HeliosBasicMove()))
6061
else:

soccer/Game-remote

Lines changed: 0 additions & 180 deletions
This file was deleted.

0 commit comments

Comments
 (0)