Package bosco :: Module ranking :: Class ControlPunchtimeScoreing
[hide private]
[frames] | no frames]

Class ControlPunchtimeScoreing

source code

   object --+        
            |        
CachingObject --+    
                |    
 AbstractScoreing --+
                    |
   object --+       |
            |       |
CachingObject --+   |
                |   |
        Validator --+
                    |
                   ControlPunchtimeScoreing

Scores according to the (expected) absolute punchtime at a given control. This is not intended for preliminary results but to watch a control near the finish and to show incomming runners. To make effective use of this you need a rankable with all open runs as members. RankableItems scored with this strategy should be open runs. This is a combined scoreing and validation strategy.

Instance Methods [hide private]
 
__init__(self, control_list, distance_to_finish=0, cache=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
validate(self, run)
Returns: Validator.OK if the control was punched, Validator.NOT_COMPLETED if the control was not yet punched
source code
 
score(self, run)
Returns: time of the punch or datetime.min if punchtime is unknown.
source code

Inherited from CachingObject (private): _from_cache, _to_cache

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from AbstractScoreing: information

Inherited from Validator: DID_NOT_FINISH, DID_NOT_START, DISQUALIFIED, MISSING_CONTROLS, NOT_COMPLETED, OK

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, control_list, distance_to_finish=0, cache=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • control_list - score at these controls
  • distance_to_finish - distance form control to the finish. This is used to compute the expected time at this control (not yet implemented)
Overrides: object.__init__

validate(self, run)

source code 

Returns OK for every object. Override in subclasses for more meaningfull validations.

Returns:
Validator.OK if the control was punched, Validator.NOT_COMPLETED if the control was not yet punched
Overrides: Validator.validate

score(self, run)

source code 

Returns the score of the given objects. Throws UnscoreableException if the object can't be scored with this strategy. The returned score must implement __cmp__.

Returns:
time of the punch or datetime.min if punchtime is unknown. If more than one of the control was punched, the punchtime of the first in the list is returned.
Overrides: AbstractScoreing.score