Jump to content

action average not working


pescetom

Recommended Posts

Can anyone please spot why the following draft script gives 'Can't open temporary file' unless I comment out the 'action average' line?

What causes that error message in general?

Thanks.

 

Dealer script:

#
# 1NT vs 1M opening comparison
#
nt1517= hcp(north)>=15 and hcp(north)<=17
invite= hcp(south)>=8 and hcp(south)<=9
thingame= hcp(south)>=10 and hcp(south)<=10
safegame= hcp(south)>=11 and hcp(south)<=12
resp5332= shape(south, any 5332)
s5 = spades(north)==5 and shape(north, any 5332)
produce 20
action average "Avg. tricks if N plays in spades" (tricks(north,spades)), average "Avg. tricks if N plays in notrump" (tricks(north,notrump))
condition nt1517 and s5 and invite and resp5332

Link to comment
Share on other sites

move the condition above the action average statements

 

Dealer ignores whitespace and right now the silly thing believes that condition is part of the second average statement

Thanks.

nullve, that might be an issue with your 'Close Decision' script too (I tried moving the condition and got 10.29 for E in clubs).

Link to comment
Share on other sites

Thanks, that was the 'temp file' problem.

Maybe BBO could link the new page into the client (or at least a sticky topic in this forum) so it can be found more easily.

Link to comment
Share on other sites

nullve, that might be an issue with your 'Close Decision' script too (I tried moving the condition and got 10.29 for E in clubs).

Moving the condition doesn't seem to make much difference when I do it, but maybe it should. :unsure:

Link to comment
Share on other sites

If I may trouble you with some further teething problems..

 

I can't get 'printes' to work, even pasting in the example from the Input File:

action printes "Number of hearts: ", hearts(north), \n

gives 'syntax error'.

 

I needed this to debug an attempt at using 'score', which also gives syntax error in the line below, perhaps just because I have not found a valid value for the 'vulnerability' parameter (I tried using keywords none or EW, plus the expression vulnerable(none)):

action frequency "Freq 2s scores:" (score(none,"x2s",tricks(north,spades)),-300,170)

gives 'syntax error'.

Link to comment
Share on other sites

I needed this to debug an attempt at using 'score', which also gives syntax error in the line below, perhaps just because I have not found a valid value for the 'vulnerability' parameter (I tried using keywords none or EW, plus the expression vulnerable(none)):

action frequency "Freq 2s scores:" (score(none,"x2s",tricks(north,spades)),-300,170)

gives 'syntax error'.

 

vulnerable ({none|NS|EW|all})

Sets the vulnerability for the hand to 1 of the 4 possibilities, with none the default if the command is not in the input file.

This command is primarily intended for cases where action-list includes the printpbn action and the hands will be fed into another program for further analysis. These programs often require that the dealer and vulnerability are known. This command allows the user to set the vulnerability, the next command allows him to set the dealer.

 

[...]

 

score(vulnerability, contract, tricks)

Returns the positive or negative score that declarer will make if the given contract, at the given vulnerability condition, is played and the given number of tricks are made. The syntax for "contract" is of the form "x3N" for 3 no-trumps, "x7C" for 7 clubs, etc; the leading "x" is needed. There is currently no way to specify that the contract is doubled, nor that it is re-doubled. The result will be positive if the contract makes, negative if it goes down.

I don't know how to make the 'score' operator work, either, but my guess is that the 'vulnerability' argument does not have everything to do with the 'vulnerable' operator. (For example, if 'vulnerable' is set to 'EW', then the contract is vulnerable iff played by EW.)

Link to comment
Share on other sites

I don't know how to make the 'score' operator work, either, but my guess is that the 'vulnerability' argument does not have everything to do with the 'vulnerable' operator. (For example, if 'vulnerable' is set to 'EW', then the contract is vulnerable iff played by EW.)

I tried setting 'vulnerability' to NS at the top of the script and that worked, but did not help when parsing 'score'.

As first argument to score I tried none, "none", NS, 0, blank etc.

I also tried omitting the first argument altogether.

I think it knows it is parsing the function score, if I change the name I get 'unknown variable'.

 

I see that this old thread asked the same question and got no answer.

Surely such a precious function will have been used by someone (or at least be known to be broken)?

Link to comment
Share on other sites

Script:

 

produce 1
action printes (score(vul,x7C,13),\n)

Run:

 

2140
Generated 1 hands
Produced 1 hands
Initial random seed 1603746614
Time needed    0.000 sec

So the first argument is 'vul' if the contract is vulnerable.

 

Haven't figured out what it is when the contract is not vulnerable.

Link to comment
Share on other sites

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...