From 752bb313b7a868c51835042fa3348636432627ff Mon Sep 17 00:00:00 2001 From: thorvald Date: Tue, 4 Jun 2024 13:35:37 +0200 Subject: [PATCH] Fixing skip rescue --- src/bots.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/bots.py b/src/bots.py index d21b2a4d..3cb4d045 100644 --- a/src/bots.py +++ b/src/bots.py @@ -257,11 +257,12 @@ def bid(self, auction): print(samples[i].split(" ")[(self.seat + 2) % 4]) X = self.get_binary_contract(self.seat, self.vuln, self.hand_str, samples[i].split(" ")[(self.seat + 2) % 4]) contract_id, doubled, tricks = self.models.contract_model.model[0](X) - contract = bidding.ID2BID[contract_id] + ("X" if doubled else "") + contract = bidding.ID2BID[contract_id] + # If game bid in major do not bid 5 of that major if current_contract == contract: if self.verbose: print("Contract bid, stopping rescue") - alternatives = {} + alternatives = {} break # if the contract is in candidates we assume previous calculations are right and we stop @@ -269,12 +270,12 @@ def bid(self, auction): if c.bid == contract: if self.verbose: print("Contract found in candidates, stopping rescue") - alternatives = {} + alternatives = {} break # Skip invalid bids if bidding.can_bid(contract, auction): result = {"contract": contract, "tricks": tricks} - score = scoring.score(contract, self.vuln, tricks) + score = scoring.score(contract + ("X" if doubled else ""), self.vuln, tricks) if self.verbose: print(result, score) if contract not in alternatives: