def onCompute(self, event):
        Parameters.PASS_SOURCE_RADIUS = float(self.risk_parameter1.GetValue())
        Parameters.PASS_TARGET_RADIUS_COEFFICIENT = float(self.risk_parameter2.GetValue())
        Parameters.shooting_radius = float(self.risk_parameter3.GetValue())

        teams = ReaderBase.divideIntoTeams(self.wx_gui.visual_idToPlayers.values())

        self.wx_gui.pass_logger.pass_evaluate.teams = teams
        optimalShootingPointPrediction = OptimalShootingPointPrediction(teams)

        best_goal_position, scat_xr,scat_yr, s1x,s1y = optimalShootingPointPrediction.predict(
                                                            self.convertVisualPlayerToPlayer(self.temp_ball_holder),
                                                            self.wx_gui.pass_logger.pass_evaluate.goalChance,
                                                            iterate=int(self.iteration_choice.GetValue()),
                                                            stepSize=int(self.step_size_choice.GetValue()))
        x, y = best_goal_position
        self.ax.plot([x], [y], 'x', mew=3, ms=15, color="black")
        # self.ax.scatter(scat_xr,scat_yr,s=30,c='red',label = "Opponent Players")
        # self.ax.scatter(s1x,s1y,s=30,c='black',label = "ball owner")
        qwe, = self.ax.plot(s1x, s1y, linestyle="--", linewidth=2, color="black")

        self.canvas.draw()

        # current_pass_event = PassEvent(self.convertVisualPlayerToPlayer(self.pass_event.textcoords),
        #                                            self.convertVisualPlayerToPlayer(self.pass_event.xycoords),
        #                                            ReaderBase.divideIntoTeams(self.visual_idToPlayers.values(),
        #                                                visual=True))
    def load(file_path):
        idToPlayers = {}
        pass_events = []

        tree = ET.parse(file_path)
        root = tree.getroot()
        for child in root:
            if child.tag == "Players":
                for plyr in child:
                    player_id = plyr.attrib["id"]
                    player = PlayerBase([
                        plyr.attrib["type"],
                        player_id,
                        plyr.attrib["js"],
                        plyr.attrib["x"],
                        plyr.attrib["y"]])
                    player.speed = float(plyr.attrib["speed"])
                    player.direction = float(plyr.attrib["direction"])
                    idToPlayers[player_id] = player
            elif child.tag == "Passes":
                for pass_event in child:
                    pass_events.append(
                        PassEvent(
                            idToPlayers[pass_event.attrib["source_id"]],
                            idToPlayers[pass_event.attrib["target_id"]],
                            ReaderBase.divideIntoTeams(idToPlayers.values())
                        )
                    )
        return idToPlayers.values(), pass_events
Beispiel #3
0
    def updatePositions(self, time):
        game_instance = self.sentio.game_instances.getGameInstance(time)
        if game_instance:
            for player in game_instance.players:
                if player.object_id in self.visual_idToPlayers:
                    visual_player = self.visual_idToPlayers[player.object_id]
                    if not visual_player.update_position(time):
                        visual_player.remove()
                        del self.visual_idToPlayers[player.object_id]
                else:
                    visual_player = VisualPlayer(self.layouts.ax, player, time,
                                                 self.sentio.game_instances)
                    self.visual_idToPlayers[player.object_id] = visual_player

            for visual_player_id in self.visual_idToPlayers.keys():
                if visual_player_id not in ReaderBase.mapIDToPlayers(
                        game_instance.players):
                    visual_player = self.visual_idToPlayers[visual_player_id]
                    visual_player.remove()
                    del self.visual_idToPlayers[visual_player_id]

            self.layouts.team_config_page.update(
                self.filterTeamPlayers(self.visual_idToPlayers))
            return True
        else:
            return False
    def OnCompute(self, event):
        self.analytics.clear()

        q = {}
        evaluate = Pass()
        for game_instance in self.match.sentio.game_instances.getAllInstances():
            try:
                if game_instance.event and game_instance.event.isPassEvent():
                    if int(self.interval_min.GetValue()) <= game_instance.time.convertToTime().minute <= int(self.interval_max.GetValue()):
                        pass_source = game_instance.event.pass_event.pass_source
                        pass_target = game_instance.event.pass_event.pass_target
                        evaluate.teams = ReaderBase.divideIntoTeams(game_instance.players)
                        temp_effectiveness = evaluate.effectiveness_withComponents(pass_source, pass_target)[-1]
                        if pass_source.jersey_number in q:
                            q[pass_source.jersey_number].effectiveness_scores.append(temp_effectiveness)
                        else:
                            pass_source.effectiveness_scores = [temp_effectiveness]
                            q[pass_source.jersey_number] = pass_source
            except AttributeError:
                print "event not found for game_instance"

        results = []
        for team in self.getChosenTeams(q.values()):
            temp_results = []
            temp_results.append((team.team_name, ("Effectiveness Score")))
            for player in team.getTeamPlayers():
                temp_results.append((player.jersey_number, (numpy.mean(player.effectiveness_scores))))
            results.append(temp_results)
        results = self.formatInfoToDisplay(results)
        self.analytics.results = EventAnnotationManager.annotateAnalysisResults(self.canvas, self.ax, results)
Beispiel #5
0
    def calculateDirectionFor(time, coord_info, visual=False, player_id=-1):
        positions = []
        for temp_milliseconds in range(time.milliseconds, time.milliseconds+4, 2):
            if visual:
                game_instance = coord_info.getGameInstance(Time(time.half, temp_milliseconds))
                if game_instance:
                    idToPlayers = ReaderBase.mapIDToPlayers(game_instance.players)
                    try:
                        player = idToPlayers[player_id]
                        temp_position = player.get_position()
                    except:
                        temp_position = None
                else:
                    temp_position = None
            else:
                temp_position = coord_info[time.half][temp_milliseconds]
            if temp_position:
                positions.append(temp_position)

        if len(positions) != 2:
            return 0.0

        x1, y1 = positions[0]
        x2, y2 = positions[1]
        dx=((x2-x1) if (x2-x1) != 0.0 else 0.01)

        Q = math.degrees(math.atan((y2-y1)/dx))
        if Q < 0: Q = Q + 360.0
        return float("{0:.2f}".format(Q))
Beispiel #6
0
    def on_pick_event(self, event):
        if isinstance(event.artist, Text):
            if self.pass_source is not None:

                self.pass_target = event.artist
                if self.pass_source != self.pass_target:
                    self.pass_event.xy = (.5,.5)
                    self.pass_event.xycoords = self.pass_target

                    current_pass_event = PassEvent(self.convertVisualPlayerToPlayer(self.pass_event.textcoords),
                                                   self.convertVisualPlayerToPlayer(self.pass_event.xycoords),
                                                   ReaderBase.divideIntoTeams(self.visual_idToPlayers.values(),
                                                       visual=True))
                    if Parameters.IS_DEBUG_MODE_ON:
                        self.risk_range.drawRangeFor(current_pass_event)
                    self.pass_logger.displayDefinedPass(current_pass_event)
                    if self.isHeatMapChosen():
                        self.drawHeatMapFor(current_pass_event)
                    self.passes_defined.append(current_pass_event)
                    self.manual_pass_event_annotations.append(self.pass_event)
                else:
                    self.pass_target = None
            else:
                self.pass_source = event.artist
                xBall, yBall = (event.mouseevent.xdata, event.mouseevent.ydata)

                self.pass_event = self.ax.annotate('', xy=(xBall, yBall), xytext=(.5,.5), picker=True,
                        textcoords=(self.pass_source), size=20, arrowprops=dict(patchA=self.pass_source.get_bbox_patch(),
                        arrowstyle="fancy", fc="0.6", ec="none", connectionstyle="arc3"))

            self.figure.canvas.draw()
Beispiel #7
0
    def computeDominantRegions(self, interval_min=0, interval_max=90, field="Whole Field"):
        game_stop_time_intervals = self.getGameStopTimeIntervals()

        voronoi = Voronoi()
        q = {}

        if interval_min != 0 or interval_max != 90:
            game_instances = self.sentio.game_instances.getInstancesByInterval(interval_min, interval_max)
        else:
            game_instances = self.sentio.game_instances.getAllInstances()

        for game_instance in game_instances:
            try:
                polygons = voronoi.computePolygons(game_instance.players)
                for index, player in enumerate(game_instance.players):
                    polygon = polygons[index]
                    # area_of_polygon = Voronoi.calculateArea(polygon)
                    area_of_polygon = Voronoi.calculateAreaByField(polygon, field,
                                                                   game_instance.isHomeGoalKeeperLocationLeft())
                    if player.object_id in q:
                        temp_player = q[player.object_id]
                        temp_player.dominant_region += area_of_polygon
                        temp_player.total_number_of_instances += 1
                    else:
                        q[player.object_id] = Player(game_instance.time, player.raw_data)
                        q[player.object_id].set_gameStopTimeInterval(game_stop_time_intervals)
                        q[player.object_id].dominant_region = area_of_polygon
                        q[player.object_id].total_number_of_instances = 1
                        q[player.object_id].total_area_for_dominant_regions = voronoi.calculateTotalAreaOfField()
            except:
                print "game instance is missing", game_instance

        self.teams = ReaderBase.idPlayersToTeamPlayers(q)
        return self.teams
Beispiel #8
0
    def buildMatchObjects(self, interval_min=0, interval_max=90):
        game_stop_time_intervals = self.getGameStopTimeIntervals()
        q = {}, {}, {}, {}  ## home_team, away_team, referees, unknowns

        if interval_min != 0 or interval_max != 90:
            game_instances = self.sentio.game_instances.getInstancesByInterval(interval_min, interval_max)
        else:
            game_instances = self.sentio.game_instances.getAllInstances()

        for game_instance in game_instances:
            try:
                teams = ReaderBase.divideIntoTeams(game_instance.players)
                for team_index, team in enumerate(teams.getTeams()):
                    temp_team = q[team_index]
                    for player in team.getTeamPlayers():
                        if player.jersey_number in temp_team:
                            temp_player = temp_team[player.jersey_number]
                            temp_player.appendNewCoordInfo(game_instance.time, player.get_position())
                        else:
                            temp_team[player.jersey_number] = Player(game_instance.time, player.raw_data)
                            temp_team[player.jersey_number].set_gameStopTimeInterval(game_stop_time_intervals)
            except:
                print "game instance is missing", game_instance
        home_team, away_team, referees, unknowns = q
        self.teams = Teams(
            Team(Parameters.HOME_TEAM_NAME, home_team),
            Team(Parameters.AWAY_TEAM_NAME, away_team),
            Team(Parameters.REFEREES_TEAM_NAME, referees),
            Team(Parameters.UNKNOWNS_TEAM_NAME, unknowns)
        )
Beispiel #9
0
 def getRevisedCoordinateData(self):
     a = OrderedDict()
     for line in self.coordinate_data:
         half, minute, second, millisecond, coord_data = int(line[3]), int(line[4]), int(line[5]), int(line[2][-3]),\
                                                     [playerInfo.split(",") for playerInfo in line[6].split("+")[:-1]]
         a[(half, minute, second,
            millisecond)] = ReaderBase.divideIntoTeams(coord_data)
     return a
Beispiel #10
0
 def getCombinedEventData(self):
     event_data = self.getEventData()
     coordinate_data = self.getRawCoordinateData()
     for time in event_data:
         current_event_data = event_data[time]
         current_teams = ReaderBase.divideIntoTeams(coordinate_data[time +
                                                                    (4, )])
         current_event_data.player = self.convertEventPlayerToCoordinatePlayer(
             current_event_data.player, current_teams)
     return event_data
Beispiel #11
0
 def getGameEvents(self):
     coordinate_data = self.getRawCoordinateData()
     a = OrderedDict()
     index = 0
     while index < len(self.event_data) - 1:
         line = self.event_data[index]
         half, minute, second, team_name, js, event_id, event_name = int(line[0]), int(line[1]), int(line[2]), \
                                                                     line[3], int(line[4]), int(line[5]), line[6]
         current_player = PlayerBase((0, 0, js, 0, 0))
         current_player.setTeamName(team_name)
         current_teams = ReaderBase.divideIntoTeams(
             coordinate_data.get((half, minute, second, 4)))
         current_player = self.convertEventPlayerToCoordinatePlayer(
             current_player, current_teams)
         if (half, minute, second, 4) in a:
             temp_game_event = a.get((half, minute, second, 4))
             if temp_game_event.event_id != 1:
                 a[(half, minute, second,
                    4)] = GameEvent(current_player, event_id, event_name)
         else:
             a[(half, minute, second,
                4)] = GameEvent(current_player, event_id, event_name)
         if event_id == 1:
             n_line = self.event_data[index + 1]
             n_half, n_minute, n_second, n_team_name, n_js, n_event_id, n_event_name = \
                 int(n_line[0]), int(n_line[1]), int(n_line[2]), n_line[3], int(n_line[4]), int(n_line[5]), n_line[6]
             if n_event_id == 1:
                 n_player = PlayerBase((0, 0, n_js, 0, 0))
                 n_player.setTeamName(n_team_name)
                 n_teams = ReaderBase.divideIntoTeams(
                     coordinate_data.get((n_half, n_minute, n_second, 4)))
                 n_player = self.convertEventPlayerToCoordinatePlayer(
                     n_player, n_teams)
                 n_game_event = GameEvent(n_player, n_event_id,
                                          n_event_name)
                 if current_player is not None and n_player is not None:
                     current_player = ReaderBase.getPlayerIn(
                         current_player, n_teams)
                     n_game_event.setPassEvent(
                         PassEvent(current_player, n_player, n_teams))
                 a[(n_half, n_minute, n_second, 4)] = n_game_event
         index += 1
     return a
Beispiel #12
0
    def displayDefinedPasses(self):
        self.pass_logger.clear()

        for defined_pass in self.passes_defined:
            defined_pass.pass_source = self.convertVisualPlayerToPlayer(
                defined_pass.pass_source)
            defined_pass.pass_target = self.convertVisualPlayerToPlayer(
                defined_pass.pass_target)
            defined_pass.teams = ReaderBase.divideIntoTeams(
                self.visual_idToPlayers.values(), visual=True)
            self.pass_logger.displayDefinedPass(defined_pass)
 def getChosenTeams(self, players):
     teams = ReaderBase.divideIntoTeams(players)
     if self.team_choice.GetValue() == "All Teams":
         teams = [teams.home_team, teams.away_team]
     elif self.team_choice.GetValue() == "Home Team":
         teams = [teams.home_team]
     elif self.team_choice.GetValue() == "Away Team":
         teams = [teams.away_team]
     else:
         print "chosen team is missing!!!"
     return teams
Beispiel #14
0
    def draw_defencePositionTaking(self,
                                   definedPass,
                                   chosen_js,
                                   number_of_points=(105, 65)):
        teams = ReaderBase.divideIntoTeams(self.draggable_visual_teams,
                                           visual=True)
        if definedPass.pass_source.isHomeTeamPlayer():
            opponent_team = teams.away_team
        else:
            opponent_team = teams.home_team

        p_chosen = opponent_team.getTeamPlayersWithJS().get(chosen_js)
        return self.evaluate(definedPass, p_chosen, number_of_points)
Beispiel #15
0
    def evaluate(self, definedPass, p_accordingTo, resolution):
        p1 = definedPass.pass_source
        p2 = definedPass.pass_target

        x_coord = numpy.linspace(FOOTBALL_FIELD_MIN_X, FOOTBALL_FIELD_MAX_X,
                                 resolution[0])
        y_coord = numpy.linspace(FOOTBALL_FIELD_MIN_Y, FOOTBALL_FIELD_MAX_Y,
                                 resolution[1])

        self.effectivenessByComponent = {
            "overallRisk": [],
            "gain": [],
            "passAdvantage": [],
            "goalChance": [],
            "effectiveness": []
        }

        self.pass_evaluate.teams = ReaderBase.divideIntoTeams(
            self.draggable_visual_teams.values(), visual=True)

        for y in y_coord:
            temp_overRisk, temp_gain, temp_passAdv, temp_goalChange, temp_effect = [], [], [], [], []
            for x in x_coord:
                p_accordingTo.set_position((x, y))
                if p_accordingTo.object_id == p1.object_id:
                    currentEffectiveness_withComponents = self.pass_evaluate.effectiveness_withComponents(
                        p_accordingTo, p2)
                elif p_accordingTo.object_id == p2.object_id:
                    currentEffectiveness_withComponents = self.pass_evaluate.effectiveness_withComponents(
                        p1, p_accordingTo)
                else:
                    currentEffectiveness_withComponents = self.pass_evaluate.effectiveness_withComponents(
                        p1, p2)
                self.effectivenessByPosition[(
                    x, y)] = currentEffectiveness_withComponents
                for index, component in enumerate([
                        temp_overRisk, temp_gain, temp_passAdv,
                        temp_goalChange, temp_effect
                ]):
                    component.append(
                        currentEffectiveness_withComponents[index])
                    # print x,y
            self.effectivenessByComponent["overallRisk"].append(temp_overRisk)
            self.effectivenessByComponent["gain"].append(temp_gain)
            self.effectivenessByComponent["passAdvantage"].append(temp_passAdv)
            self.effectivenessByComponent["goalChance"].append(temp_goalChange)
            self.effectivenessByComponent["effectiveness"].append(temp_effect)

        self.draw(self.effectivenessByComponent["overallRisk"])
Beispiel #16
0
    def calculateSpeedFor(time, coord_info, visual=False, player_id=-1):
        pre_position = None
        speed = 0.0
        for temp_milliseconds in range(time.milliseconds-8, time.milliseconds+2, 2):
            if visual:
                game_instance = coord_info.getGameInstance(Time(time.half, temp_milliseconds))
                if game_instance:
                    idToPlayers = ReaderBase.mapIDToPlayers(game_instance.players)
                    try:
                        player = idToPlayers[player_id]
                        position = player.get_position()
                    except:
                        position = None
                else:
                    position = None
            else:
                position = coord_info[time.half][temp_milliseconds]

            if pre_position and position:
                speed += math.sqrt(pow(position[0]-pre_position[0],2) + pow(position[1]-pre_position[1],2))
            if position: ### needed to handle missing positions
                pre_position = position

        return float("{0:.2f}".format(speed))
    def parse(self):
        with open(self.file_path) as data_file:
            data = json.load(data_file)
            mapping_index = 0
            for temp_half in data["data"]["Half"]:
                positions_data = data["data"]["Half"][temp_half][
                    "PositionData"]
                for position_data in positions_data:
                    time_in_millisec = position_data["val"]
                    players = deque()
                    for plyr in position_data["players"]:
                        players.append([
                            plyr["type"], plyr["id"], plyr["js"], plyr["x"],
                            plyr["y"]
                        ])
                    temp_time = Time(int(temp_half), time_in_millisec)
                    self.game_instances[int(
                        temp_half)][time_in_millisec] = GameInstance(
                            temp_time, players)

                    self.slider_mapping[mapping_index] = temp_time
                    mapping_index += 1

                index = 0
                events_data = data["data"]["Half"][temp_half]["EventData"]
                while index < len(events_data) - 1:
                    c_event = events_data[index]
                    c_time_in_millisec = int(c_event["time"])
                    c_player_id = int(c_event["player_id"])
                    c_event_type = c_event["type"]
                    c_event_id = int(c_event["type_id"])

                    temp_game_instance = self.game_instances[int(
                        temp_half)][c_time_in_millisec]
                    teams = ReaderBase.divideIntoTeams(
                        temp_game_instance.players)
                    c_player = self.idToPlayer(c_player_id, teams)
                    if temp_game_instance.event is not None:
                        if c_event_id != 1:
                            temp_game_instance.setEvent(
                                GameEvent(c_player, c_event_id, c_event_type))
                    else:
                        temp_game_instance.setEvent(
                            GameEvent(c_player, c_event_id, c_event_type))

                    if c_event_id == 1:
                        if index != 0:
                            p_event = events_data[index - 1]
                            p_time_in_millisec = int(p_event["time"])
                            p_event_type = p_event["type"]
                            p_event_id = int(p_event["type_id"])
                            p_player_id = int(p_event["player_id"])

                            p_temp_game_instance = self.game_instances[int(
                                temp_half)][p_time_in_millisec]
                            p_teams = ReaderBase.divideIntoTeams(
                                p_temp_game_instance.players)
                            p_player = self.idToPlayer(p_player_id, p_teams)
                            p_game_event = GameEvent(p_player, p_event_id,
                                                     p_event_type)

                            if p_event_id == 1:
                                p_player = self.idToPlayer(p_player_id, teams)
                                if p_player is not None and c_player is not None:
                                    temp_game_instance.event.setPassEvent(
                                        PassEvent(p_player, c_player, teams))
                    index += 1

        self.game_instances = GameInstances(self.game_instances)
        return self.game_instances, self.slider_mapping
Beispiel #18
0
__author__ = 'emrullah'

reader = XMLreader(os.path.join(DATA_BASE_DIR, 'output/sentio_data_new.xml'))
game_instances, slider_mapping = reader.parse()

computation_times = []
evaluate = Pass()
for game_instance in game_instances.getAllInstances():
    if game_instance.event and game_instance.event.isPassEvent():
        pass_event = game_instance.event.pass_event
        # if pass_event.isSuccessful():
        # try:
        pass_source = pass_event.pass_source
        pass_target = pass_event.pass_target
        evaluate.teams = ReaderBase.divideIntoTeams(game_instance.players)
        start = time.time()
        evaluate.effectiveness_withComponents(pass_source, pass_target)
        temp_computation_time = time.time() - start  # in sec
        computation_times.append(temp_computation_time)
        # except:
        #     print "the algorithm is buggy"

print max(computation_times), min(computation_times), "---"
# bin1,bin2,bin3,bin4=[],[],[],[]
# for pt in computation_times:
#     if pt < 0.004: bin1.append(pt)
#     elif 0.004 <pt<  0.005: bin2.append(pt)
#     elif 0.005 <pt<  0.006: bin3.append(pt)
#     else: bin4.append(pt)
#
Beispiel #19
0
    def parse(self):
        tree = ET.parse(self.file_path)
        root = tree.getroot()
        mapping_index = 0
        for child in root:
            if child.tag == "Half":
                temp_half = int(child.attrib["number"])
                for grandchild in child:
                    if grandchild.tag == "PositionData":
                        for time_point in grandchild:
                            time_in_millisec = int(time_point.attrib["val"])
                            players = deque()
                            for plyr in time_point:
                                players.append(
                                    PlayerBase([
                                        plyr.attrib["type"], plyr.attrib["id"],
                                        plyr.attrib["js"], plyr.attrib["x"],
                                        plyr.attrib["y"]
                                    ]))
                            temp_time = Time(int(temp_half), time_in_millisec)
                            self.game_instances[temp_half][
                                time_in_millisec] = GameInstance(
                                    temp_time, players)

                            self.slider_mapping[mapping_index] = temp_time
                            mapping_index += 1

                    elif grandchild.tag == "EventData":
                        index = 0
                        while index < len(grandchild) - 1:
                            c_event = grandchild[index]
                            c_time_in_millisec = int(c_event.attrib["time"])
                            try:
                                c_player_id = int(c_event.attrib["player_id"])
                            except:
                                c_player_id = None
                            c_event_type = c_event.attrib["type"]
                            c_event_id = int(c_event.attrib["type_id"])

                            temp_game_instance = self.game_instances[
                                temp_half][c_time_in_millisec]
                            teams = ReaderBase.divideIntoTeams(
                                temp_game_instance.players)
                            c_player = self.idToPlayer(c_player_id, teams)

                            c_temp_time = Time(int(temp_half),
                                               c_time_in_millisec)
                            temp_game_instance.setEvent(
                                GameEvent(c_player, c_event_id, c_event_type,
                                          c_temp_time))

                            if c_event_id == 1:
                                if index != 0:
                                    p_event = grandchild[index - 1]

                                    p_time_in_millisec = int(
                                        p_event.attrib["time"])
                                    p_event_type = p_event.attrib["type"]
                                    p_event_id = int(p_event.attrib["type_id"])
                                    try:
                                        p_player_id = int(
                                            p_event.attrib["player_id"])
                                    except:
                                        p_player_id = None

                                    p_temp_game_instance = self.game_instances[
                                        temp_half][p_time_in_millisec]
                                    p_teams = ReaderBase.divideIntoTeams(
                                        p_temp_game_instance.players)
                                    p_player = self.idToPlayer(
                                        p_player_id, p_teams)

                                    p_temp_time = Time(int(temp_half),
                                                       p_time_in_millisec)
                                    p_game_event = GameEvent(
                                        p_player, p_event_id, p_event_type,
                                        p_temp_time)

                                    if p_event_id == 1:
                                        p_player = self.idToPlayer(
                                            p_player_id, teams)
                                        if p_player is not None and c_player is not None:
                                            temp_game_instance.event.setPassEvent(
                                                PassEvent(
                                                    p_player, c_player, teams))
                            index += 1

        self.game_instances = GameInstances(self.game_instances)
        return self.game_instances, self.slider_mapping
Beispiel #20
0
 def __init__(self, file_path):
     ReaderBase.__init__(self, file_path)
 def isHomeGoalKeeperLocationLeft(self):
     teams = ReaderBase.divideIntoTeams(self.players)
     return teams.home_team.getGoalKeeper().getX(
     ) < teams.away_team.getGoalKeeper().getX()
Beispiel #22
0
 def filterTeamPlayers(self, visual_idToPlayers):
     teams = ReaderBase.divideIntoVisualTeams(visual_idToPlayers.values())
     team_players = teams.home_team.team_players
     team_players.update(teams.away_team.team_players)
     return team_players
Beispiel #23
0
    def __init__(self, file_path):
        ReaderBase.__init__(self, file_path)

        self.coordinate_data = {}
        self.event_data = {}