-
Notifications
You must be signed in to change notification settings - Fork 0
/
agent.py
61 lines (49 loc) · 1.61 KB
/
agent.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
from abc import ABC, abstractmethod
class Agent(ABC):
# return: name of the territory to be reinforced
# abstract method
def reinforce_territory(self, state):
pass
# return: <to>, <from>, <troop_count>
# <to> which territory to fortify
# <from> which neighboring territory
# <troop_count> with how many troops
# abstract method
def fortify_territory(self, state):
pass
# return: 1 or 2 (number of troops committed to defend attacked_territory)
# abstract method
def defend_territory(self, state, attacked_territory):
pass
# return: boolean, whether the agent wants to attack or not
# abstract method
def wants_to_attack(self, state):
pass
# return: territory, attack source
# abstract method
def select_attack_source(self, state):
pass
# return: territory, attack target
# abstract method
def select_attack_target(self, state, source):
pass
# return: integer, troops involved in attack
# abstract method
def select_attack_count(self, state, source):
pass
# return: boolean, whether the agent wants to fortify or not
# abstract method
def wants_to_fortify(self, state):
pass
# return: territory, fortify source
# abstract method
def select_fortify_source(self, state, target):
pass
# return: territory, fortify target
# abstract method
def select_fortify_target(self, state):
pass
# return: integer, troops involved in fortification
# abstract method
def select_fortify_count(self, state, source):
pass