dghf
JCHJava Community | Help. Code. Learn.
•Created by dghf on 4/5/2025 in #java-help
`java.lang.NumberFormatException` in StreamCipher - Key Parsing Issue
Oh sorry, I forgot to compile!
Is this good?
12 replies
JCHJava Community | Help. Code. Learn.
•Created by dghf on 4/5/2025 in #java-help
`java.lang.NumberFormatException` in StreamCipher - Key Parsing Issue
I got
after switching to
Long.parseLong(key);
12 replies
JCHJava Community | Help. Code. Learn.
•Created by dghf on 4/5/2025 in #java-help
`java.lang.NumberFormatException` in StreamCipher - Key Parsing Issue
So I should change it from
seed = Integer.parseInt(key);
to seed = Long.parseLong(key);
?12 replies
JCHJava Community | Help. Code. Learn.
•Created by dghf on 4/5/2025 in #java-help
`java.lang.NumberFormatException` in StreamCipher - Key Parsing Issue
This is the content of key.txt
https://cdn.discordapp.com/attachments/172054352289071104/1358145049631920128/Skarmavbild_2025-04-05_kl._20.23.29.png?ex=67f2c6a4&is=67f17524&hm=3130ee94aca9a8836a98e4a0dcac7b354e9ffe5bdda9b538f25da09c033fe133&
12 replies
JCHJava Community | Help. Code. Learn.
•Created by dghf on 4/5/2025 in #java-help
`java.lang.NumberFormatException` in StreamCipher - Key Parsing Issue
However, when I run this, I get the following error:
12 replies
JCHJava Community | Help. Code. Learn.
•Created by dghf on 3/19/2025 in #java-help
Issues with Contract Work Percentage Constraint in Employee Scheduling
We'll verify that employees do not exceed their assigned work percentage. For example, if an employee has a 1% work percentage, they should only be assigned shifts that fit within that limit.
154 replies
JCHJava Community | Help. Code. Learn.
•Created by dghf on 3/19/2025 in #java-help
Issues with Contract Work Percentage Constraint in Employee Scheduling
@dan1st | Daniel
154 replies
JCHJava Community | Help. Code. Learn.
•Created by dghf on 3/19/2025 in #java-help
Issues with Contract Work Percentage Constraint in Employee Scheduling
Hmm I am not sure how that'd be done. Any suggestions?
154 replies
JCHJava Community | Help. Code. Learn.
•Created by dghf on 3/19/2025 in #java-help
Issues with Contract Work Percentage Constraint in Employee Scheduling
@dan1st | Daniel
154 replies
JCHJava Community | Help. Code. Learn.
•Created by dghf on 3/19/2025 in #java-help
Issues with Contract Work Percentage Constraint in Employee Scheduling
Like why do we subtract 0.0001 from
desiredHours
?154 replies
JCHJava Community | Help. Code. Learn.
•Created by dghf on 3/19/2025 in #java-help
Issues with Contract Work Percentage Constraint in Employee Scheduling
Yeah
154 replies
JCHJava Community | Help. Code. Learn.
•Created by dghf on 3/19/2025 in #java-help
Issues with Contract Work Percentage Constraint in Employee Scheduling
But why
return totalWorkedHours.toHours() < desiredHours - 0.0001
154 replies
JCHJava Community | Help. Code. Learn.
•Created by dghf on 3/19/2025 in #java-help
Issues with Contract Work Percentage Constraint in Employee Scheduling
I think return totalWorkedHours.toHours() < desiredHours should be okwe've tried this but it didn't work
154 replies
JCHJava Community | Help. Code. Learn.
•Created by dghf on 3/19/2025 in #java-help
Issues with Contract Work Percentage Constraint in Employee Scheduling
Yeah, but do you know what could be the issue instead? Should we do more logging somewhere to see what could be causing the issue along the way?
154 replies
JCHJava Community | Help. Code. Learn.
•Created by dghf on 3/19/2025 in #java-help
Issues with Contract Work Percentage Constraint in Employee Scheduling
The problem could lie somewhere in the logic here
(from the OP)
154 replies
JCHJava Community | Help. Code. Learn.
•Created by dghf on 3/19/2025 in #java-help
Issues with Contract Work Percentage Constraint in Employee Scheduling
@dan1st | Daniel But even if we count in minutes instead of hours, shouldn't workpercentage being 0 mean that no shifts are assigned to that particular employee?
154 replies
JCHJava Community | Help. Code. Learn.
•Created by dghf on 3/19/2025 in #java-help
Issues with Contract Work Percentage Constraint in Employee Scheduling
@ayylmao123xdd so doing this?
154 replies
JCHJava Community | Help. Code. Learn.
•Created by dghf on 3/19/2025 in #java-help
Issues with Contract Work Percentage Constraint in Employee Scheduling
@dan1st | Daniel
154 replies
JCHJava Community | Help. Code. Learn.
•Created by dghf on 3/19/2025 in #java-help
Issues with Contract Work Percentage Constraint in Employee Scheduling
@dan1st | Daniel
154 replies
JCHJava Community | Help. Code. Learn.
•Created by dghf on 3/19/2025 in #java-help
Issues with Contract Work Percentage Constraint in Employee Scheduling
The code is using a library called Timefold Solver, which is a constraint solver. It is used for solving planning and scheduling problems by defining constraints and optimizing solutions based on those constraints. The constraints are defined in our
EmployeeSchedulingConstraintProvider
class, using the Timefold Solver's API, which includes classes like ConstraintFactory
, ConstraintCollectors
, and HardSoftBigDecimalScore
. These are used to define and manage constraints for employee scheduling, such as ensuring no overlapping shifts, respecting employee preferences, and balancing shift assignments.154 replies