(self)
return legal_actions
Returns:
            list:   a list with none, one or multiple actions of the set [FOLD, CHECK/CALL, BETSIZE_1, BETSIZE_2, ...]
def get_legal_actions(self):
        """

        Returns:
            list:   a list with none, one or multiple actions of the set [FOLD, CHECK/CALL, BETSIZE_1, BETSIZE_2, ...]

        """
        legal_actions = []

        # Fold, Check/Call
        for a_int in [Poker.FOLD, Poker.CHECK_CALL]:
            _a = self._get_env_adjusted_action_formulation(action_int=a_int)
            if self._get_fixed_action(action=_a)[0] == a_int:
                legal_actions.append(a_int)

        # since raises are ascending in the list, we can simply loop and break
        _last_too_small = None
        for a in range(2, self.N_ACTIONS):  # only loops through raises
            adj_a = self._get_env_adjusted_action_formulation(action_int=a)
            fixed_a = self._get_fixed_action(action=adj_a)

            if adj_a[0] != fixed_a[0]:  # if we wanted to raise, but env told us we can not, dont append a raise
                break

            if (adj_a[1] < fixed_a[1]) and a < self.N_ACTIONS:
                _last_too_small = a
            else:
                if _last_too_small is not None:
                    legal_actions.append(_last_too_small)  # was to small, but rounded to minraise & is unique -> append
                    _last_too_small = None

                legal_actions.append(a)  # this action might be modified by env, but is legal and unique -> append

            if adj_a[1] > fixed_a[1]:  # if the raise was too big, an even bigger one will yield the same result
                break
        assert len(legal_actions) > 0
        return legal_actions
def get_legal_actions ( self ) : legal_actions = [ ] # Fold, Check/Call for a_int in [ Poker . FOLD , Poker . CHECK_CALL ] : _a = self . _get_env_adjusted_action_formulation ( action_int = a_int ) if self . _get_fixed_action ( action = _a ) [ 0 ] == a_int : legal_actions . append ( a_int ) # since raises are ascending in the list, we can simply loop and break _last_too_small = None for a in range ( 2 , self . N_ACTIONS ) : # only loops through raises adj_a = self . _get_env_adjusted_action_formulation ( action_int = a ) fixed_a = self . _get_fixed_action ( action = adj_a ) if adj_a [ 0 ] != fixed_a [ 0 ] : # if we wanted to raise, but env told us we can not, dont append a raise break if ( adj_a [ 1 ] < fixed_a [ 1 ] ) and a < self . N_ACTIONS : _last_too_small = a else : if _last_too_small is not None : legal_actions . append ( _last_too_small ) # was to small, but rounded to minraise & is unique -> append _last_too_small = None legal_actions . append ( a ) # this action might be modified by env, but is legal and unique -> append if adj_a [ 1 ] > fixed_a [ 1 ] : # if the raise was too big, an even bigger one will yield the same result break assert len ( legal_actions ) > 0 return legal_actions