Skip to content
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

Closed
Gabboxl opened this issue Nov 22, 2023 · 5 comments
Closed

[urgente] Tenere conto di weightFactor (medie ponderate) #197

Gabboxl opened this issue Nov 22, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@Gabboxl
Copy link
Owner

Gabboxl commented Nov 22, 2023

Capire come viene usato il weightFactor delle valutazioni, da fare al più presto perchè sta causando un casino di crash al giorno

@Gabboxl Gabboxl changed the title Tenere conto di weightFactor [urgente] Tenere conto di weightFactor Nov 22, 2023
@Gabboxl
Copy link
Owner Author

Gabboxl commented 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;
    }

@Gabboxl
Copy link
Owner Author

Gabboxl commented Nov 22, 2023

    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;
    }

@Gabboxl
Copy link
Owner Author

Gabboxl commented Nov 22, 2023

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

@Gabboxl
Copy link
Owner Author

Gabboxl commented Nov 24, 2023

Per il momento non contempliamo l'epsilon del float perchè non facciamo nessuna comparazione, non ci serve

@Gabboxl
Copy link
Owner Author

Gabboxl commented Nov 24, 2023

91bd75b

@Gabboxl Gabboxl closed this as completed Nov 24, 2023
@alessandrocaseti alessandrocaseti added this to the Release v1.2.0 milestone Nov 25, 2023
@alessandrocaseti alessandrocaseti added the bug Something isn't working label Nov 25, 2023
@Gabboxl 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
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants