// intToAction returns the string action that corresponds to the given integer

intToAction returns the string action that corresponds to the given integer
// intToAction returns the string action that corresponds to the given integer
func (strat *AlphaStrategy) intToAction(i int) string {
	if i == strat.numberOfActions {
		return ""
	}
	unit := i % (strat.numberOfActions - 1)
	lane := i / (strat.numberOfActions - 1)
	if unit < len(tdef.AllTowers) {
		unit = tdef.AllTowers[unit].Enum
	} else {
		unit = tdef.AllTroops[unit-len(tdef.AllTowers)].Enum
	}
	var action string
	if unit < 10 {
		action = fmt.Sprintf("b0%d 0%d", unit, lane)
	} else {
		action = fmt.Sprintf("b%d 0%d", unit, lane)
	}
	return action
}
func ( strat * AlphaStrategy ) intToAction ( i int ) string { if i == strat . numberOfActions { return " " } unit := i % ( strat . numberOfActions - 1 ) lane := i / ( strat . numberOfActions - 1 ) if unit < len ( tdef . AllTowers ) { unit = tdef . AllTowers [ unit ] . Enum } else { unit = tdef . AllTroops [ unit - len ( tdef . AllTowers ) ] . Enum } var action string if unit < 10 { action = fmt . Sprintf ( " " , unit , lane ) } else { action = fmt . Sprintf ( " " , unit , lane ) } return action }
intToAction returns the string action that corresponds to the given integer
intToAction returns the string action that corresponds to the given integer