-
Notifications
You must be signed in to change notification settings - Fork 2
Filters
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:
- SummonerFilter - Filters a Summoner.
- MatchFilter - Filters a Match.
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.
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.
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
}
}
Contained within presets/summonerfilters and presets/matchfilters, one may find preset SummonerFilters and MatchFilters.
- 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.
- 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.