-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[urgente] Tenere conto di weightFactor (medie ponderate) #197
Labels
bug
Something isn't working
Milestone
Comments
Gabboxl
changed the title
Tenere conto di weightFactor
[urgente] Tenere conto di weightFactor
Nov 22, 2023
public float getAvg(String str) {
float f = Utils.FLOAT_EPSILON;
float f2 = Utils.FLOAT_EPSILON;
for (Grade grade : C6961p.m4026b(new InterfaceC7142a[0]).m4022b(Grade.class).m4100w(Grade_Table.user.m3487s().m3494l(str)).m4013u(Grade_Table.value.m3497h(Float.valueOf((float) Utils.FLOAT_EPSILON))).m4013u(Grade_Table.code.m3492n(EventCode.GRV2.toString())).mo4015s()) {
if (grade.getValue() > Utils.FLOAT_EPSILON) {
f2 = (float) (f2 + (grade.getValue() * grade.getWeightFactor()));
f = (float) (f + grade.getWeightFactor());
}
}
return f != Utils.FLOAT_EPSILON ? f2 / f : Utils.FLOAT_EPSILON;
} public float getAvgForPeriod(String str, int i) {
float f = Utils.FLOAT_EPSILON;
float f2 = Utils.FLOAT_EPSILON;
for (Grade grade : C6961p.m4026b(new InterfaceC7142a[0]).m4022b(Grade.class).m4100w(Grade_Table.user.m3487s().m3494l(str)).m4013u(Grade_Table.value.m3497h(Float.valueOf((float) Utils.FLOAT_EPSILON))).m4013u(Grade_Table.period.m3500d(Integer.valueOf(i))).m4013u(Grade_Table.code.m3492n(EventCode.GRV2.toString())).mo4015s()) {
if (grade.getValue() > Utils.FLOAT_EPSILON) {
f2 = (float) (f2 + (grade.getValue() * grade.getWeightFactor()));
f = (float) (f + grade.getWeightFactor());
}
}
return f != Utils.FLOAT_EPSILON ? f2 / f : Utils.FLOAT_EPSILON;
} |
private float m3476k2(List<Grade> list) {
float f = Utils.FLOAT_EPSILON;
float f2 = Utils.FLOAT_EPSILON;
for (Grade grade : list) {
if (grade.getValue() > Utils.FLOAT_EPSILON && (Grade.EventCode.GRV0.equals(grade.getEvtCode()) || Grade.EventCode.GRV1.equals(grade.getEvtCode()))) {
f2 = (float) (f2 + (grade.getValue() * grade.getWeightFactor()));
f = (float) (f + grade.getWeightFactor());
}
}
return f != Utils.FLOAT_EPSILON ? f2 / f : Utils.FLOAT_EPSILON;
} public float m9717h3(List<C4741a> list) {
float f = Utils.FLOAT_EPSILON;
float f2 = Utils.FLOAT_EPSILON;
for (C4741a c4741a : list) {
if (c4741a.f15078s.getValue() > Utils.FLOAT_EPSILON && (Grade.EventCode.GRV0.equals(c4741a.f15078s.getEvtCode()) || Grade.EventCode.GRV1.equals(c4741a.f15078s.getEvtCode()))) {
f2 = (float) (f2 + (c4741a.f15078s.getValue() * c4741a.f15078s.getWeightFactor()));
f = (float) (f + c4741a.f15078s.getWeightFactor());
}
}
return f != Utils.FLOAT_EPSILON ? f2 / f : Utils.FLOAT_EPSILON;
} |
/* renamed from: i3 */
public int m9716i3(List<C4741a> list) {
int i = -1;
for (int i2 = 0; i2 < list.size() && i == -1; i2++) {
if (list.get(i2).f15078s.getValue() > Utils.FLOAT_EPSILON && Grade.EventCode.GRV0.equals(list.get(i2).f15078s.getEvtCode())) {
i = i2;
}
}
if (i != -1) {
int i3 = -1;
for (int i4 = i + 1; i4 < list.size() && i3 == -1; i4++) {
if (list.get(i4).f15078s.getValue() > Utils.FLOAT_EPSILON && Grade.EventCode.GRV0.equals(list.get(i4).f15078s.getEvtCode())) {
i3 = i4;
}
}
if (i3 != -1) {
Grade grade = list.get(i).f15078s;
Grade grade2 = list.get(i3).f15078s;
double value = grade.getValue() * grade.getWeightFactor();
double value2 = grade2.getValue() * grade2.getWeightFactor();
if (value > value2) {
return 1;
}
return value < value2 ? -1 : 0;
}
return Integer.MAX_VALUE;
}
return Integer.MAX_VALUE;
} |
Per il momento non contempliamo l'epsilon del float perchè non facciamo nessuna comparazione, non ci serve |
Gabboxl
changed the title
[urgente] Tenere conto di weightFactor
[urgente] Tenere conto di weightFactor (medie ponderate)
Dec 4, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Capire come viene usato il weightFactor delle valutazioni, da fare al più presto perchè sta causando un casino di crash al giorno
The text was updated successfully, but these errors were encountered: