BBO Discussion Forums: Using Constraints that include dealer - BBO Discussion Forums

Jump to content

Page 1 of 1

Using Constraints that include dealer

#1 User is offline   CraigRT 

  • Pip
  • Group: Members
  • Posts: 8
  • Joined: 2022-February-06
  • Gender:Male
  • Location:Australia

Posted 2022-October-23, 21:10

I am trying to create a constraints rule set to practice Cappaletti - overcalling a strong 1NT opening. As part of that I would like to use different constraints depending on which seat is the dealer. Is there a way to do this?
eg:
if Dealer(east) ( # constraints to set up south's hand)

Or, does anyone have a constraint file that does Cappaletti already?

Thanks.
0

#2 User is online   sfi 

  • PipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 2,576
  • Joined: 2009-May-18
  • Location:Oz

Posted 2022-October-23, 21:49

I don't believe the syntax includes a check for dealer. It does have a dealer() call, but that sets the dealer rather than checks for it, and I'm not sure if it works in generating practice hands.

What I've always done in your situation is to set up South as the strong NT and give West the overcall, and then use the BBO checkbox to 'Randomly rotate generated deals 180 degress'. If we really want to give us the best chance, we just agree to pass if we're not the hand with the strong NT. It doesn't always work but you'll get a bunch of practice this way.

My first stab at a set of constraints for this scenario are below. It covers penalty doubles, single-suited overcalls, both majors, 5M/4m, and any 5/5 hands. It obviously can be made more sophisticated, but it should capture most hands that would overcall.

1NT_S = shape(south, any 4333 + any 4423 + any 5332) and hcp(south)>=15 and hcp(south)<=17
W_double = hcp(west)>15
W_ocall = shape(west, any 6xxx + any 7xxx + any 55xx + 5xxx + x5xx - any 5332) and hcp(west)>=10

Capp_W = W_double or W_ocall
condition 1NT_S and Capp_W


P.S. If you don't already know, you can construct and test your hand generator scripts at https://www.bridgeba...ler/dealer.php.
0

#3 User is offline   CraigRT 

  • Pip
  • Group: Members
  • Posts: 8
  • Joined: 2022-February-06
  • Gender:Male
  • Location:Australia

Posted 2022-October-23, 23:14

View Postsfi, on 2022-October-23, 21:49, said:

What I've always done in your situation is to set up South as the strong NT and give West the overcall, and then use the BBO checkbox to 'Randomly rotate generated deals 180 degress'.


Thanks sfi, that's a great way of doing it. It makes it all a lot simpler to use that rather than duplicating a lot of the constraints rotated around in code.

Quote

My first stab at a set of constraints for this scenario are below.


That's interesting. Is there an advantage to defining it that way? It just looks different from the way I have been doing it. There's not a huge amount of resources I've seen to learn from so am struggling a little.

What I had so far is this. Then I was going to duplicate those south rules for north. Your trick above will make that easier. I can combine that with making only certain positions deal.


(
    (
        hcp(east) >= 15 and hcp(east) <= 17 and
        shape(east, any 4333 + any 4432 + any 5332)
    )
    or
    (
        hcp(west) >= 15 and hcp(west) <= 17 and
        shape(west, any 4333 + any 4432 + any 5332)
    )
)
and
(
    // *** South Hand rules ***
    // Lots of points - to double for penalties
    hcp(south) > 16 or
    (
        hcp(south) > 9 and
        (
            // Single suited
            shape(south, any 6xxx + any 7xxx + any 8xxx + any 9xxx) or
            // Both majors
            shape(south, 45xx + 55xx + 54xx) or
            // Hearts and a minor
            shape(south, x55x + x5x5 + x45x + x4x5 + x54x + x5x4) or
            // Spades and a minor
            shape(south, 5x5x + 5xx5 + 4x5x + 4xx5 + 5x4x + 5xx4) or
            // Both minors
            shape(south, xx55 + xx54 + xx45) 
        )
    )
)

0

#4 User is online   sfi 

  • PipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 2,576
  • Joined: 2009-May-18
  • Location:Oz

Posted 2022-October-23, 23:38

The documentation says that the shape call can handle as many shape descriptions as you want without slowing it down, so having only one shape call should make it run faster. That's probably not such an issue when you're only producing one hand at a time, but it's just a habit I've gotten into. I also like to name the intermediate constraints for two reasons - I can build up the query and test parts of it at a time, and I can reuse individual parts in a later query (I have a few documents with saved tests). It just matches the way I put these calls together.

Given the shapes you want to include, you can just reduce the bottom section to:

hcp(south)>9 and shape(south, any xxxx - any 4333 - any 4432 - any 4441 - any 5332)


The first 10 hands I generated with this would all happily overcall a strong NT. However, you are including 4M/5m hands, which are not typically 2M overcalls playing Cappelletti.

The only documentation I've found is linked to the test page I mentioned above. It mentions a bunch of examples at the bottom of the syntax page, but TBH I've never looked through them so I don't know how useful they would be.
0

Page 1 of 1


Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users