Skip to content

Commit

Permalink
UI updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ThorvaldAagaard committed Apr 25, 2024
1 parent 5b49419 commit 248573d
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,4 @@ gamedb*
install/**/*.bak
install/**/*.dir
install/**/*.dat
install/dist/table_manager_client.zip
4 changes: 2 additions & 2 deletions demo/viz.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,8 @@ class PlayInfo {

if ("candidates" in this.data && this.data.candidates.length > 0) {
html += '<h3>Candidates</h3>'
html += '<p>We have 3 different parameters for selecting the card, and first goal is to make/set the contract (if not matchpoints), then the double dummy score, and finally the score from the neural network.'
html += 'But if the quality of the samples are bad (or the nn suggest a specific card with confidence), then we select the that card.'
html += '<p>We have 3 different parameters for selecting the card, and first goal is to make/set the contract (if not matchpoints), then the double dummy score, and finally the score from the neural network. '
html += 'If the quality of the samples are bad (or the nn suggest a specific card with confidence), then we select the that card. '
html += 'Also be aware that the data is rounded to nearest even number before comparing.</p>'
html += '<table>'

Expand Down
4 changes: 2 additions & 2 deletions scripts/data/epbot/html/viz.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,8 @@ class PlayInfo {

if ("candidates" in this.data && this.data.candidates.length > 0) {
html += '<h3>Candidates</h3>'
html += '<p>We have 3 different parameters for selecting the card, and first goal is to make/set the contract (if not matchpoints), then the double dummy score, and finally the score from the neural network.'
html += 'But if the quality of the samples are bad (or the nn suggest a specific card with confidence), then we select the that card.'
html += '<p>We have 3 different parameters for selecting the card, and first goal is to make/set the contract (if not matchpoints), then the double dummy score, and finally the score from the neural network. '
html += 'If the quality of the samples are bad (or the nn suggest a specific card with confidence), then we select the that card. '
html += 'Also be aware that the data is rounded to nearest even number before comparing.</p>'
html += '<table>'

Expand Down
4 changes: 2 additions & 2 deletions src/bots.py
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,7 @@ def get_card_ev_mp(self, dd_solved, probabilities_list):
for ft, proba in zip(future_tricks, probabilities_list):
if ft < 0:
continue
ev_sum += ft * proba
ev_sum += ft * proba * 100
card_ev[card] = ev_sum

return card_ev
Expand All @@ -1167,7 +1167,7 @@ def get_card_ev_mp(self, dd_solved):
continue
tot_tricks = self.n_tricks_taken + ft
tot_decl_tricks = tot_tricks if self.player_i % 2 == 1 else 13 - tot_tricks
ev_sum += sign * tot_decl_tricks
ev_sum += sign * tot_decl_tricks * 100
card_ev[card] = ev_sum / len(future_tricks)

return card_ev
Expand Down
4 changes: 2 additions & 2 deletions src/config/default_api.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ matchpoint = True
contract = models/contract/contract-193200

[bidding]
bidder = UCBC 2024/Models/bidding_V2-5540000
info = UCBC 2024/Models/binfo_V2-5254000
bidder = models/archive/gib21/bidding_V2-5540000
info = models/archive/gib21_info/binfo_V2-5254000
# If there are multiple bids over this threshold make a simulation for the bids
search_threshold = 0.07
# If there is bid above this threshold, make that bid ignoring other bids
Expand Down
6 changes: 3 additions & 3 deletions src/frontend/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -619,12 +619,12 @@ <h3 class="samples" onclick="toggleSamples('sampleLines${bids}')"><strong>Sampl
}

function displayPlay(data, player, declarer) {
let html = "<h3>Play</h3><br> " + this.data["card"] + " selected by " + this.data["who"] + "<br/><br/>"
let html = "<h3>Play</h3><br> " + data["card"] + " selected by " + data["who"] + "<br/><br/>"

if ("candidates" in data && data.candidates.length > 0) {
html += '<h3>Candidates</h3>'
html += '<p>We have 3 different parameters for selecting the card, and first goal is to make/set the contract (if not matchpoints), then the double dummy score, and finally the score from the neural network.'
html += 'But if the quality of the samples are bad (or the nn suggest a specific card with confidence), then we select the that card.'
html += '<p>We have 3 different parameters for selecting the card, and first goal is to make/set the contract (if not matchpoints), then the double dummy score, and finally the score from the neural network. '
html += 'If the quality of the samples are bad (or the nn suggest a specific card with confidence), then we select the that card. '
html += 'Also be aware that the data is rounded to nearest even number before comparing.</p>'
html += '<table>'

Expand Down
4 changes: 2 additions & 2 deletions src/frontend/viz.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,8 @@ class PlayInfo {

if ("candidates" in this.data && this.data.candidates.length > 0) {
html += '<h3>Candidates</h3>'
html += '<p>We have 3 different parameters for selecting the card, and first goal is to make/set the contract (if not matchpoints), then the double dummy score, and finally the score from the neural network.'
html += 'But if the quality of the samples are bad (or the nn suggest a specific card with confidence), then we select the that card.'
html += '<p>We have 3 different parameters for selecting the card, and first goal is to make/set the contract (if not matchpoints), then the double dummy score, and finally the score from the neural network. '
html += 'If the quality of the samples are bad (or the nn suggest a specific card with confidence), then we select the that card. '
html += 'Also be aware that the data is rounded to nearest even number before comparing.</p>'
html += '<table>'

Expand Down
9 changes: 5 additions & 4 deletions src/table_manager_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,11 @@ async def connect(self, host, port):
matches = re.findall(pattern, opponents)

# Extracted text from the second set of quotes
if self.seat == "North" or self.seat == "South":
self.opponents = matches[1]
else:
self.opponents = matches[0]
if len(matches) > 1:
if self.seat == "North" or self.seat == "South":
self.opponents = matches[1]
else:
self.opponents = matches[0]

async def bidding(self):
vuln = [self.vuln_ns, self.vuln_ew]
Expand Down

0 comments on commit 248573d

Please sign in to comment.