Skip to content

Filters

omarathon edited this page Aug 12, 2019 · 10 revisions

Overview

Filters are essential to controlling the movement of the crawler through Matches and Summoners, as well as in restricting the data sent to an OutputHandler.

There are two main filters:

Both SummonerFilters and MatchFilters are GhostFilters. A GhostFilter is a MemorisingFilter, which overrides the MemorisingFilter's apply method to firstly check whether the incoming GhostObject exists. If not, it's instantly rejected by the filter, otherwise the filter proceeds to be applied.

Usage

One may define their own Filter by implementing its filter method, predicating the input object of the filter's type.

Since SummonerFilter and MatchFilter both only have their filter method unimplemented, it's the only method one must implement to obtain a fully functioning filter.

Examples

Below is an example for constructing your own SummonerFilter:

public class ExampleFilter extends SummonerFilter {
    public boolean filter(Summoner s) {
        // predicate the input Summoner here
    }
}

and similarly constructing your own MatchFilter:

public class ExampleFilter extends MatchFilter {
    public boolean filter(Match m) {
        // predicate the input Match here
    }
}

Presets

Contained within presets/summonerfilters and presets/matchfilters, one may find preset SummonerFilters and MatchFilters.

Preset SummonerFilters

  • AllowAllSummonerFilter - simply returns true in the predicate for the SummonerFilter - accepts any input Summoner.
  • LevelSummonerFilter - accepts all Summoners that are level 30 and above, and rejects all Summoners below level 30.
  • EloSummonerFilter - predicates Summoners based upon whether their Rank obtained from a SummonerEloEstimator belongs to a Set of input "allowed" Ranks. If it does, the Summoner is accepted by the filter, otherwise it's rejected. Refer to Estimators Wiki Page for more information on SummonerEloEstimators.

Preset MatchFilters

  • AllowAllMatchFilter - simply returns true in the predicate for the MatchFilter - accepts any input Match.
  • GameDurationMatchFilter - accepts all Matches that are 20 mins or longer, and rejects any Match that has a duration less than 20 mins.
  • QueueMatchFilter - accepts only Matches that are of one of the accepted Queues, with a given Set of allowed Queue objects for match.getQueue() to match with.
  • EloMatchFilter - Obtains the Rank of a Match based upon a given MatchEloEstimator (see the Estimators Wiki Page). Then, only accepts Matches that are of an accepted Rank, where the accepted Ranks are given as a Set of Rank objects.
Clone this wiki locally