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

Class RoundCountScoreing

source code

       object --+        
                |        
    CachingObject --+    
                    |    
     AbstractScoreing --+
                        |
   object --+           |
            |           |
CachingObject --+       |
                |       |
        Validator --+   |
                    |   |
      CourseValidator --+
                        |
                       RoundCountScoreing

This scoreing strategy computes the score as the count of complete runs of a course. This is mostly usefull for non orienteering events where runners have to run as much rounds as possible in a predifined time intervall. Be aware that SI Card 5 and SI Card 8 only hold 30 punches!

This is a combined validator and scoreing strategy.

Instance Methods [hide private]
 
__init__(self, course, mindiff=timedelta(0), cache=None)
@param course Course object with all controls on the roundcourse.
source code
 
validate(self, run)
Check if run is a valid run for this course.
source code
 
score(self, run)
Returns the score of the given objects.
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, course, mindiff=timedelta(0), cache=None)
(Constructor)

source code 

@param course  Course object with all controls on the roundcourse. In the simplest case
               this course has only 1 control.
@param mindiff Minimal time difference between valid punches. This is necessary to avoid
               counting two runs if runners punch the only control of the course two times
               without running the round in between.
@type mindiff  timedelta

Parameters:
  • cache - scoreing cache
Overrides: object.__init__

validate(self, run)

source code 

Check if run is a valid run for this course. This only checks if the run is complete has a start punch and a finish punch. It does not check any controls! Override this in subclasses for more usefull validation (and call super() to not duplicate this code).

Overrides: Validator.validate
(inherited documentation)

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__.

Overrides: AbstractScoreing.score
(inherited documentation)