forked from kejingjing88212/MaCA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreward.py
127 lines (84 loc) · 2.79 KB
/
reward.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author: Gao Fang
@contact: gaofang@cetc.com.cn
@software: PyCharm
@file: reward.py
@time: 2018/4/19 0019 14:39
@desc: reward config
"""
class GlobalVar:
# reward
# detector radar see a detector
reward_radar_detector_detector = 20
# detector radar see a fighter
reward_radar_detector_fighter = 10
# fighter radar see a detector
reward_radar_fighter_detector = 20
# fighter radar see a fighter
reward_radar_fighter_fighter = 10
# Missile hit a detector
reward_strike_detector_success = 100
# Missile miss a detector
reward_strike_detector_fail = 0
# Missile hit a fighter
reward_strike_fighter_success = 100
# Missile miss a fighter
reward_strike_fighter_fail = 0
# A detector been destroyed
reward_detector_destroyed = -100
# A fighter been destroyed
reward_fighter_destroyed = -100
# A valid attack action
reward_strike_act_valid = 10
# An invalid attack action
reward_strike_act_invalid = -10
# Keep alive in a step
reward_keep_alive_step = 0
# Round reward:totally win
reward_totally_win = 200
# Round reward:totally lose
reward_totally_lose = -200
# Round reward:win
reward_win = 100
# Round reward:lose
reward_lose = -100
# Round reward:draw
reward_draw = 0
def get_reward_radar_detector_detector():
return GlobalVar.reward_radar_detector_detector
def get_reward_radar_detector_fighter():
return GlobalVar.reward_radar_detector_fighter
def get_reward_radar_fighter_detector():
return GlobalVar.reward_radar_fighter_detector
def get_reward_radar_fighter_fighter():
return GlobalVar.reward_radar_fighter_fighter
def get_reward_strike_detector_success():
return GlobalVar.reward_strike_detector_success
def get_reward_strike_detector_fail():
return GlobalVar.reward_strike_detector_fail
def get_reward_strike_fighter_success():
return GlobalVar.reward_strike_fighter_success
def get_reward_strike_fighter_fail():
return GlobalVar.reward_strike_fighter_fail
def get_reward_detector_destroyed():
return GlobalVar.reward_detector_destroyed
def get_reward_fighter_destroyed():
return GlobalVar.reward_fighter_destroyed
def get_reward_strike_act_valid():
return GlobalVar.reward_strike_act_valid
def get_reward_strike_act_invalid():
return GlobalVar.reward_strike_act_invalid
def get_reward_keep_alive_step():
return GlobalVar.reward_keep_alive_step
def get_reward_win():
return GlobalVar.reward_win
def get_reward_lose():
return GlobalVar.reward_lose
def get_reward_totally_win():
return GlobalVar.reward_totally_win
def get_reward_totally_lose():
return GlobalVar.reward_totally_lose
def get_reward_draw():
return GlobalVar.reward_draw