def schedule_check(matches): print >>sys.stderr, '{0} matches total'.format(len(matches)) match_counter, opponents, collisions = match_stats.match_statistics(matches) all_teams = set(x for x in match_counter.iterkeys() if utils.is_actual_entrant(x)) for team, matches in match_counter.iteritems(): if not utils.is_actual_entrant(team): continue print >>sys.stderr, '{0}: {1} matches, missed opponents: {2}'.format(team, matches, ', '.join(all_teams - opponents[team] - {team})) if team in collisions: print >>sys.stderr, '\t{0} DO have a match collision'.format(team)
def schedule_check(matches): print >> sys.stderr, '{0} matches total'.format(len(matches)) match_counter, opponents, collisions = match_stats.match_statistics( matches) all_teams = set(x for x in match_counter.iterkeys() if utils.is_actual_entrant(x)) for team, matches in match_counter.iteritems(): if not utils.is_actual_entrant(team): continue print >> sys.stderr, '{0}: {1} matches, missed opponents: {2}'.format( team, matches, ', '.join(all_teams - opponents[team] - {team})) if team in collisions: print >> sys.stderr, '\t{0} DO have a match collision'.format(team)
def evaluate(self, match): number_blank = len( [x for x in match if not utils.is_actual_entrant(x)]) if number_blank > self._max_blanks: # this is not a viable match at all return float('inf') return (self._punishment * 2**number_blank) - self._punishment
def _evaluate_team(self, team): if not is_actual_entrant(team): return 0.0 if team not in self._last_matches: return 0.0 distance_from_last = self._id - self._last_matches[team] - 1 if distance_from_last < self._minimum_separation: return float('inf') return 7.0 * (self._target_separation - distance_from_last)
def update(self, match): for zone, team in enumerate(match): if utils.is_actual_entrant(team): self._team_zone_counts[team, zone] += 1 self._id += 1
def evaluate(self, match): number_blank = len([x for x in match if not utils.is_actual_entrant(x)]) if number_blank > self._max_blanks: # this is not a viable match at all return float('inf') return (self._punishment * 2**number_blank) - self._punishment
def update(self, match): for team in match: if utils.is_actual_entrant(team): self._team_match_counts[team] += 1 self._id += 1
def update(self, match): for team in match: if utils.is_actual_entrant(team): self._teams.add(team) print 'Contained teams: ', list(sorted(self._teams))
def update(self, match): for team in match: if is_actual_entrant(team): self._last_matches[team] = self._id self._id += 1