public FightData(final FightConfig config){ speedBuckets = new ActionFrequency(config.speedBuckets, config.speedBucketDur); // Start with full fast-heal buffer. fastHealBuffer = config.fastHealBuffer; }
public NetData(final NetConfig config) { flyingFrequencyAll = new ActionFrequency(config.flyingFrequencySeconds, 1000L); flyingFrequencyRedundantFreq = new ActionFrequency(config.flyingFrequencyRedundantSeconds, 1000L); if (config.packetFrequencySeconds <= 2) { packetFrequency = new ActionFrequency(config.packetFrequencySeconds * 3, 333); } else { packetFrequency = new ActionFrequency(config.packetFrequencySeconds * 2, 500); } }
public BlockBreakData(final BlockBreakConfig cc) { setStats(); fastBreakPenalties = new ActionFrequency(cc.fastBreakBuckets, cc.fastBreakBucketDur); frequencyBuckets = new ActionFrequency(cc.frequencyBuckets, cc.frequencyBucketDur); wrongBlockVL = new ActionFrequency(6, 20000); }
private ActionFrequency getActionFrequency(String worldName, int buckets, long durBucket, boolean perWorldCount){ if (!perWorldCount) worldName = ""; ActionFrequency freq = counts.get(worldName); if (freq == null) freq = new ActionFrequency(buckets, durBucket); counts.put(worldName, freq); return freq; }
/** * Deserialize from a string. * @param line * @return */ public static ActionFrequency fromLine(final String line) { // TODO: Backwards-compatible lastUpdate ? String[] split = line.split(","); if (split.length < 3) throw new RuntimeException("Bad argument length."); // TODO final int n = Integer.parseInt(split[0]); final long durBucket = Long.parseLong(split[1]); final long time = Long.parseLong(split[2]); final float[] buckets = new float[split.length -3]; if (split.length - 3 != buckets.length) throw new RuntimeException("Bad argument length."); // TODO for (int i = 3; i < split.length; i ++) { buckets[i - 3] = Float.parseFloat(split[i]); } ActionFrequency freq = new ActionFrequency(n, durBucket); freq.setTime(time); for (int i = 0; i < buckets.length; i ++) { freq.setBucket(i, buckets[i]); } return freq; } }
@Override protected float getScore(List<Character> chars, long ts) { lastAdd = ts; final char[] a = DigestedWords.toArray(chars); final String key = new String(a); ActionFrequency freq = entries.get(key); if (freq == null){ freq = new ActionFrequency(nBuckets, durBucket); entries.put(key, freq); return 0.0f; } freq.update(ts); float score = Math.min(1.0f, freq.score(factor)); freq.add(ts, 1.0f); return score; }
public MovingData(final MovingConfig config, final IPlayerData pData) { this.pData = pData; morePacketsFreq = new ActionFrequency(config.morePacketsEPSBuckets, 500); morePacketsBurstFreq = new ActionFrequency(12, 5000); // Location trace. trace = new LocationTrace(config.traceMaxAge, config.traceMaxSize, NCPAPIProvider.getNoCheatPlusAPI().getGenericInstance(TraceEntryPool.class)); // A new set of workaround conters. ws = NCPAPIProvider.getNoCheatPlusAPI().getGenericInstance(WRPT.class).getWorkaroundSet(WRPT.WS_MOVING); }