From eef49943d51383bd78891a23bb8b7414a70ce406 Mon Sep 17 00:00:00 2001 From: Sage The DM Date: Mon, 25 Nov 2024 22:44:57 +0100 Subject: [PATCH] finalize tommorow --- .../CO2-Daten-Projekt-V3/bin/App.class | Bin 7494 -> 7673 bytes .../CO2-Daten-Projekt-V3/bin/Teacher.class | Bin 2945 -> 2685 bytes .../Steiner/CO2-Daten-Projekt-V3/src/App.java | 18 ++++++++++++++++-- .../CO2-Daten-Projekt-V3/src/Teacher.java | 18 ++++++------------ 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/Code/Steiner/CO2-Daten-Projekt-V3/bin/App.class b/Code/Steiner/CO2-Daten-Projekt-V3/bin/App.class index 3301222019553f48b4afc96eac28d4d58100ce4b..5734075ea23559ba8b67fa8a84e20d73b12f1c89 100644 GIT binary patch delta 2835 zcmZWrd3;n?75>g_Z}RezNhS-Kgg^)c!VnTt%9cr>tR*2JkkFQ$DS1r>!VJw!SgJ78 z2LI_QuT{W`plGzx-%qFxAyK5ZqM)sHuUoBct*zE7ZnYGN-+eQfsxQCXd)~QcyWd&f zTx@tZq+h;1cpgBLeB`uVq7@WXuV2)2GjZdV?nt!5 z+#}E;(MTc^?zXmM&8z>lftPVmpm&AiE6hEK=4e7k8D25)sxq%dM|i(Aun(_WFJ#S; z-&?vqUf!~5^`-K*wOd~(f3}A7mgHXrd2L<2i9{sYS# zmnKfZm=W>jsMVKUC~oUW_Tigy49Ugo0&gPLmY}OnujDanQ~&p2OyW22B`L7B8daVW zLjqE2J!DJ@j+QZ+l-~%*PV@Ypp77qdA!DV2fy84yEQFfs^@sc=);q?;_2UhhAXO|K z=Hv$GI_o4&hnP~CWJvXmY`4b};qDt54NB0EDJo)(+AG34Og{{nO5CJYP;G@Bh1LT( zB{J3eY|b4r%etO3yL^s;uOpyCBxFc&nrbp+90FdMXSL;SET3=Sm-v;ESZLslw8UZq zSCqu9)^oXYT+N2GSh{a=k-oJ%9FOj&b`8w~o2N z^D|xL!Sly4(K*xI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p`Qm@UBSAYu7M`|{U`HT+qvmHPtqFmj{^+7Da zE>v=^7P~FHd=^#5LQ7C^RTH~tj7Dk8U_iTwOzCzarP<(?3~}(qaWb$?TKvKoh>^~^I3Zc4B{eJQG@((#jUgX8?eFQF@CabCtLsWz)UJ%xp(hu|qHEz$b=dYg+{ zOey}i=L!`nUNG?)!hM!dpMwLRC&+y?$Nlu;e#-Fxb9<1WiurwkZ`(syk1x?s2XQ0! z_TyoTP%BT`aEsJ1Q?p)uQfuYxzz(V7$VU3xEs5-m-ER3^Bf@H_hpyf#UO3SpOIf2L zo_>zIO%t_QQhba#BxQM0u1rc}jx;BwWmU0u7)DaAO3Kw!2oxWL+ZuVT18dEsQ?Hos zg{+&qP}U=xF%QFyM_K!?z>6bfauj)(rnSDljb`}<--}~((sBChaV+8WQOgQ8kaiOu zM-AdQIPCU^37m+LO3-I`K^KMlQr8yI(Ou>YhT~anq zb7NX!2eSs{HSe%=SU+9zGM@mye1aqMV(;RUO}b?>`x}rY+jw!`_+h#;ZFIKd>VoO0@6$ZUH||9 diff --git a/Code/Steiner/CO2-Daten-Projekt-V3/bin/Teacher.class b/Code/Steiner/CO2-Daten-Projekt-V3/bin/Teacher.class index 1317d820e21437978b12513614eed9b56cacafd6..ac8d970b4ac1c8ad6ce48cf11aa8856f5d69980b 100644 GIT binary patch delta 643 zcmaix%S!@L6vjWt=BmRG7DieLEo$Q?s6~q&l0|I_+Co^PVnUl!@(`|TY-2cA>Xr=Ckn zchq{Fccb71l?j4qM4x!@kMYU)rt!4JNsMW7zVrQZewXj`=c-C$;Onms3jlUtt`_*l zhs2^{B-2^NV1t^%AsRIgxHpws4tjBh!-m7`D2r=MSK|pyQ>yEU3d-MK|`2q?Ejo z&gnj!Bi0^Pl9@gvr!-b9Dn&WPbUkOtgNm#VYnq%Z$VxVEl(qygiVGqdaD)Rt#7Z2z zOB4=~fu28h18Tg_D5Q0@gF~>-V5v+m%O{JjJ-_^~md=iFl524l8IkJvm)f3cCsl%LH%|FGWn! zRJW(o{O*y284)$SH6ubl=bz39O|J3?c=~|mwnd1sMfhS1RRlj`^icTh9L|4kok6iJ zHjgGA{WY57k)s-hn`#_EY(*p5u@T#lCq#C%a0;jCMyj|70i4}k!Wdk*OuZYfpr6ny zxSFIRL{JwIU37+RKmHSr&*K=6FEFPFb=jtl(01FX!I`cbg_n#tT*Gy<;%iQH*mI(7 z?pd1Sa054q>9;j++0N}WVFmPA&hK&iU%yV11y=J9@Q_p^rsNMvyZ@{F2#?JL|GM%7 z=~S9#@xt1c6WrO>KKRg$l}KO>_S+Jz_7pF diff --git a/Code/Steiner/CO2-Daten-Projekt-V3/src/App.java b/Code/Steiner/CO2-Daten-Projekt-V3/src/App.java index 43b8a4f..e75cc80 100644 --- a/Code/Steiner/CO2-Daten-Projekt-V3/src/App.java +++ b/Code/Steiner/CO2-Daten-Projekt-V3/src/App.java @@ -54,7 +54,7 @@ public class App { return averageCO2 / co2DataList.size(); // Example CO2 average level } - private static void calculateBreakPoints(double[] minuteData, Break calcBreak) { + private static void calculateBreakPoints(double[] minuteData, Break calcBreak, Teacher teacher) { int duration = calcBreak.getEnd().getMinute() - calcBreak.getStart().getMinute(); int breakPoints = minuteData.length; if (duration == minuteData.length) { @@ -63,9 +63,17 @@ public class App { breakPoints--; } } - } else System.out.println("Unexpected error"); + if (duration > 5) { + teacher.addPoints(0, breakPoints, 0); + } else { + teacher.addPoints(breakPoints, 0, 0); + } + + // check if next lesson is lunch another teacher or the same and plan + // accordingly + } private static void initializeTeachers() { @@ -161,6 +169,12 @@ public class App { initializeTeachers(); sortTeachers(); printTeachers(); + for (int classrooms = 0; classrooms < 3; classrooms++) { + for (int weekday = 0; weekday < 5; weekday++) { + // get the url and data + // calculate points + } + } // Loop threw each day with a specific classroom and after the weekdays are over // go to the next of the 3 classroms // go threw every break calculate the point and give them to the teacher diff --git a/Code/Steiner/CO2-Daten-Projekt-V3/src/Teacher.java b/Code/Steiner/CO2-Daten-Projekt-V3/src/Teacher.java index 36a84f9..0c98e5e 100644 --- a/Code/Steiner/CO2-Daten-Projekt-V3/src/Teacher.java +++ b/Code/Steiner/CO2-Daten-Projekt-V3/src/Teacher.java @@ -42,18 +42,6 @@ public class Teacher { this.points = new Points(); // Initialize Points object when Teacher is created } - // #region Timetable Methods - public void setTimetable(String day, String[] classes) { - if (day == null || classes == null || classes.length == 0) { - throw new IllegalArgumentException("Day and classes cannot be null or empty."); - } - timetable.put(day, classes); - } - - public String[] getTimetableForDay(String day) { - return timetable.getOrDefault(day, new String[0]); - } - // #region Getters and Setters public String getName() { return name; // Return the teacher's full name @@ -73,6 +61,12 @@ public class Teacher { this.points.setBonusPoints(bonusPoints); } + public void addPoints(int fiveMinute, int tenMinutes, int bonusPoints) { + this.points.addFiveMinuteBreakPoints(fiveMinute); + this.points.addLongerBreakPoints(tenMinutes); + this.points.addBonusPoints(bonusPoints); + } + public int getTotalPoints() { return this.points.getTotalPoints(); }