The opponents hands are generated according to the seating order of the players (the small blind gets cards first and the dealer gets cards last). The criterion for assigning the hole cards to an opponent depends on whether the opponent is still active in the game or not. Hole cards are dealt to the folded players because we want to choose the cards to come (turn and river cards) not only from the correct number of cards, but also from cards with the correct distribution of weak/strong cards.
To deal the hole cards to an opponent, the Simulator uses selective sampling. It randomly extracts two cards from the deck and generates a random number in the range 0.0-1.0. In the case of an opponent already folded, the cards extracted are kept as the opponent's hole cards if the preflop hand value (income rate of the hand) is less than the random number; otherwise, the cards are returned to the deck and the generation process is repeated. Thus, preference is given to weak hands (hands that are likely to fold on the preflop). For an opponent who is still active in the game, the cards extracted are kept if the weight for the two cards in the weight table of the opponent is greater than or equal to the random number; otherwise, the cards are re-inserted into the deck, and the Simulator extracts two cards and generates another random number. Since the weight of a pair of cards indicates the likelihood of the opponent holding these cards, preference is given to the most likely holdings. However, all the two-card combinations have some opportunities to be selected.
In analyzing the results of self-play experiments with selective sampling simulation, we noticed that simulations contain high variance and a lot of noise. We need to keep the sampling in the simulation as representative and fair as possible to get the best possible (reliable) results. Thus, different methods to reduce variance have to be tested. For example, in the current version, a random selection of the turn and river cards is made for every trial in a simulation. To reduce statistical anomalies and variance, one can obtain a perfect representation of the one-card potential by dealing all 47 possible turn cards exactly once. Then a certain number of river cards can be chosen, without replacement, for each of these turn cards.