Activity points from discarded races

Hi,

I’m trying to use Sailwave for calculating a series including a large number of races (40 or so) during the season for 200+ boats. The SI for the series says that only the six best races are included, but you get activity points from the discarded races. Thus I set discard as “s-6” to get only the six best scores. How do I add one (DNF/OCS/DSQ) or two (any finished postion) activity point for each discarded race to the Nett points?

Also there’s a special rule for series ties. The boat with more races wins a tie. How to do that?

I needed to make a special formula for the point system and I got some help that releaved you can use conditional statements like lte(), gte() etc. I didn’t find any documentation about those. Is it available somewhere?

Best Regards,

Joakim

Hi Joakim,

So you say you want to add one point for DNF/OCS/DSQ and 2 points for any finishing position so are you using a high point scoring system?

I can’t think of a way of tie breaking with the boat with most races wins.

As for expressions there is some documentation at http://www.sailwave.com/expression

As for these:-

eq = equals

ne = not equal

gt = Greater than

lt = Less than

gte = Greater than or equal to

lte = Less than or equal to

These have two parameters e.g.
eq(a,b) if a = b

gte(a,b) if a >= b

If the expression is true it returns 1 otherwise it returns 0

Jon

···

Jon Eskdale
07530 112233

Skype “eskdale”

On 12 February 2016 at 22:09, jmaja100@yahoo.com [sailwave] sailwave@yahoogroups.com wrote:

Hi,

I’m trying to use Sailwave for calculating a series including a large number of races (40 or so) during the season for 200+ boats. The SI for the series says that only the six best races are included, but you get activity points from the discarded races. Thus I set discard as “s-6” to get only the six best scores. How do I add one (DNF/OCS/DSQ) or two (any finished postion) activity point for each discarded race to the Nett points?

Also there’s a special rule for series ties. The boat with more races wins a tie. How to do that?

I needed to make a special formula for the point system and I got some help that releaved you can use conditional statements like lte(), gte() etc. I didn’t find any documentation about those. Is it available somewhere?

Best Regards,

Joakim

Yes, it’s a high point system. I was able to make this formula for individual races. It seems to work for the point table in th SI.
2 + lte(p,10)*(lt(s,11)*s+gte(s,11)*10-p+1) + lt(p,2)*0.5

And for individual races I set up DNF/DSQ/OCS etc. for one point and DNS/DNC for zero.

But I didn’t find a way to give the activity points for the discarded races.

I got an idea how to break the ties with most races. If I give say 0.001 points extra for each race, then a boat with three races would have 7.003 and a boat with one 7.001. But then I need to round the points to three decimals. Is it possible to publish the results with just one decimal, but still keep the order taking three decimals into account? Or maybe we can just say that, the last two decimals are the number of races the boat did. But that also requires getting the extra 0.001 for discarded races as well.

Best Regards,
Joakim

Yes, it’s a high point system and yes I want to add to Nett points from discards. I already did the following scoring formula for individual races. It seems to work as the table in the SI (the winner gets 3.5-12.5 points, the last.3 or 2 points depending on the number of boats).

2 + lte(p,10)*(lt(s,11)*s+gte(s,11)*10-p+1) + lt(p,2)*0.5

I also made DNF/OCS/DSQ etc. as one point and DNS/DNC as zero point.

But I haven’t been able to add the the discarded races as 1 or 2 points to Nett.

I got an idea how to solve the series ties according to the SI. Add 0.001 points to each race score (and also to the discarded ones), thus a boat with 3 races would get 7.003 and one with two 7.002. You need to use 3 decimals to get the difference. Is it possible to publish the results with just one decimal and still get the order with three? Or maybe we can just say the last two decimals are the number of races sailed.

Best Regards,

Joakim

Hi Joakim,

So you say you want to add one point for DNF/OCS/DSQ and 2 points for any finishing position so are you using a high point scoring system?

I can’t think of a way of tie breaking with the boat with most races wins.

As for expressions there is some documentation at http://www.sailwave.com/expression

As for these:-

eq = equals

ne = not equal

gt = Greater than

lt = Less than

gte = Greater than or equal to

lte = Less than or equal to

These have two parameters e.g.
eq(a,b) if a = b

gte(a,b) if a >= b

If the expression is true it returns 1 otherwise it returns 0

Jon

Jon Eskdale
07530 112233

Skype “eskdale”

···

On Saturday, February 13, 2016 1:35 AM, “Jon Eskdale jon@sailwave.com [sailwave]” sailwave@yahoogroups.com wrote:

On 12 February 2016 at 22:09, jmaja100@yahoo.com [sailwave] sailwave@yahoogroups.com wrote:

Hi,

I’m trying to use Sailwave for calculating a series including a large number of races (40 or so) during the season for 200+ boats. The SI for the series says that only the six best races are included, but you get activity points from the discarded races. Thus I set discard as “s-6” to get only the six best scores. How do I add one (DNF/OCS/DSQ) or two (any finished postion) activity point for each discarded race to the Nett points?

Also there’s a special rule for series ties. The boat with more races wins a tie. How to do that?

I needed to make a special formula for the point system and I got some help that releaved you can use conditional statements like lte(), gte() etc. I didn’t find any documentation about those. Is it available somewhere?

Best Regards,

Joakim

I’m able to edit the blw file (by hand or with a script) and make the modifications needed to Nett points and Ranks, but that is quite inconvenient.Is it possible to get “inside” the scoring routine to make the changes happen already while pressing Rescore?

Best Regards,

Joakim

Yes, it’s a high point system and yes I want to add to Nett points from discards. I already did the following scoring formula for individual races. It seems to work as the table in the SI (the winner gets 3.5-12.5 points, the last.3 or 2 points depending on the number of boats).

2 + lte(p,10)*(lt(s,11)*s+gte(s,11)*10-p+1) + lt(p,2)*0.5

I also made DNF/OCS/DSQ etc. as one point and DNS/DNC as zero point.

But I haven’t been able to add the the discarded races as 1 or 2 points to Nett.

I got an idea how to solve the series ties according to the SI. Add 0.001 points to each race score (and also to the discarded ones), thus a boat with 3 races would get 7.003 and one with two 7.002. You need to use 3 decimals to get the difference. Is it possible to publish the results with just one decimal and still get the order with three? Or maybe we can just say the last two decimals are the number of races sailed.

Best Regards,

Joakim

Hi Joakim,

So you say you want to add one point for DNF/OCS/DSQ and 2 points for any finishing position so are you using a high point scoring system?

I can’t think of a way of tie breaking with the boat with most races wins.

As for expressions there is some documentation at http://www.sailwave.com/expression

As for these:-

eq = equals

ne = not equal

gt = Greater than

lt = Less than

gte = Greater than or equal to

lte = Less than or equal to

These have two parameters e.g.
eq(a,b) if a = b

gte(a,b) if a >= b

If the expression is true it returns 1 otherwise it returns 0

Jon

Jon Eskdale
07530 112233

Skype “eskdale”

···

On Saturday, February 13, 2016 5:19 PM, “jmaja100@yahoo.com [sailwave]” sailwave@yahoogroups.com wrote:
On Saturday, February 13, 2016 1:35 AM, “Jon Eskdale jon@sailwave.com [sailwave]” sailwave@yahoogroups.com wrote:

On 12 February 2016 at 22:09, jmaja100@yahoo.com [sailwave] sailwave@yahoogroups.com wrote:

Hi,

I’m trying to use Sailwave for calculating a series including a large number of races (40 or so) during the season for 200+ boats. The SI for the series says that only the six best races are included, but you get activity points from the discarded races. Thus I set discard as “s-6” to get only the six best scores. How do I add one (DNF/OCS/DSQ) or two (any finished postion) activity point for each discarded race to the Nett points?

Also there’s a special rule for series ties. The boat with more races wins a tie. How to do that?

I needed to make a special formula for the point system and I got some help that releaved you can use conditional statements like lte(), gte() etc. I didn’t find any documentation about those. Is it available somewhere?

Best Regards,

Joakim

Hi Joakim,

In the scoring system tab

Inline images 1

You can specify the number of decimal places.

If you want to display it differently you could have a Javascipt effect to modify it.

Jon

···

On 13 February 2016 at 07:55, jmaja100@yahoo.com [sailwave] sailwave@yahoogroups.com wrote:

Yes, it’s a high point system. I was able to make this formula for individual races. It seems to work for the point table in th SI.
2 + lte(p,10)*(lt(s,11)*s+gte(s ,11)*10-p+1) + lt(p,2)*0.5

And for individual races I set up DNF/DSQ/OCS etc. for one point and DNS/DNC for zero.

But I didn’t find a way to give the activity points for the discarded races.

I got an idea how to break the ties with most races. If I give say 0.001 points extra for each race, then a boat with three races would have 7.003 and a boat with one 7.001. But then I need to round the points to three decimals. Is it possible to publish the results with just one decimal, but still keep the order taking three decimals into account? Or maybe we can just say that, the last two decimals are the number of races the boat did. But that also requires getting the extra 0.001 for discarded races as well.

Best Regards,
Joakim

Jon Eskdale
07530 112233

Skype “eskdale”

Hi Joakim,

You don’t need to edit the blw by hand to modify the Nett Points or Rank you can do this within Sailwave just select the cell and press enter or F2 (or right click and edit). You can then manually change anything and these values will get published until the next time you score or rescore the series.

You can also manipulate them with the tools from the tools menu. Quite often its useful if you have a Gold and Silver fleet which you want the Silver fleet to have rankings greater than the Gold fleet. So you could use the tools to add a fixed amount to the rank of everyone in the Silver fleet.

Jon

···

On 15 February 2016 at 09:15, jmaja100@yahoo.com [sailwave] sailwave@yahoogroups.com wrote:

I’m able to edit the blw file (by hand or with a script) and make the modifications needed to Nett points and Ranks, but that is quite inconvenient.Is it possible to get “inside” the scoring routine to make the changes happen already while pressing Rescore?

Best Regards,

Joakim

On Saturday, February 13, 2016 5:19 PM, “jmaja100@yahoo.com [sailwave]” sailwave@yahoogroups.com wrote:

Yes, it’s a high point system and yes I want to add to Nett points from discards. I already did the following scoring formula for individual races. It seems to work as the table in the SI (the winner gets 3.5-12.5 points, the last.3 or 2 points depending on the number of boats).

2 + lte(p,10)*(lt(s,11)*s+gte(s,11)*10-p+1) + lt(p,2)*0.5

I also made DNF/OCS/DSQ etc. as one point and DNS/DNC as zero point.

But I haven’t been able to add the the discarded races as 1 or 2 points to Nett.

I got an idea how to solve the series ties according to the SI. Add 0.001 points to each race score (and also to the discarded ones), thus a boat with 3 races would get 7.003 and one with two 7.002. You need to use 3 decimals to get the difference. Is it possible to publish the results with just one decimal and still get the order with three? Or maybe we can just say the last two decimals are the number of races sailed.

Best Regards,

Joakim

On Saturday, February 13, 2016 1:35 AM, “Jon Eskdale jon@sailwave.com [sailwave]” sailwave@yahoogroups.com wrote:

Hi Joakim,

So you say you want to add one point for DNF/OCS/DSQ and 2 points for any finishing position so are you using a high point scoring system?

I can’t think of a way of tie breaking with the boat with most races wins.

As for expressions there is some documentation at http://www.sailwave.com/expression

As for these:-

eq = equals

ne = not equal

gt = Greater than

lt = Less than

gte = Greater than or equal to

lte = Less than or equal to

These have two parameters e.g.
eq(a,b) if a = b

gte(a,b) if a >= b

If the expression is true it returns 1 otherwise it returns 0

Jon

Jon Eskdale
07530 112233

Skype “eskdale”

On 12 February 2016 at 22:09, jmaja100@yahoo.com [sailwave] sailwave@yahoogroups.com wrote:

Hi,

I’m trying to use Sailwave for calculating a series including a large number of races (40 or so) during the season for 200+ boats. The SI for the series says that only the six best races are included, but you get activity points from the discarded races. Thus I set discard as “s-6” to get only the six best scores. How do I add one (DNF/OCS/DSQ) or two (any finished postion) activity point for each discarded race to the Nett points?

Also there’s a special rule for series ties. The boat with more races wins a tie. How to do that?

I needed to make a special formula for the point system and I got some help that releaved you can use conditional statements like lte(), gte() etc. I didn’t find any documentation about those. Is it available somewhere?

Best Regards,

Joakim

Jon Eskdale
07530 112233

Skype “eskdale”

Hi Jon,

I don’t want to do anything by hand, since there are 200 boats and 40 races and results are published after each race. And it would be nice to have the real results in Sailwave, not just in the published html.

How can you use tools to change the ranks and nett points? I looked at “set competitor field”, which allows to modify each field for each boat. But how is it used? Which variables are available? Can expressions be used?

The problem with these modifications is that you need to redo them after each rescore (when adding a race result to series). I really would like to automate that. I looked at some of the javascript files, but couldn’t find any manipulation of the Nett points or Ranks. I quess all that is done in the executables? And to do them for publishing you need to add an Effect?

Best Regards,

Joakim

Hi Joakim,

You don’t need to edit the blw by hand to modify the Nett Points or Rank you can do this within Sailwave just select the cell and press enter or F2 (or right click and edit). You can then manually change anything and these values will get published until the next time you score or rescore the series.

You can also manipulate them with the tools from the tools menu. Quite often its useful if you have a Gold and Silver fleet which you want the Silver fleet to have rankings greater than the Gold fleet. So you could use the tools to add a fixed amount to the rank of everyone in the Silver fleet.

Jon

Jon Eskdale
07530 112233

Skype “eskdale”

···

On Monday, February 15, 2016 1:32 PM, “Jon Eskdale jon@sailwave.com [sailwave]” sailwave@yahoogroups.com wrote:

On 15 February 2016 at 09:15, jmaja100@yahoo.com [sailwave] sailwave@yahoogroups.com wrote:

I’m able to edit the blw file (by hand or with a script) and make the modifications needed to Nett points and Ranks, but that is quite inconvenient.Is it possible to get “inside” the scoring routine to make the changes happen already while pressing Rescore?

Best Regards,

Joakim

On Saturday, February 13, 2016 5:19 PM, “jmaja100@yahoo.com [sailwave]” sailwave@yahoogroups.com wrote:

Yes, it’s a high point system and yes I want to add to Nett points from discards. I already did the following scoring formula for individual races. It seems to work as the table in the SI (the winner gets 3.5-12.5 points, the last.3 or 2 points depending on the number of boats).

2 + lte(p,10)*(lt(s,11)*s+gte(s,11)*10-p+1) + lt(p,2)*0.5

I also made DNF/OCS/DSQ etc. as one point and DNS/DNC as zero point.

But I haven’t been able to add the the discarded races as 1 or 2 points to Nett.

I got an idea how to solve the series ties according to the SI. Add 0.001 points to each race score (and also to the discarded ones), thus a boat with 3 races would get 7.003 and one with two 7.002. You need to use 3 decimals to get the difference. Is it possible to publish the results with just one decimal and still get the order with three? Or maybe we can just say the last two decimals are the number of races sailed.

Best Regards,

Joakim

On Saturday, February 13, 2016 1:35 AM, “Jon Eskdale jon@sailwave.com [sailwave]” sailwave@yahoogroups.com wrote:

Hi Joakim,

So you say you want to add one point for DNF/OCS/DSQ and 2 points for any finishing position so are you using a high point scoring system?

I can’t think of a way of tie breaking with the boat with most races wins.

As for expressions there is some documentation at http://www.sailwave.com/expression

As for these:-

eq = equals

ne = not equal

gt = Greater than

lt = Less than

gte = Greater than or equal to

lte = Less than or equal to

These have two parameters e.g.
eq(a,b) if a = b

gte(a,b) if a >= b

If the expression is true it returns 1 otherwise it returns 0

Jon

Jon Eskdale
07530 112233

Skype “eskdale”

On 12 February 2016 at 22:09, jmaja100@yahoo.com [sailwave] sailwave@yahoogroups.com wrote:

Hi,

I’m trying to use Sailwave for calculating a series including a large number of races (40 or so) during the season for 200+ boats. The SI for the series says that only the six best races are included, but you get activity points from the discarded races. Thus I set discard as “s-6” to get only the six best scores. How do I add one (DNF/OCS/DSQ) or two (any finished postion) activity point for each discarded race to the Nett points?

Also there’s a special rule for series ties. The boat with more races wins a tie. How to do that?

I needed to make a special formula for the point system and I got some help that releaved you can use conditional statements like lte(), gte() etc. I didn’t find any documentation about those. Is it available somewhere?

Best Regards,

Joakim

Hi Joakim,

It could be worthwhile you looking at the what the NHC option does in external mode with an Excel spreadsheet. The functionality added to Sailwave for the RYA NHC scheme is using Microsoft messaging API’s to pass data to an Excel spreadsheet and receive data back form the Excel spreadsheet after it has done its calculations.

The functionality can be customised by writing your own Excel spreadsheet, some have done this to implement their own progressive handicap system but I think you could make use of it to meet your requirements for scoring. I would suggest that you look at using either the ‘Carried forward points’ or ‘Penalties’ fields/columns [ don’t forget you can rename them to something like Participation ]
to store the points you want to allocate for participation. Values stored in these two columns are added to the Nett points calculated by Sailwave.

I am sure Jon would provide more information, but he first
thing to do is look at the NHC spreadsheet in the Sailwave directory to
see what it does.

Hope this helps

Kind regards,

Huw

I see Huw has just posted an answer on this while I’ve been deciding what to post.

Huw’s suggestion is along the correct lines although as it currently stands I don’t think it will do what you want as this runs and updates for every race. You would want it to run once at the end of the scoring. I did actually attempt to implement this in an earlier version but it broke the NHC code when scoring multiple fleets so I took it back out of the current version as no one was using it anyway. The principle is good as it would allow you to automate what you want.

The Set and seed tools do not allow expressions

As for the effects - although none of the demo ones modify the rank or nett points, there is no reason why a javascript effect could not modify them.

Jon

···

On 15 February 2016 at 12:28, jmaja100@yahoo.com [sailwave] sailwave@yahoogroups.com wrote:

Hi Jon,

I don’t want to do anything by hand, since there are 200 boats and 40 races and results are published after each race. And it would be nice to have the real results in Sailwave, not just in the published html.

How can you use tools to change the ranks and nett points? I looked at “set competitor field”, which allows to modify each field for each boat. But how is it used? Which variables are available? Can expressions be used?

The problem with these modifications is that you need to redo them after each rescore (when adding a race result to series). I really would like to automate that. I looked at some of the javascript files, but couldn’t find any manipulation of the Nett points or Ranks. I quess all that is done in the executables? And to do them for publishing you need to add an Effect?

Best Regards,

Joakim

On Monday, February 15, 2016 1:32 PM, “Jon Eskdale jon@sailwave.com [sailwave]” sailwave@yahoogroups.com wrote:

Hi Joakim,

You don’t need to edit the blw by hand to modify the Nett Points or Rank you can do this within Sailwave just select the cell and press enter or F2 (or right click and edit). You can then manually change anything and these values will get published until the next time you score or rescore the series.

You can also manipulate them with the tools from the tools menu. Quite often its useful if you have a Gold and Silver fleet which you want the Silver fleet to have rankings greater than the Gold fleet. So you could use the tools to add a fixed amount to the rank of everyone in the Silver fleet.

Jon

Jon Eskdale
07530 112233

Skype “eskdale”

On 15 February 2016 at 09:15, jmaja100@yahoo.com [sailwave] sailwave@yahoogroups.com wrote:

I’m able to edit the blw file (by hand or with a script) and make the modifications needed to Nett points and Ranks, but that is quite inconvenient.Is it possible to get “inside” the scoring routine to make the changes happen already while pressing Rescore?

Best Regards,

Joakim

On Saturday, February 13, 2016 5:19 PM, “jmaja100@yahoo.com [sailwave]” sailwave@yahoogroups.com wrote:

Yes, it’s a high point system and yes I want to add to Nett points from discards. I already did the following scoring formula for individual races. It seems to work as the table in the SI (the winner gets 3.5-12.5 points, the last.3 or 2 points depending on the number of boats).

2 + lte(p,10)*(lt(s,11)*s+gte(s,11)*10-p+1) + lt(p,2)*0.5

I also made DNF/OCS/DSQ etc. as one point and DNS/DNC as zero point.

But I haven’t been able to add the the discarded races as 1 or 2 points to Nett.

I got an idea how to solve the series ties according to the SI. Add 0.001 points to each race score (and also to the discarded ones), thus a boat with 3 races would get 7.003 and one with two 7.002. You need to use 3 decimals to get the difference. Is it possible to publish the results with just one decimal and still get the order with three? Or maybe we can just say the last two decimals are the number of races sailed.

Best Regards,

Joakim

On Saturday, February 13, 2016 1:35 AM, “Jon Eskdale jon@sailwave.com [sailwave]” sailwave@yahoogroups.com wrote:

Hi Joakim,

So you say you want to add one point for DNF/OCS/DSQ and 2 points for any finishing position so are you using a high point scoring system?

I can’t think of a way of tie breaking with the boat with most races wins.

As for expressions there is some documentation at http://www.sailwave.com/expression

As for these:-

eq = equals

ne = not equal

gt = Greater than

lt = Less than

gte = Greater than or equal to

lte = Less than or equal to

These have two parameters e.g.
eq(a,b) if a = b

gte(a,b) if a >= b

If the expression is true it returns 1 otherwise it returns 0

Jon

Jon Eskdale
07530 112233

Skype “eskdale”

On 12 February 2016 at 22:09, jmaja100@yahoo.com [sailwave] sailwave@yahoogroups.com wrote:

Hi,

I’m trying to use Sailwave for calculating a series including a large number of races (40 or so) during the season for 200+ boats. The SI for the series says that only the six best races are included, but you get activity points from the discarded races. Thus I set discard as “s-6” to get only the six best scores. How do I add one (DNF/OCS/DSQ) or two (any finished postion) activity point for each discarded race to the Nett points?

Also there’s a special rule for series ties. The boat with more races wins a tie. How to do that?

I needed to make a special formula for the point system and I got some help that releaved you can use conditional statements like lte(), gte() etc. I didn’t find any documentation about those. Is it available somewhere?

Best Regards,

Joakim

Jon Eskdale
07530 112233

Skype “eskdale”

Hi Jon,

I’m trying to make the effect to modify the published output, but I have really hard time to get started. I have no idea how to get and set the variables needed. I have tried to follow what the expample scripts do, but I had no success.

I haven’t done any java/CSS/XML before, but I do have a lot of experience in writing C, shell scripts and awk scripts. I could easily write an awk script to modify the blw file as I wanted, but I don’t think that’s a good way of handling this, since I’m making a tool for someone else and he wouldn’t be able to use it like that.

Could you give me an example to get me started? Maybe just a script that adds 1 to each nett point.

Best Regards,

Joakim

I see Huw has just posted an answer on this while I’ve been deciding what to post.

Huw’s suggestion is along the correct lines although as it currently stands I don’t think it will do what you want as this runs and updates for every race. You would want it to run once at the end of the scoring. I did actually attempt to implement this in an earlier version but it broke the NHC code when scoring multiple fleets so I took it back out of the current version as no one was using it anyway. The principle is good as it would allow you to automate what you want.

The Set and seed tools do not allow expressions

As for the effects - although none of the demo ones modify the rank or nett points, there is no reason why a javascript effect could not modify them.

Jon

Jon Eskdale
07530 112233

Skype “eskdale”

···

On Monday, February 15, 2016 3:18 PM, “Jon Eskdale jon@sailwave.com [sailwave]” sailwave@yahoogroups.com wrote:

On 15 February 2016 at 12:28, jmaja100@yahoo.com [sailwave] sailwave@yahoogroups.com wrote:

Hi Jon,

I don’t want to do anything by hand, since there are 200 boats and 40 races and results are published after each race. And it would be nice to have the real results in Sailwave, not just in the published html.

How can you use tools to change the ranks and nett points? I looked at “set competitor field”, which allows to modify each field for each boat. But how is it used? Which variables are available? Can expressions be used?

The problem with these modifications is that you need to redo them after each rescore (when adding a race result to series). I really would like to automate that. I looked at some of the javascript files, but couldn’t find any manipulation of the Nett points or Ranks. I quess all that is done in the executables? And to do them for publishing you need to add an Effect?

Best Regards,

Joakim

On Monday, February 15, 2016 1:32 PM, “Jon Eskdale jon@sailwave.com [sailwave]” sailwave@yahoogroups.com wrote:

Hi Joakim,

You don’t need to edit the blw by hand to modify the Nett Points or Rank you can do this within Sailwave just select the cell and press enter or F2 (or right click and edit). You can then manually change anything and these values will get published until the next time you score or rescore the series.

You can also manipulate them with the tools from the tools menu. Quite often its useful if you have a Gold and Silver fleet which you want the Silver fleet to have rankings greater than the Gold fleet. So you could use the tools to add a fixed amount to the rank of everyone in the Silver fleet.

Jon

Jon Eskdale
07530 112233

Skype “eskdale”

On 15 February 2016 at 09:15, jmaja100@yahoo.com [sailwave] sailwave@yahoogroups.com wrote:

I’m able to edit the blw file (by hand or with a script) and make the modifications needed to Nett points and Ranks, but that is quite inconvenient.Is it possible to get “inside” the scoring routine to make the changes happen already while pressing Rescore?

Best Regards,

Joakim

On Saturday, February 13, 2016 5:19 PM, “jmaja100@yahoo.com [sailwave]” sailwave@yahoogroups.com wrote:

Yes, it’s a high point system and yes I want to add to Nett points from discards. I already did the following scoring formula for individual races. It seems to work as the table in the SI (the winner gets 3.5-12.5 points, the last.3 or 2 points depending on the number of boats).

2 + lte(p,10)*(lt(s,11)*s+gte(s,11)*10-p+1) + lt(p,2)*0.5

I also made DNF/OCS/DSQ etc. as one point and DNS/DNC as zero point.

But I haven’t been able to add the the discarded races as 1 or 2 points to Nett.

I got an idea how to solve the series ties according to the SI. Add 0.001 points to each race score (and also to the discarded ones), thus a boat with 3 races would get 7.003 and one with two 7.002. You need to use 3 decimals to get the difference. Is it possible to publish the results with just one decimal and still get the order with three? Or maybe we can just say the last two decimals are the number of races sailed.

Best Regards,

Joakim

On Saturday, February 13, 2016 1:35 AM, “Jon Eskdale jon@sailwave.com [sailwave]” sailwave@yahoogroups.com wrote:

Hi Joakim,

So you say you want to add one point for DNF/OCS/DSQ and 2 points for any finishing position so are you using a high point scoring system?

I can’t think of a way of tie breaking with the boat with most races wins.

As for expressions there is some documentation at http://www.sailwave.com/expression

As for these:-

eq = equals

ne = not equal

gt = Greater than

lt = Less than

gte = Greater than or equal to

lte = Less than or equal to

These have two parameters e.g.
eq(a,b) if a = b

gte(a,b) if a >= b

If the expression is true it returns 1 otherwise it returns 0

Jon

Jon Eskdale
07530 112233

Skype “eskdale”

On 12 February 2016 at 22:09, jmaja100@yahoo.com [sailwave] sailwave@yahoogroups.com wrote:

Hi,

I’m trying to use Sailwave for calculating a series including a large number of races (40 or so) during the season for 200+ boats. The SI for the series says that only the six best races are included, but you get activity points from the discarded races. Thus I set discard as “s-6” to get only the six best scores. How do I add one (DNF/OCS/DSQ) or two (any finished postion) activity point for each discarded race to the Nett points?

Also there’s a special rule for series ties. The boat with more races wins a tie. How to do that?

I needed to make a special formula for the point system and I got some help that releaved you can use conditional statements like lte(), gte() etc. I didn’t find any documentation about those. Is it available somewhere?

Best Regards,

Joakim

Hi Jon,

After digging java and html references most of the night I was able to make a script that modifies the nett points and reorders the ranks.

I still have one problem. I would like to score in two divisions (based on rating), but still get the points of individual races like all sailed in one division. Now the parameters s and p in the point formula change when scoring in two division vs. in one group. The races have different rating divisions, thus SI for the series gives points based on position and participants in each race’s each division, not based on division for the series.

I could dig up the number of partisipants and places from the individual race results in java, but that seems like a quite a lot of work.

So is there a way to do this part before the Effect is called? One way of doing it seems to be adding line ““scrfield”,“Division”,“104”,”"" to the blw after rescoring in one group and then open that and publish it without rescoring, but that seems quite error prone approach.

Below is the java I added to ScoredSeparatelyMatrix.js. It’s not pretty, but seems to get what I want and may help someone else.

Best Regards,

Joakim

var list = document.getElementsByClassName("summarytable");
var listl=list.length;
var sailed=[], races=[];
var N=0;
for(i=0;i<listl;i++)
{
var nett=-1;
var rowl=list[i].rows.length;
var celll=list[i].rows[0].cells.length;
var swap;
for(k=1;k<rowl;k++)
{
    var sum=0;
    var partip=0;
    for(j=0;j<celll;j++)
    {
    if(list[i].rows[0].cells[j].innerHTML.search("race")!=-1)
    {
        var str=list[i].rows[k].cells[j].innerHTML;
        if(str.search(" ")!=-1)
        str=str.slice(0,str.search(" "));
        if(str.search("[(]")!=-1) //Discarded
        {
        if(str.search("[)]")==-1)
            str=str.slice(str.search("[(]")+1);
        else
            str=str.slice(str.search("[(]")+1,str.search("[)]")-1);
        if(Number(str)>2.0)
            str="2.0";
        }
        if(Number(str)>=1.0)
        {
        var racename=list[i].rows[0].cells[j].innerHTML;
        racename=racename.slice(racename.search("[>]")+1);
        racename=racename.slice(0,racename.search("[<]"));
        for(n=0;n<N && races[n]!=racename;n++);
        if(n==N)
        {
            N++;
            races[n]=racename;
            sailed[n]=0;
        }
        partip++;
        sailed[n]++;
        }
        sum+=Number(str);
    }
    else
        if(list[i].rows[0].cells[j].innerHTML.search("Nett")!=-1)
        nett=j;

    }
    if(nett!=-1)
    {
    list[i].rows[k].cells[nett].innerHTML = (sum).toFixed(1);
    list[i].rows[k].cells[nett].partip = partip;
    list[i].rows[k].cells[2].innerHTML = list[i].rows[k].cells[nett].partip;
    for(k1=k;k1>1;k1--)
    {
        var n1=Number(list[i].rows[k1-1].cells[nett].innerHTML);
        var n2=Number(list[i].rows[k1].cells[nett].innerHTML);
        var p1=Number(list[i].rows[k1-1].cells[nett].partip);
        var p2=Number(list[i].rows[k1].cells[nett].partip);
        console.log(i,k,k1,n1,n2,p1,p2);
        if(n1<n2 || (n1==n2 && p1<p2))
        {
        console.log("swap");
        for(j=0;j<celll;j++)
        {
            if(list[i].rows[0].cells[j].innerHTML.search("Rank")==-1)
            {
            swap=list[i].rows[k1-1].cells[j].innerHTML;
            list[i].rows[k1-1].cells[j].innerHTML=list[i].rows[k1].cells[j].innerHTML;
            list[i].rows[k1].cells[j].innerHTML=swap;
            }
        }
        list[i].rows[k1].cells[nett].partip=p1;
        list[i].rows[k1-1].cells[nett].partip=p2;
        }
    }
    }
}
for(j=0;j<celll;j++)
    if(list[i].rows[0].cells[j].innerHTML.search("Rank")!=-1)
    for(k=1;k<rowl;k++)
        list[i].rows[k].cells[j].innerHTML=k;

}
for(n=0;n<N;n++)
console.log(races[n], n, sailed[n]);

Hi Jon,

I’m trying to make the effect to modify the published output, but I have really hard time to get started. I have no idea how to get and set the variables needed. I have tried to follow what the expample scripts do, but I had no success.

I haven’t done any java/CSS/XML before, but I do have a lot of experience in writing C, shell scripts and awk scripts. I could easily write an awk script to modify the blw file as I wanted, but I don’t think that’s a good way of handling this, since I’m making a tool for someone else and he wouldn’t be able to use it like that.

Could you give me an example to get me started? Maybe just a script that adds 1 to each nett point.

Best Regards,

Joakim

I see Huw has just posted an answer on this while I’ve been deciding what to post.

Huw’s suggestion is along the correct lines although as it currently stands I don’t think it will do what you want as this runs and updates for every race. You would want it to run once at the end of the scoring. I did actually attempt to implement this in an earlier version but it broke the NHC code when scoring multiple fleets so I took it back out of the current version as no one was using it anyway. The principle is good as it would allow you to automate what you want.

The Set and seed tools do not allow expressions

As for the effects - although none of the demo ones modify the rank or nett points, there is no reason why a javascript effect could not modify them.

Jon

Jon Eskdale
07530 112233

Skype “eskdale”

···

On Monday, February 15, 2016 8:11 PM, “jmaja100@yahoo.com [sailwave]” sailwave@yahoogroups.com wrote:
On Monday, February 15, 2016 3:18 PM, “Jon Eskdale jon@sailwave.com [sailwave]” sailwave@yahoogroups.com wrote:

On 15 February 2016 at 12:28, jmaja100@yahoo.com [sailwave] sailwave@yahoogroups.com wrote:

Hi Jon,

I don’t want to do anything by hand, since there are 200 boats and 40 races and results are published after each race. And it would be nice to have the real results in Sailwave, not just in the published html.

How can you use tools to change the ranks and nett points? I looked at “set competitor field”, which allows to modify each field for each boat. But how is it used? Which variables are available? Can expressions be used?

The problem with these modifications is that you need to redo them after each rescore (when adding a race result to series). I really would like to automate that. I looked at some of the javascript files, but couldn’t find any manipulation of the Nett points or Ranks. I quess all that is done in the executables? And to do them for publishing you need to add an Effect?

Best Regards,

Joakim

On Monday, February 15, 2016 1:32 PM, “Jon Eskdale jon@sailwave.com [sailwave]” sailwave@yahoogroups.com wrote:

Hi Joakim,

You don’t need to edit the blw by hand to modify the Nett Points or Rank you can do this within Sailwave just select the cell and press enter or F2 (or right click and edit). You can then manually change anything and these values will get published until the next time you score or rescore the series.

You can also manipulate them with the tools from the tools menu. Quite often its useful if you have a Gold and Silver fleet which you want the Silver fleet to have rankings greater than the Gold fleet. So you could use the tools to add a fixed amount to the rank of everyone in the Silver fleet.

Jon

Jon Eskdale
07530 112233

Skype “eskdale”

On 15 February 2016 at 09:15, jmaja100@yahoo.com [sailwave] sailwave@yahoogroups.com wrote:

I’m able to edit the blw file (by hand or with a script) and make the modifications needed to Nett points and Ranks, but that is quite inconvenient.Is it possible to get “inside” the scoring routine to make the changes happen already while pressing Rescore?

Best Regards,

Joakim

On Saturday, February 13, 2016 5:19 PM, “jmaja100@yahoo.com [sailwave]” sailwave@yahoogroups.com wrote:

Yes, it’s a high point system and yes I want to add to Nett points from discards. I already did the following scoring formula for individual races. It seems to work as the table in the SI (the winner gets 3.5-12.5 points, the last.3 or 2 points depending on the number of boats).

2 + lte(p,10)*(lt(s,11)*s+gte(s,11)*10-p+1) + lt(p,2)*0.5

I also made DNF/OCS/DSQ etc. as one point and DNS/DNC as zero point.

But I haven’t been able to add the the discarded races as 1 or 2 points to Nett.

I got an idea how to solve the series ties according to the SI. Add 0.001 points to each race score (and also to the discarded ones), thus a boat with 3 races would get 7.003 and one with two 7.002. You need to use 3 decimals to get the difference. Is it possible to publish the results with just one decimal and still get the order with three? Or maybe we can just say the last two decimals are the number of races sailed.

Best Regards,

Joakim

On Saturday, February 13, 2016 1:35 AM, “Jon Eskdale jon@sailwave.com [sailwave]” sailwave@yahoogroups.com wrote:

Hi Joakim,

So you say you want to add one point for DNF/OCS/DSQ and 2 points for any finishing position so are you using a high point scoring system?

I can’t think of a way of tie breaking with the boat with most races wins.

As for expressions there is some documentation at http://www.sailwave.com/expression

As for these:-

eq = equals

ne = not equal

gt = Greater than

lt = Less than

gte = Greater than or equal to

lte = Less than or equal to

These have two parameters e.g.
eq(a,b) if a = b

gte(a,b) if a >= b

If the expression is true it returns 1 otherwise it returns 0

Jon

Jon Eskdale
07530 112233

Skype “eskdale”

On 12 February 2016 at 22:09, jmaja100@yahoo.com [sailwave] sailwave@yahoogroups.com wrote:

Hi,

I’m trying to use Sailwave for calculating a series including a large number of races (40 or so) during the season for 200+ boats. The SI for the series says that only the six best races are included, but you get activity points from the discarded races. Thus I set discard as “s-6” to get only the six best scores. How do I add one (DNF/OCS/DSQ) or two (any finished postion) activity point for each discarded race to the Nett points?

Also there’s a special rule for series ties. The boat with more races wins a tie. How to do that?

I needed to make a special formula for the point system and I got some help that releaved you can use conditional statements like lte(), gte() etc. I didn’t find any documentation about those. Is it available somewhere?

Best Regards,

Joakim

Hi Joakim - Sorry for the late response I’ve been away a couple of days.

You seem to have made some good progress. If you want access to the low levels of control within Sailwave. You can use the messaging API which uses the Windows Data messages to control Sailwave. So any language that can send and receive Windows messages can communicate with Sailwave.

If you have played with the NHC scoring this is actually an external program which is using the messaging to communicate with Sailwave As is the interface to ISAF which uses this messaging to communicate and then submits results to ISAF. Basically with this messaging you can read and write most things within Sailwave. So you can modify the results before they are published.

If you want to take this further drop me an email.

Thanks for sharing your JavaScript

Jon

···

Jon Eskdale
07530 112233

Skype “eskdale”

On 16 February 2016 at 10:23, jmaja100@yahoo.com [sailwave] sailwave@yahoogroups.com wrote:

Hi Jon,

After digging java and html references most of the night I was able to make a script that modifies the nett points and reorders the ranks.

I still have one problem. I would like to score in two divisions (based on rating), but still get the points of individual races like all sailed in one division. Now the parameters s and p in the point formula change when scoring in two division vs. in one group. The races have different rating divisions, thus SI for the series gives points based on position and participants in each race’s each division, not based on division for the series.

I could dig up the number of partisipants and places from the individual race results in java, but that seems like a quite a lot of work.

So is there a way to do this part before the Effect is called? One way of doing it seems to be adding line ““scrfield”,“Division”,“104”,”"" to the blw after rescoring in one group and then open that and publish it without rescoring, but that seems quite error prone approach.

Below is the java I added to ScoredSeparatelyMatrix.js. It’s not pretty, but seems to get what I want and may help someone else.

Best Regards,

Joakim

var list = document.getElementsByClassName("summarytable");
var listl=list.length;
var sailed=[], races=[];
var N=0;
for(i=0;i<listl;i++)
{
var nett=-1;
var rowl=list[i].rows.length;
var celll=list[i].rows[0].cells.length;
var swap;
for(k=1;k<rowl;k++)
{
    var sum=0;
    var partip=0;
    for(j=0;j<celll;j++)
    {
    if(list[i].rows[0].cells[j].innerHTML.search("race")!=-1)
    {
        var str=list[i].rows[k].cells[j].innerHTML;
        if(str.search(" ")!=-1)
        str=str.slice(0,str.search(" "));
        if(str.search("[(]")!=-1) //Discarded
        {
        if(str.search("[)]")==-1)
            str=str.slice(str.search("[(]")+1);
        else
            str=str.slice(str.search("[(]")+1,str.search("[)]")-1);
        if(Number(str)>2.0)
            str="2.0";
        }
        if(Number(str)>=1.0)
        {
        var racename=list[i].rows[0].cells[j].innerHTML;
        racename=racename.slice(racename.search("[>]")+1);
        racename=racename.slice(0,racename.search("[<]"));
        for(n=0;n<N && races[n]!=racename;n++);
        if(n==N)
        {
            N++;
            races[n]=racename;
            sailed[n]=0;
        }
        partip++;
        sailed[n]++;
        }
        sum+=Number(str);
    }
    else
        if(list[i].rows[0].cells[j].innerHTML.search("Nett")!=-1)
        nett=j;

    }
    if(nett!=-1)
    {
    list[i].rows[k].cells[nett].innerHTML = (sum).toFixed(1);
    list[i].rows[k].cells[nett].partip = partip;
    list[i].rows[k].cells[2].innerHTML = list[i].rows[k].cells[nett].partip;
    for(k1=k;k1>1;k1--)
    {
        var n1=Number(list[i].rows[k1-1].cells[nett].innerHTML);
        var n2=Number(list[i].rows[k1].cells[nett].innerHTML);
        var p1=Number(list[i].rows[k1-1].cells[nett].partip);
        var p2=Number(list[i].rows[k1].cells[nett].partip);
        console.log(i,k,k1,n1,n2,p1,p2);
        if(n1<n2 || (n1==n2 && p1<p2))
        {
        console.log("swap");
        for(j=0;j<celll;j++)
        {
            if(list[i].rows[0].cells[j].innerHTML.search("Rank")==-1)
            {
            swap=list[i].rows[k1-1].cells[j].innerHTML;
            list[i].rows[k1-1].cells[j].innerHTML=list[i].rows[k1].cells[j].innerHTML;
            list[i].rows[k1].cells[j].innerHTML=swap;
            }
        }
        list[i].rows[k1].cells[nett].partip=p1;
        list[i].rows[k1-1].cells[nett].partip=p2;
        }
    }
    }
}
for(j=0;j<celll;j++)
    if(list[i].rows[0].cells[j].innerHTML.search("Rank")!=-1)
    for(k=1;k<rowl;k++)
        list[i].rows[k].cells[j].innerHTML=k;

}
for(n=0;n<N;n++)
console.log(races[n], n, sailed[n]);

On Monday, February 15, 2016 8:11 PM, “jmaja100@yahoo.com [sailwave]” sailwave@yahoogroups.com wrote:

Hi Jon,

I’m trying to make the effect to modify the published output, but I have really hard time to get started. I have no idea how to get and set the variables needed. I have tried to follow what the expample scripts do, but I had no success.

I haven’t done any java/CSS/XML before, but I do have a lot of experience in writing C, shell scripts and awk scripts. I could easily write an awk script to modify the blw file as I wanted, but I don’t think that’s a good way of handling this, since I’m making a tool for someone else and he wouldn’t be able to use it like that.

Could you give me an example to get me started? Maybe just a script that adds 1 to each nett point.

Best Regards,

Joakim

On Monday, February 15, 2016 3:18 PM, “Jon Eskdale jon@sailwave.com [sailwave]” sailwave@yahoogroups.com wrote:

I see Huw has just posted an answer on this while I’ve been deciding what to post.

Huw’s suggestion is along the correct lines although as it currently stands I don’t think it will do what you want as this runs and updates for every race. You would want it to run once at the end of the scoring. I did actually attempt to implement this in an earlier version but it broke the NHC code when scoring multiple fleets so I took it back out of the current version as no one was using it anyway. The principle is good as it would allow you to automate what you want.

The Set and seed tools do not allow expressions

As for the effects - although none of the demo ones modify the rank or nett points, there is no reason why a javascript effect could not modify them.

Jon

Jon Eskdale
07530 112233

Skype “eskdale”

On 15 February 2016 at 12:28, jmaja100@yahoo.com [sailwave] sailwave@yahoogroups.com wrote:

Hi Jon,

I don’t want to do anything by hand, since there are 200 boats and 40 races and results are published after each race. And it would be nice to have the real results in Sailwave, not just in the published html.

How can you use tools to change the ranks and nett points? I looked at “set competitor field”, which allows to modify each field for each boat. But how is it used? Which variables are available? Can expressions be used?

The problem with these modifications is that you need to redo them after each rescore (when adding a race result to series). I really would like to automate that. I looked at some of the javascript files, but couldn’t find any manipulation of the Nett points or Ranks. I quess all that is done in the executables? And to do them for publishing you need to add an Effect?

Best Regards,

Joakim

On Monday, February 15, 2016 1:32 PM, “Jon Eskdale jon@sailwave.com [sailwave]” sailwave@yahoogroups.com wrote:

Hi Joakim,

You don’t need to edit the blw by hand to modify the Nett Points or Rank you can do this within Sailwave just select the cell and press enter or F2 (or right click and edit). You can then manually change anything and these values will get published until the next time you score or rescore the series.

You can also manipulate them with the tools from the tools menu. Quite often its useful if you have a Gold and Silver fleet which you want the Silver fleet to have rankings greater than the Gold fleet. So you could use the tools to add a fixed amount to the rank of everyone in the Silver fleet.

Jon

Jon Eskdale
07530 112233

Skype “eskdale”

On 15 February 2016 at 09:15, jmaja100@yahoo.com [sailwave] sailwave@yahoogroups.com wrote:

I’m able to edit the blw file (by hand or with a script) and make the modifications needed to Nett points and Ranks, but that is quite inconvenient.Is it possible to get “inside” the scoring routine to make the changes happen already while pressing Rescore?

Best Regards,

Joakim

On Saturday, February 13, 2016 5:19 PM, “jmaja100@yahoo.com [sailwave]” sailwave@yahoogroups.com wrote:

Yes, it’s a high point system and yes I want to add to Nett points from discards. I already did the following scoring formula for individual races. It seems to work as the table in the SI (the winner gets 3.5-12.5 points, the last.3 or 2 points depending on the number of boats).

2 + lte(p,10)*(lt(s,11)*s+gte(s,11)*10-p+1) + lt(p,2)*0.5

I also made DNF/OCS/DSQ etc. as one point and DNS/DNC as zero point.

But I haven’t been able to add the the discarded races as 1 or 2 points to Nett.

I got an idea how to solve the series ties according to the SI. Add 0.001 points to each race score (and also to the discarded ones), thus a boat with 3 races would get 7.003 and one with two 7.002. You need to use 3 decimals to get the difference. Is it possible to publish the results with just one decimal and still get the order with three? Or maybe we can just say the last two decimals are the number of races sailed.

Best Regards,

Joakim

On Saturday, February 13, 2016 1:35 AM, “Jon Eskdale jon@sailwave.com [sailwave]” sailwave@yahoogroups.com wrote:

Hi Joakim,

So you say you want to add one point for DNF/OCS/DSQ and 2 points for any finishing position so are you using a high point scoring system?

I can’t think of a way of tie breaking with the boat with most races wins.

As for expressions there is some documentation at http://www.sailwave.com/expression

As for these:-

eq = equals

ne = not equal

gt = Greater than

lt = Less than

gte = Greater than or equal to

lte = Less than or equal to

These have two parameters e.g.
eq(a,b) if a = b

gte(a,b) if a >= b

If the expression is true it returns 1 otherwise it returns 0

Jon

Jon Eskdale
07530 112233

Skype “eskdale”

On 12 February 2016 at 22:09, jmaja100@yahoo.com [sailwave] sailwave@yahoogroups.com wrote:

Hi,

I’m trying to use Sailwave for calculating a series including a large number of races (40 or so) during the season for 200+ boats. The SI for the series says that only the six best races are included, but you get activity points from the discarded races. Thus I set discard as “s-6” to get only the six best scores. How do I add one (DNF/OCS/DSQ) or two (any finished postion) activity point for each discarded race to the Nett points?

Also there’s a special rule for series ties. The boat with more races wins a tie. How to do that?

I needed to make a special formula for the point system and I got some help that releaved you can use conditional statements like lte(), gte() etc. I didn’t find any documentation about those. Is it available somewhere?

Best Regards,

Joakim

Hi Jon,

I managed to recalculate everything in the effect javascript. It became quite long, more than 300 lines. Certainly it could be made more compact. It seems to do everything I was looking for, but haven’t yet tested it ith real races.

One problem I just noticed is that, if someone has javascripts disabled (like me using NoScript), he will see the results before modifications, thus wrong results. I guess that can be avoided by testing the javascript on the web site before allowing the page to be opened.

I think we try to live with this and not use the API approach.

Best Regards,

Joakim

Hi Joakim - Sorry for the late response I’ve been away a couple of days.

You seem to have made some good progress. If you want access to the low levels of control within Sailwave. You can use the messaging API which uses the Windows Data messages to control Sailwave. So any language that can send and receive Windows messages can communicate with Sailwave.

If you have played with the NHC scoring this is actually an external program which is using the messaging to communicate with Sailwave As is the interface to ISAF which uses this messaging to communicate and then submits results to ISAF. Basically with this messaging you can read and write most things within Sailwave. So you can modify the results before they are published.

If you want to take this further drop me an email.

Thanks for sharing your JavaScript

Jon

Jon Eskdale
07530 112233

Skype “eskdale”

···

On Tuesday, February 16, 2016 10:30 PM, “Jon Eskdale jon@sailwave.com [sailwave]” sailwave@yahoogroups.com wrote:

On 16 February 2016 at 10:23, jmaja100@yahoo.com [sailwave] sailwave@yahoogroups.com wrote:

Hi Jon,

After digging java and html references most of the night I was able to make a script that modifies the nett points and reorders the ranks.

I still have one problem. I would like to score in two divisions (based on rating), but still get the points of individual races like all sailed in one division. Now the parameters s and p in the point formula change when scoring in two division vs. in one group. The races have different rating divisions, thus SI for the series gives points based on position and participants in each race’s each division, not based on division for the series.

I could dig up the number of partisipants and places from the individual race results in java, but that seems like a quite a lot of work.

So is there a way to do this part before the Effect is called? One way of doing it seems to be adding line ““scrfield”,“Division”,“104”,”"" to the blw after rescoring in one group and then open that and publish it without rescoring, but that seems quite error prone approach.

Below is the java I added to ScoredSeparatelyMatrix.js. It’s not pretty, but seems to get what I want and may help someone else.

Best Regards,

Joakim

var list = document.getElementsByClassName("summarytable");
var listl=list.length;
var sailed=[], races=[];
var N=0;
for(i=0;i<listl;i++)
{
var nett=-1;
var rowl=list[i].rows.length;
var celll=list[i].rows[0].cells.length;
var swap;
for(k=1;k<rowl;k++)
{
    var sum=0;
    var partip=0;
    for(j=0;j<celll;j++)
    {
    if(list[i].rows[0].cells[j].innerHTML.search("race")!=-1)
    {
        var str=list[i].rows[k].cells[j].innerHTML;
        if(str.search(" ")!=-1)
        str=str.slice(0,str.search(" "));
        if(str.search("[(]")!=-1) //Discarded
        {
        if(str.search("[)]")==-1)
            str=str.slice(str.search("[(]")+1);
        else
            str=str.slice(str.search("[(]")+1,str.search("[)]")-1);
        if(Number(str)>2.0)
            str="2.0";
        }
        if(Number(str)>=1.0)
        {
        var racename=list[i].rows[0].cells[j].innerHTML;
        racename=racename.slice(racename.search("[>]")+1);
        racename=racename.slice(0,racename.search("[<]"));
        for(n=0;n<N && races[n]!=racename;n++);
        if(n==N)
        {
            N++;
            races[n]=racename;
            sailed[n]=0;
        }
        partip++;
        sailed[n]++;
        }
        sum+=Number(str);
    }
    else
        if(list[i].rows[0].cells[j].innerHTML.search("Nett")!=-1)
        nett=j;

    }
    if(nett!=-1)
    {
    list[i].rows[k].cells[nett].innerHTML = (sum).toFixed(1);
    list[i].rows[k].cells[nett].partip = partip;
    list[i].rows[k].cells[2].innerHTML = list[i].rows[k].cells[nett].partip;
    for(k1=k;k1>1;k1--)
    {
        var n1=Number(list[i].rows[k1-1].cells[nett].innerHTML);
        var n2=Number(list[i].rows[k1].cells[nett].innerHTML);
        var p1=Number(list[i].rows[k1-1].cells[nett].partip);
        var p2=Number(list[i].rows[k1].cells[nett].partip);
        console.log(i,k,k1,n1,n2,p1,p2);
        if(n1<n2 || (n1==n2 && p1<p2))
        {
        console.log("swap");
        for(j=0;j<celll;j++)
        {
            if(list[i].rows[0].cells[j].innerHTML.search("Rank")==-1)
            {
            swap=list[i].rows[k1-1].cells[j].innerHTML;
            list[i].rows[k1-1].cells[j].innerHTML=list[i].rows[k1].cells[j].innerHTML;
            list[i].rows[k1].cells[j].innerHTML=swap;
            }
        }
        list[i].rows[k1].cells[nett].partip=p1;
        list[i].rows[k1-1].cells[nett].partip=p2;
        }
    }
    }
}
for(j=0;j<celll;j++)
    if(list[i].rows[0].cells[j].innerHTML.search("Rank")!=-1)
    for(k=1;k<rowl;k++)
        list[i].rows[k].cells[j].innerHTML=k;

}
for(n=0;n<N;n++)
console.log(races[n], n, sailed[n]);

On Monday, February 15, 2016 8:11 PM, “jmaja100@yahoo.com [sailwave]” sailwave@yahoogroups.com wrote:

Hi Jon,

I’m trying to make the effect to modify the published output, but I have really hard time to get started. I have no idea how to get and set the variables needed. I have tried to follow what the expample scripts do, but I had no success.

I haven’t done any java/CSS/XML before, but I do have a lot of experience in writing C, shell scripts and awk scripts. I could easily write an awk script to modify the blw file as I wanted, but I don’t think that’s a good way of handling this, since I’m making a tool for someone else and he wouldn’t be able to use it like that.

Could you give me an example to get me started? Maybe just a script that adds 1 to each nett point.

Best Regards,

Joakim

On Monday, February 15, 2016 3:18 PM, “Jon Eskdale jon@sailwave.com [sailwave]” sailwave@yahoogroups.com wrote:

I see Huw has just posted an answer on this while I’ve been deciding what to post.

Huw’s suggestion is along the correct lines although as it currently stands I don’t think it will do what you want as this runs and updates for every race. You would want it to run once at the end of the scoring. I did actually attempt to implement this in an earlier version but it broke the NHC code when scoring multiple fleets so I took it back out of the current version as no one was using it anyway. The principle is good as it would allow you to automate what you want.

The Set and seed tools do not allow expressions

As for the effects - although none of the demo ones modify the rank or nett points, there is no reason why a javascript effect could not modify them.

Jon

Jon Eskdale
07530 112233

Skype “eskdale”

On 15 February 2016 at 12:28, jmaja100@yahoo.com [sailwave] sailwave@yahoogroups.com wrote:

Hi Jon,

I don’t want to do anything by hand, since there are 200 boats and 40 races and results are published after each race. And it would be nice to have the real results in Sailwave, not just in the published html.

How can you use tools to change the ranks and nett points? I looked at “set competitor field”, which allows to modify each field for each boat. But how is it used? Which variables are available? Can expressions be used?

The problem with these modifications is that you need to redo them after each rescore (when adding a race result to series). I really would like to automate that. I looked at some of the javascript files, but couldn’t find any manipulation of the Nett points or Ranks. I quess all that is done in the executables? And to do them for publishing you need to add an Effect?

Best Regards,

Joakim

On Monday, February 15, 2016 1:32 PM, “Jon Eskdale jon@sailwave.com [sailwave]” sailwave@yahoogroups.com wrote:

Hi Joakim,

You don’t need to edit the blw by hand to modify the Nett Points or Rank you can do this within Sailwave just select the cell and press enter or F2 (or right click and edit). You can then manually change anything and these values will get published until the next time you score or rescore the series.

You can also manipulate them with the tools from the tools menu. Quite often its useful if you have a Gold and Silver fleet which you want the Silver fleet to have rankings greater than the Gold fleet. So you could use the tools to add a fixed amount to the rank of everyone in the Silver fleet.

Jon

Jon Eskdale
07530 112233

Skype “eskdale”

On 15 February 2016 at 09:15, jmaja100@yahoo.com [sailwave] sailwave@yahoogroups.com wrote:

I’m able to edit the blw file (by hand or with a script) and make the modifications needed to Nett points and Ranks, but that is quite inconvenient.Is it possible to get “inside” the scoring routine to make the changes happen already while pressing Rescore?

Best Regards,

Joakim

On Saturday, February 13, 2016 5:19 PM, “jmaja100@yahoo.com [sailwave]” sailwave@yahoogroups.com wrote:

Yes, it’s a high point system and yes I want to add to Nett points from discards. I already did the following scoring formula for individual races. It seems to work as the table in the SI (the winner gets 3.5-12.5 points, the last.3 or 2 points depending on the number of boats).

2 + lte(p,10)*(lt(s,11)*s+gte(s,11)*10-p+1) + lt(p,2)*0.5

I also made DNF/OCS/DSQ etc. as one point and DNS/DNC as zero point.

But I haven’t been able to add the the discarded races as 1 or 2 points to Nett.

I got an idea how to solve the series ties according to the SI. Add 0.001 points to each race score (and also to the discarded ones), thus a boat with 3 races would get 7.003 and one with two 7.002. You need to use 3 decimals to get the difference. Is it possible to publish the results with just one decimal and still get the order with three? Or maybe we can just say the last two decimals are the number of races sailed.

Best Regards,

Joakim

On Saturday, February 13, 2016 1:35 AM, “Jon Eskdale jon@sailwave.com [sailwave]” sailwave@yahoogroups.com wrote:

Hi Joakim,

So you say you want to add one point for DNF/OCS/DSQ and 2 points for any finishing position so are you using a high point scoring system?

I can’t think of a way of tie breaking with the boat with most races wins.

As for expressions there is some documentation at http://www.sailwave.com/expression

As for these:-

eq = equals

ne = not equal

gt = Greater than

lt = Less than

gte = Greater than or equal to

lte = Less than or equal to

These have two parameters e.g.
eq(a,b) if a = b

gte(a,b) if a >= b

If the expression is true it returns 1 otherwise it returns 0

Jon

Jon Eskdale
07530 112233

Skype “eskdale”

On 12 February 2016 at 22:09, jmaja100@yahoo.com [sailwave] sailwave@yahoogroups.com wrote:

Hi,

I’m trying to use Sailwave for calculating a series including a large number of races (40 or so) during the season for 200+ boats. The SI for the series says that only the six best races are included, but you get activity points from the discarded races. Thus I set discard as “s-6” to get only the six best scores. How do I add one (DNF/OCS/DSQ) or two (any finished postion) activity point for each discarded race to the Nett points?

Also there’s a special rule for series ties. The boat with more races wins a tie. How to do that?

I needed to make a special formula for the point system and I got some help that releaved you can use conditional statements like lte(), gte() etc. I didn’t find any documentation about those. Is it available somewhere?

Best Regards,

Joakim

Hi Joakim - Well done and thanks for the update

Jon

···

On 17 February 2016 at 13:40, jmaja100@yahoo.com [sailwave] sailwave@yahoogroups.com wrote:

Hi Jon,

I managed to recalculate everything in the effect javascript. It became quite long, more than 300 lines. Certainly it could be made more compact. It seems to do everything I was looking for, but haven’t yet tested it ith real races.

One problem I just noticed is that, if someone has javascripts disabled (like me using NoScript), he will see the results before modifications, thus wrong results. I guess that can be avoided by testing the javascript on the web site before allowing the page to be opened.

I think we try to live with this and not use the API approach.

Best Regards,

Joakim

On Tuesday, February 16, 2016 10:30 PM, “Jon Eskdale jon@sailwave.com [sailwave]” sailwave@yahoogroups.com wrote:

Hi Joakim - Sorry for the late response I’ve been away a couple of days.

You seem to have made some good progress. If you want access to the low levels of control within Sailwave. You can use the messaging API which uses the Windows Data messages to control Sailwave. So any language that can send and receive Windows messages can communicate with Sailwave.

If you have played with the NHC scoring this is actually an external program which is using the messaging to communicate with Sailwave As is the interface to ISAF which uses this messaging to communicate and then submits results to ISAF. Basically with this messaging you can read and write most things within Sailwave. So you can modify the results before they are published.

If you want to take this further drop me an email.

Thanks for sharing your JavaScript

Jon

Jon Eskdale
07530 112233

Skype “eskdale”

On 16 February 2016 at 10:23, jmaja100@yahoo.com [sailwave] sailwave@yahoogroups.com wrote:

Hi Jon,

After digging java and html references most of the night I was able to make a script that modifies the nett points and reorders the ranks.

I still have one problem. I would like to score in two divisions (based on rating), but still get the points of individual races like all sailed in one division. Now the parameters s and p in the point formula change when scoring in two division vs. in one group. The races have different rating divisions, thus SI for the series gives points based on position and participants in each race’s each division, not based on division for the series.

I could dig up the number of partisipants and places from the individual race results in java, but that seems like a quite a lot of work.

So is there a way to do this part before the Effect is called? One way of doing it seems to be adding line ““scrfield”,“Division”,“104”,”"" to the blw after rescoring in one group and then open that and publish it without rescoring, but that seems quite error prone approach.

Below is the java I added to ScoredSeparatelyMatrix.js. It’s not pretty, but seems to get what I want and may help someone else.

Best Regards,

Joakim

var list = document.getElementsByClassName("summarytable");
var listl=list.length;
var sailed=[], races=[];
var N=0;
for(i=0;i<listl;i++)
{
var nett=-1;
var rowl=list[i].rows.length;
var celll=list[i].rows[0].cells.length;
var swap;
for(k=1;k<rowl;k++)
{
    var sum=0;
    var partip=0;
    for(j=0;j<celll;j++)
    {
    if(list[i].rows[0].cells[j].innerHTML.search("race")!=-1)
    {
        var str=list[i].rows[k].cells[j].innerHTML;
        if(str.search(" ")!=-1)
        str=str.slice(0,str.search(" "));
        if(str.search("[(]")!=-1) //Discarded
        {
        if(str.search("[)]")==-1)
            str=str.slice(str.search("[(]")+1);
        else
            str=str.slice(str.search("[(]")+1,str.search("[)]")-1);
        if(Number(str)>2.0)
            str="2.0";
        }
        if(Number(str)>=1.0)
        {
        var racename=list[i].rows[0].cells[j].innerHTML;
        racename=racename.slice(racename.search("[>]")+1);
        racename=racename.slice(0,racename.search("[<]"));
        for(n=0;n<N && races[n]!=racename;n++);
        if(n==N)
        {
            N++;
            races[n]=racename;
            sailed[n]=0;
        }
        partip++;
        sailed[n]++;
        }
        sum+=Number(str);
    }
    else
        if(list[i].rows[0].cells[j].innerHTML.search("Nett")!=-1)
        nett=j;

    }
    if(nett!=-1)
    {
    list[i].rows[k].cells[nett].innerHTML = (sum).toFixed(1);
    list[i].rows[k].cells[nett].partip = partip;
    list[i].rows[k].cells[2].innerHTML = list[i].rows[k].cells[nett].partip;
    for(k1=k;k1>1;k1--)
    {
        var n1=Number(list[i].rows[k1-1].cells[nett].innerHTML);
        var n2=Number(list[i].rows[k1].cells[nett].innerHTML);
        var p1=Number(list[i].rows[k1-1].cells[nett].partip);
        var p2=Number(list[i].rows[k1].cells[nett].partip);
        console.log(i,k,k1,n1,n2,p1,p2);
        if(n1<n2 || (n1==n2 && p1<p2))
        {
        console.log("swap");
        for(j=0;j<celll;j++)
        {
            if(list[i].rows[0].cells[j].innerHTML.search("Rank")==-1)
            {
            swap=list[i].rows[k1-1].cells[j].innerHTML;
            list[i].rows[k1-1].cells[j].innerHTML=list[i].rows[k1].cells[j].innerHTML;
            list[i].rows[k1].cells[j].innerHTML=swap;
            }
        }
        list[i].rows[k1].cells[nett].partip=p1;
        list[i].rows[k1-1].cells[nett].partip=p2;
        }
    }
    }
}
for(j=0;j<celll;j++)
    if(list[i].rows[0].cells[j].innerHTML.search("Rank")!=-1)
    for(k=1;k<rowl;k++)
        list[i].rows[k].cells[j].innerHTML=k;

}
for(n=0;n<N;n++)
console.log(races[n], n, sailed[n]);

On Monday, February 15, 2016 8:11 PM, “jmaja100@yahoo.com [sailwave]” sailwave@yahoogroups.com wrote:

Hi Jon,

I’m trying to make the effect to modify the published output, but I have really hard time to get started. I have no idea how to get and set the variables needed. I have tried to follow what the expample scripts do, but I had no success.

I haven’t done any java/CSS/XML before, but I do have a lot of experience in writing C, shell scripts and awk scripts. I could easily write an awk script to modify the blw file as I wanted, but I don’t think that’s a good way of handling this, since I’m making a tool for someone else and he wouldn’t be able to use it like that.

Could you give me an example to get me started? Maybe just a script that adds 1 to each nett point.

Best Regards,

Joakim

On Monday, February 15, 2016 3:18 PM, “Jon Eskdale jon@sailwave.com [sailwave]” sailwave@yahoogroups.com wrote:

I see Huw has just posted an answer on this while I’ve been deciding what to post.

Huw’s suggestion is along the correct lines although as it currently stands I don’t think it will do what you want as this runs and updates for every race. You would want it to run once at the end of the scoring. I did actually attempt to implement this in an earlier version but it broke the NHC code when scoring multiple fleets so I took it back out of the current version as no one was using it anyway. The principle is good as it would allow you to automate what you want.

The Set and seed tools do not allow expressions

As for the effects - although none of the demo ones modify the rank or nett points, there is no reason why a javascript effect could not modify them.

Jon

Jon Eskdale
07530 112233

Skype “eskdale”

On 15 February 2016 at 12:28, jmaja100@yahoo.com [sailwave] sailwave@yahoogroups.com wrote:

Hi Jon,

I don’t want to do anything by hand, since there are 200 boats and 40 races and results are published after each race. And it would be nice to have the real results in Sailwave, not just in the published html.

How can you use tools to change the ranks and nett points? I looked at “set competitor field”, which allows to modify each field for each boat. But how is it used? Which variables are available? Can expressions be used?

The problem with these modifications is that you need to redo them after each rescore (when adding a race result to series). I really would like to automate that. I looked at some of the javascript files, but couldn’t find any manipulation of the Nett points or Ranks. I quess all that is done in the executables? And to do them for publishing you need to add an Effect?

Best Regards,

Joakim

On Monday, February 15, 2016 1:32 PM, “Jon Eskdale jon@sailwave.com [sailwave]” sailwave@yahoogroups.com wrote:

Hi Joakim,

You don’t need to edit the blw by hand to modify the Nett Points or Rank you can do this within Sailwave just select the cell and press enter or F2 (or right click and edit). You can then manually change anything and these values will get published until the next time you score or rescore the series.

You can also manipulate them with the tools from the tools menu. Quite often its useful if you have a Gold and Silver fleet which you want the Silver fleet to have rankings greater than the Gold fleet. So you could use the tools to add a fixed amount to the rank of everyone in the Silver fleet.

Jon

Jon Eskdale
07530 112233

Skype “eskdale”

On 15 February 2016 at 09:15, jmaja100@yahoo.com [sailwave] sailwave@yahoogroups.com wrote:

I’m able to edit the blw file (by hand or with a script) and make the modifications needed to Nett points and Ranks, but that is quite inconvenient.Is it possible to get “inside” the scoring routine to make the changes happen already while pressing Rescore?

Best Regards,

Joakim

On Saturday, February 13, 2016 5:19 PM, “jmaja100@yahoo.com [sailwave]” sailwave@yahoogroups.com wrote:

Yes, it’s a high point system and yes I want to add to Nett points from discards. I already did the following scoring formula for individual races. It seems to work as the table in the SI (the winner gets 3.5-12.5 points, the last.3 or 2 points depending on the number of boats).

2 + lte(p,10)*(lt(s,11)*s+gte(s,11)*10-p+1) + lt(p,2)*0.5

I also made DNF/OCS/DSQ etc. as one point and DNS/DNC as zero point.

But I haven’t been able to add the the discarded races as 1 or 2 points to Nett.

I got an idea how to solve the series ties according to the SI. Add 0.001 points to each race score (and also to the discarded ones), thus a boat with 3 races would get 7.003 and one with two 7.002. You need to use 3 decimals to get the difference. Is it possible to publish the results with just one decimal and still get the order with three? Or maybe we can just say the last two decimals are the number of races sailed.

Best Regards,

Joakim

On Saturday, February 13, 2016 1:35 AM, “Jon Eskdale jon@sailwave.com [sailwave]” sailwave@yahoogroups.com wrote:

Hi Joakim,

So you say you want to add one point for DNF/OCS/DSQ and 2 points for any finishing position so are you using a high point scoring system?

I can’t think of a way of tie breaking with the boat with most races wins.

As for expressions there is some documentation at http://www.sailwave.com/expression

As for these:-

eq = equals

ne = not equal

gt = Greater than

lt = Less than

gte = Greater than or equal to

lte = Less than or equal to

These have two parameters e.g.
eq(a,b) if a = b

gte(a,b) if a >= b

If the expression is true it returns 1 otherwise it returns 0

Jon

Jon Eskdale
07530 112233

Skype “eskdale”

On 12 February 2016 at 22:09, jmaja100@yahoo.com [sailwave] sailwave@yahoogroups.com wrote:

Hi,

I’m trying to use Sailwave for calculating a series including a large number of races (40 or so) during the season for 200+ boats. The SI for the series says that only the six best races are included, but you get activity points from the discarded races. Thus I set discard as “s-6” to get only the six best scores. How do I add one (DNF/OCS/DSQ) or two (any finished postion) activity point for each discarded race to the Nett points?

Also there’s a special rule for series ties. The boat with more races wins a tie. How to do that?

I needed to make a special formula for the point system and I got some help that releaved you can use conditional statements like lte(), gte() etc. I didn’t find any documentation about those. Is it available somewhere?

Best Regards,

Joakim

Jon Eskdale
07530 112233

Skype “eskdale”