Plan/all/com/djrapitops/plan/delivery/domain/mutators/ActivityIndex.html
2020-03-21 16:43:05 +02:00

500 lines
20 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="fi">
<head>
<!-- Generated by javadoc -->
<title>ActivityIndex (Plan 5.1-SNAPSHOT API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ActivityIndex (Plan 5.1-SNAPSHOT API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":9,"i3":10,"i4":10,"i5":9,"i6":10};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev&nbsp;Class</li>
<li><a href="../../../../../../com/djrapitops/plan/delivery/domain/mutators/DateHoldersMutator.html" title="class in com.djrapitops.plan.delivery.domain.mutators"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?com/djrapitops/plan/delivery/domain/mutators/ActivityIndex.html" target="_top">Frames</a></li>
<li><a href="ActivityIndex.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.djrapitops.plan.delivery.domain.mutators</div>
<h2 title="Class ActivityIndex" class="title">Class ActivityIndex</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>com.djrapitops.plan.delivery.domain.mutators.ActivityIndex</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="typeNameLabel">ActivityIndex</span>
extends java.lang.Object</pre>
<div class="block">Represents Activity index of a player at a certain date.
<p>
Old formula for activity index was not linear and difficult to turn into a query due to conditional multipliers.
Thus a new formula was written.
<p>
<code>T</code> - Time played after someone is considered active on a particular week
<code>t1, t2, t3</code> - Time played that week
<p>
Activity index takes into account last 3 weeks.
<p>
Activity for a single week is calculated using <code>A(t) = (1 / (pi/2 * (t/T) + 1))</code>.
A(t) is based on function f(x) = 1 / (x + 1), which has property f(0) = 1, decreasing from there, but not in a straight line.
You can see the function plotted here https://www.wolframalpha.com/input/?i=1+%2F+(x%2B1)+from+-1+to+2
<p>
To fine tune the curve pi/2 is used since it felt like a good curve.
<p>
Activity index A is calculated by using the formula:
<code>A = 5 - 5 * [A(t1) + A(t2) + A(t3)] / 3</code>
<p>
Plot for A and limits
https://www.wolframalpha.com/input/?i=plot+y+%3D+5+-+5+*+(1+%2F+(pi%2F2+*+x%2B1))+and+y+%3D1+and+y+%3D+2+and+y+%3D+3+and+y+%3D+3.75+from+-0.5+to+3
<p>
New Limits for A would thus be
<code>&lt; 1: Inactive</code>
<code>&gt; 1: Irregular</code>
<code>&gt; 2: Regular</code>
<code>&gt; 3: Active</code>
<code>&gt; 3.75: Very Active</code></div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../com/djrapitops/plan/delivery/domain/mutators/ActivityIndex.html#ACTIVE">ACTIVE</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../com/djrapitops/plan/delivery/domain/mutators/ActivityIndex.html#IRREGULAR">IRREGULAR</a></span></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../com/djrapitops/plan/delivery/domain/mutators/ActivityIndex.html#REGULAR">REGULAR</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../com/djrapitops/plan/delivery/domain/mutators/ActivityIndex.html#VERY_ACTIVE">VERY_ACTIVE</a></span></code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../../com/djrapitops/plan/delivery/domain/mutators/ActivityIndex.html#ActivityIndex-com.djrapitops.plan.delivery.domain.container.DataContainer-long-long-">ActivityIndex</a></span>(<a href="../../../../../../com/djrapitops/plan/delivery/domain/container/DataContainer.html" title="interface in com.djrapitops.plan.delivery.domain.container">DataContainer</a>&nbsp;container,
long&nbsp;date,
long&nbsp;playtimeMsThreshold)</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../../com/djrapitops/plan/delivery/domain/mutators/ActivityIndex.html#ActivityIndex-double-long-">ActivityIndex</a></span>(double&nbsp;value,
long&nbsp;date)</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../../com/djrapitops/plan/delivery/domain/mutators/ActivityIndex.html#ActivityIndex-java.util.List-long-long-">ActivityIndex</a></span>(java.util.List&lt;<a href="../../../../../../com/djrapitops/plan/gathering/domain/Session.html" title="class in com.djrapitops.plan.gathering.domain">Session</a>&gt;&nbsp;sessions,
long&nbsp;date,
long&nbsp;playtimeMsThreshold)</code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../com/djrapitops/plan/delivery/domain/mutators/ActivityIndex.html#distance-com.djrapitops.plan.delivery.domain.mutators.ActivityIndex-">distance</a></span>(<a href="../../../../../../com/djrapitops/plan/delivery/domain/mutators/ActivityIndex.html" title="class in com.djrapitops.plan.delivery.domain.mutators">ActivityIndex</a>&nbsp;other)</code>&nbsp;</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../com/djrapitops/plan/delivery/domain/mutators/ActivityIndex.html#getDate--">getDate</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>static java.lang.String[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../com/djrapitops/plan/delivery/domain/mutators/ActivityIndex.html#getDefaultGroups--">getDefaultGroups</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../com/djrapitops/plan/delivery/domain/mutators/ActivityIndex.html#getFormattedValue-com.djrapitops.plan.delivery.formatting.Formatter-">getFormattedValue</a></span>(<a href="../../../../../../com/djrapitops/plan/delivery/formatting/Formatter.html" title="interface in com.djrapitops.plan.delivery.formatting">Formatter</a>&lt;java.lang.Double&gt;&nbsp;formatter)</code>&nbsp;</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../com/djrapitops/plan/delivery/domain/mutators/ActivityIndex.html#getGroup--">getGroup</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>static java.lang.String[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../com/djrapitops/plan/delivery/domain/mutators/ActivityIndex.html#getGroups-com.djrapitops.plan.settings.locale.Locale-">getGroups</a></span>(<a href="../../../../../../com/djrapitops/plan/settings/locale/Locale.html" title="class in com.djrapitops.plan.settings.locale">Locale</a>&nbsp;locale)</code>&nbsp;</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../com/djrapitops/plan/delivery/domain/mutators/ActivityIndex.html#getValue--">getValue</a></span>()</code>&nbsp;</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="VERY_ACTIVE">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>VERY_ACTIVE</h4>
<pre>public static final&nbsp;double VERY_ACTIVE</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../constant-values.html#com.djrapitops.plan.delivery.domain.mutators.ActivityIndex.VERY_ACTIVE">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="ACTIVE">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ACTIVE</h4>
<pre>public static final&nbsp;double ACTIVE</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../constant-values.html#com.djrapitops.plan.delivery.domain.mutators.ActivityIndex.ACTIVE">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="REGULAR">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>REGULAR</h4>
<pre>public static final&nbsp;double REGULAR</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../constant-values.html#com.djrapitops.plan.delivery.domain.mutators.ActivityIndex.REGULAR">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="IRREGULAR">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>IRREGULAR</h4>
<pre>public static final&nbsp;double IRREGULAR</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../constant-values.html#com.djrapitops.plan.delivery.domain.mutators.ActivityIndex.IRREGULAR">Constant Field Values</a></dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="ActivityIndex-com.djrapitops.plan.delivery.domain.container.DataContainer-long-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ActivityIndex</h4>
<pre>public&nbsp;ActivityIndex(<a href="../../../../../../com/djrapitops/plan/delivery/domain/container/DataContainer.html" title="interface in com.djrapitops.plan.delivery.domain.container">DataContainer</a>&nbsp;container,
long&nbsp;date,
long&nbsp;playtimeMsThreshold)</pre>
</li>
</ul>
<a name="ActivityIndex-java.util.List-long-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ActivityIndex</h4>
<pre>public&nbsp;ActivityIndex(java.util.List&lt;<a href="../../../../../../com/djrapitops/plan/gathering/domain/Session.html" title="class in com.djrapitops.plan.gathering.domain">Session</a>&gt;&nbsp;sessions,
long&nbsp;date,
long&nbsp;playtimeMsThreshold)</pre>
</li>
</ul>
<a name="ActivityIndex-double-long-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>ActivityIndex</h4>
<pre>public&nbsp;ActivityIndex(double&nbsp;value,
long&nbsp;date)</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getDefaultGroups--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDefaultGroups</h4>
<pre>public static&nbsp;java.lang.String[]&nbsp;getDefaultGroups()</pre>
</li>
</ul>
<a name="getGroups-com.djrapitops.plan.settings.locale.Locale-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getGroups</h4>
<pre>public static&nbsp;java.lang.String[]&nbsp;getGroups(<a href="../../../../../../com/djrapitops/plan/settings/locale/Locale.html" title="class in com.djrapitops.plan.settings.locale">Locale</a>&nbsp;locale)</pre>
</li>
</ul>
<a name="getValue--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getValue</h4>
<pre>public&nbsp;double&nbsp;getValue()</pre>
</li>
</ul>
<a name="getDate--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDate</h4>
<pre>public&nbsp;long&nbsp;getDate()</pre>
</li>
</ul>
<a name="getFormattedValue-com.djrapitops.plan.delivery.formatting.Formatter-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFormattedValue</h4>
<pre>public&nbsp;java.lang.String&nbsp;getFormattedValue(<a href="../../../../../../com/djrapitops/plan/delivery/formatting/Formatter.html" title="interface in com.djrapitops.plan.delivery.formatting">Formatter</a>&lt;java.lang.Double&gt;&nbsp;formatter)</pre>
</li>
</ul>
<a name="distance-com.djrapitops.plan.delivery.domain.mutators.ActivityIndex-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>distance</h4>
<pre>public&nbsp;double&nbsp;distance(<a href="../../../../../../com/djrapitops/plan/delivery/domain/mutators/ActivityIndex.html" title="class in com.djrapitops.plan.delivery.domain.mutators">ActivityIndex</a>&nbsp;other)</pre>
</li>
</ul>
<a name="getGroup--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getGroup</h4>
<pre>public&nbsp;java.lang.String&nbsp;getGroup()</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev&nbsp;Class</li>
<li><a href="../../../../../../com/djrapitops/plan/delivery/domain/mutators/DateHoldersMutator.html" title="class in com.djrapitops.plan.delivery.domain.mutators"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?com/djrapitops/plan/delivery/domain/mutators/ActivityIndex.html" target="_top">Frames</a></li>
<li><a href="ActivityIndex.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>