Codota Logo
ActionFrequency.<init>
Code IndexAdd Codota to your IDE (free)

How to use
fr.neatmonster.nocheatplus.utilities.ds.count.ActionFrequency
constructor

Best Java code snippets using fr.neatmonster.nocheatplus.utilities.ds.count.ActionFrequency.<init> (Showing top 7 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
origin: NoCheatPlus/NoCheatPlus

public FightData(final FightConfig config){
  speedBuckets = new ActionFrequency(config.speedBuckets, config.speedBucketDur);
  // Start with full fast-heal buffer.
  fastHealBuffer = config.fastHealBuffer; 
}
origin: NoCheatPlus/NoCheatPlus

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);
  }
}
origin: NoCheatPlus/NoCheatPlus

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);
}
origin: NoCheatPlus/NoCheatPlus

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;
}
origin: NoCheatPlus/NoCheatPlus

  /**
   * 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;
  }
}
origin: NoCheatPlus/NoCheatPlus

@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;
}
 
origin: NoCheatPlus/NoCheatPlus

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);
}
fr.neatmonster.nocheatplus.utilities.ds.countActionFrequency<init>

Javadoc

This constructor will set noAutoReset to false, optimized for short term accounting.

Popular methods of ActionFrequency

  • bucketScore
    Get score of a certain bucket. At own risk.
  • clear
    Clear all counts, reset reference and update time.
  • score
    Get a weighted sum score, weight for bucket i: w(i) = factor^i.
  • setBucket
    Set the value for a buckt.
  • sliceScore
    Get score from start on, until before end, with factor.
  • update
    Update without adding, also updates reference and update time. Detects time running backwards.
  • add
    Update and add (updates reference and update time).
  • bucketDuration
    Get the duration of a bucket in milliseconds.
  • lastAccess
    Get the reference time for the transition from the first to the second bucket.
  • lastUpdate
    Get the last time when update was called (adding).
  • leadingScore
    Get score of first end buckets, with factor.
  • numberOfBuckets
    Get the number of buckets.
  • leadingScore,
  • numberOfBuckets,
  • reduce,
  • setTime,
  • subtract,
  • trailingScore

Popular in Java

  • Creating JSON documents from java classes using gson
  • getContentResolver (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • startActivity (Activity)
  • String (java.lang)
  • URI (java.net)
    Represents a Uniform Resource Identifier (URI) reference. Aside from some minor deviations noted bel
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Vector (java.util)
    The Vector class implements a growable array of objects. Like an array, it contains components that
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now