Я новичок в обучении с подкреплением и создаю среду для обучения агента игре в кости Zomb ie (правила игры https://www.instructables.com/id/How-to-play-Zombie-Dice/) и хочу пройти через состояние, следы, собранные агентом в текущем ходу. Мои следы находятся внутри списка. Поэтому моя нижняя переменная для наблюдения_пространства minNumFoot = [].
Будет ли моя верхняя переменная maxNumFoot = [] * 3 (я хочу, чтобы это было что-то подобное [footprint, footprint, footprint] ??
PS, внутри списка находятся элементы footprint, содержащие цвет кости и 6 граней кости.
def __init__(self):
self.brains = 0
self.shotguns = 0
self.footprints = 0
self.dice = [GreenDice(),
GreenDice(),
GreenDice(),
GreenDice(),
GreenDice(),
GreenDice(),
YellowDice(),
YellowDice(),
YellowDice(),
YellowDice(),
RedDice(),
RedDice(),
RedDice()] # list
self.minBrains = 0
self.maxBrains = 29
self.minShotguns = 0
self.maxShotguns = 25
self.minFootprints = 0
self.maxFootprints = 26
self.minNumFootprints = [] # or just 0 / min number
# the agent can have in current turn
self.maxNumFootprints = []*3 # or just 3 / max number
# of footprints the agent can have in a turn
self.minDices = 0 # min num of dices in the cup
self.maxDices = 13 # max num of dices in the cup
Также в 2 приведенных выше строках (self.minDices) указан минимум ... maxDices должен быть размером списка костей, это правильно? Если это правильно, то это будет то же самое для min ..., maxNumFootprints?
self.maxGreen = 6
self.action_space = spaces.Discrete(2)
self.low = np.array([self.minBrains, self.minShotguns, self.minFootprints, self.minDices])
self.high = np.array([self.maxBrains, self.maxShotguns, self.maxFootprints, self.maxDices])
self.observation_space = spaces.Box(self.low, self.high, dtype=np.int)
self.done = None
self.loss_threshold = 2
self.win_threshold = 12
self.seed()
self.viewer = None
self.state = None
self.reward = 0
....
reuseDice = [] # list of rolled footprints dices
b = 0 # int to hold number of brains rolled
s = 0 # int to hold number of shotguns rolled
pickedDice = self.dicePicker(reuseDice)
Этот список reuseDice содержит количество следов, собранных агентом за ход и отправленных в функцию, которая решает, были ли брошены кубики, чтобы агент мог собрать больше кубиков.
...
self.state = (brains, shotguns, footprints, reuseDice, dice)
# Here brains, shotguns, footprints is the num of what agent
# has collected in the current turn, dice is the list
# of all the unrolled dices in the cup and reuseDice
# is the list with the element of footprints
return self.reward, cont, np.array(self.state)
Я знаю, это звучит очень запутанно, как я это объясняю, и я сожалею об этом.