Options
All
  • Public
  • Public/Protected
  • All
Menu

A sequence of events by the same team

Hierarchy

  • Sequence

Index

Constructors

Properties

counters: Counter[]

Counters for the sequence, useful for filtering

duration: number

Duration of the sequence (in seconds)

endTime: number

Game time of the last event in the sequence.

events: Event[]

Events that compose the sequence

game: Game

Game that this sequence is associated with.

id: string

ID of the sequence, generated while parsing the game

length: number = 0

Number of events composing the sequence, it's the same as events.length

name: string

An optional name for the sequence, useful in custom sequences or for naming built in sequences while processing them.

period: number = 1

Period in which the sequence occurred

rule: Rule

The rule that created this event, undefined if it comes from the data source.

startTime: number

Game time of the first event in the sequence.

team: Team

Team that this sequence is associated with.

Accessors

  • The sequence specific attributes

    Returns Attribute[]

  • First event of the sequence

    Returns Event

  • Last event of the sequence

    Returns Event

  • get lastEventOfTeam(): Event
  • Last event of the sequence of the team that started the sequence

    Returns Event

  • get opponent(): Team
  • Get the opponent team (the team that is not the one performing the events in this sequence)

    Returns Team

Methods

  • addAttribute(name: string, value?: string): void
  • Add an attribute to a sequence. The attribute will be visible in all the events of the sequence and in the sequence itself. NOTE attributes in sequences require at least one event to be added to the sequence.

    Parameters

    • name: string

      name of the attribute to add

    • Optional value: string

      value of the attribute (can be null for boolean attributes)

    Returns void

  • addEvent(ev: Event): void
  • Add an event to a sequence

    Parameters

    • ev: Event

      the event to add to the sequence

    Returns void

  • distanceGained(): number
  • Returns the distance that have been gained in this sequence. The distance is expressed as percent of the field length, to get the distance in meters for football simpy multiply it by 105 and divide it by 100. If you want to get the maximum distance gained in this seuqnece use maxDistanceGained()

    Returns number

    the distance gained in this sequence as percentage of the field length.

  • getAttribute(name: string): string
  • Get the value of an attribute. NOTE: use hasAttribute() if you want to query a boolean attribute.

    Parameters

    • name: string

      name of the attribute

    Returns string

    the value of the attribute or undefined if the attribute is not present

  • hasAttribute(name: string): boolean
  • Check if a sequence contains a given attribute.

    Parameters

    • name: string

      name of the attribute

    Returns boolean

    a boolean value indicating if the attribute is present

  • hasExactly(eventType: string, num: number): boolean
  • Returns true if the sequence has EXACTLY the given number of occurrencies of the given event type.

    Parameters

    • eventType: string

      type of the event

    • num: number

      number of occurrencies

    Returns boolean

  • hasMoreThan(eventType: string, num: number): boolean
  • Returns true if the sequence has more than the given number of occurrencies of the given event type.

    Parameters

    • eventType: string

      type of the event

    • num: number

      number of occurrencies

    Returns boolean

  • hasOne(eventType: string): boolean
  • Returns true if the sequence has at least one event of the given type.

    Parameters

    • eventType: string

      type of the event

    Returns boolean

  • maxDistanceGained(): number
  • Returns the maximum distance that have been gained in this sequence. The distane is expressed as percent of the field length, to get the distance in meters for football simpy multiply it by 105 and divide it by 100. The most forward event may be not the last one. If you want to get the distance gained from the first and the last event use distanceGained().

    Returns number

    The maximum distance gained in percentage of the field length.