com.tractrac.ResultAPI
Class ResultGenerator

java.lang.Object
  extended by com.tractrac.ResultAPI.ResultGenerator

public class ResultGenerator
extends java.lang.Object

Main class for generation of:

The class should recieve mark-roundings, routes, mark-positions and competitor positions to work properly.


Constructor Summary
ResultGenerator(java.net.URL paramUrl)
           
 
Method Summary
 java.util.List<LiveResult> getLiveResults()
          Generates a live result list for the last time recalculate was run.
 java.util.List<PerLegResult> getPerLegResults()
          Generate a result list with result per leg.
 void recalcuateWithWind(long timems, double windDirectionDegrees)
          Recalculates the live leaderboard and the mark rounding statistics.
 void recalculate(long timems)
          Recalculates the live leaderboard and the mark rounding statistics.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultGenerator

public ResultGenerator(java.net.URL paramUrl)
Method Detail

getLiveResults

public java.util.List<LiveResult> getLiveResults()
Generates a live result list for the last time recalculate was run.

Note: Please make sure the run recalculate first to get the latest results.

Returns:
a list with a live result list per class

getPerLegResults

public java.util.List<PerLegResult> getPerLegResults()
Generate a result list with result per leg. Use recalculate to update.

Note: Please make sure the run recalculate first to get the latest results.

Returns:
a list of mark results per class

recalculate

public void recalculate(long timems)
Recalculates the live leaderboard and the mark rounding statistics.

By settings timems to now, you get the very latest result.

This recalculation is done using by projecting all boats onto the direct line between the previous mark and the next mark. The distance along this line is used for leaderboard calculations.

As a standard recommendation timems should be set to now - (timedelay).
Timedelay should generally be unit sending interval + 2-5 seconds.

Parameters:
timems - Time in milliseconds to calculate results for

recalcuateWithWind

public void recalcuateWithWind(long timems,
                               double windDirectionDegrees)
Recalculates the live leaderboard and the mark rounding statistics.

By settings timems to now, you get the very latest result.

As a standard recommendation timems should be set to now - (timedelay). Timedelay should generally be unit sending interval + 2-5 seconds.

This recalculation is done using a custom wind direction. That means that:

Parameters:
timems - Time in milliseconds to calculate results for
windDirectionDegrees - The wind direction (where the wind is coming from) in degrees from 0 to 359.