Skip to content
This repository was archived by the owner on Jul 17, 2024. It is now read-only.

print(ScoreAnalysis): make it easy to analyze a score during POC #76

Closed
ge0ffrey opened this issue Jun 16, 2024 · 2 comments · Fixed by #105
Closed

print(ScoreAnalysis): make it easy to analyze a score during POC #76

ge0ffrey opened this issue Jun 16, 2024 · 2 comments · Fixed by #105
Assignees

Comments

@ge0ffrey
Copy link
Contributor

ge0ffrey commented Jun 16, 2024

print() is great during POC
ScoreAnalysis and ConstraintAnalysis should work will it wel

Blocked by TimefoldAI/timefold-solver#883
This should work well in Java too.

Current status:

print(score_analysis)
<timefold.solver.score._score_analysis.ScoreAnalysis object at 0x1049ff350>

    print(score_analysis.constraint_map)
    
{ConstraintRef(package_name='org.jpyinterpreter.user.employee_scheduling.domain', constraint_name='Desired day for employee'): <timefold.solver.score._score_analysis.ConstraintAnalysis object at 0x1049b6fc0>, ConstraintRef(package_name='org.jpyinterpreter.user.employee_scheduling.domain', constraint_name='Undesired day for employee'): <timefold.solver.score._score_analysis.ConstraintAnalysis object at 0x17eddc440>, ConstraintRef(package_name='org.jpyinterpreter.user.employee_scheduling.domain', constraint_name='At least 10 hours between 2 shifts'): <timefold.solver.score._score_analysis.ConstraintAnalysis object at 0x17eddc110>, ConstraintRef(package_name='org.jpyinterpreter.user.employee_scheduling.domain', constraint_name='Max one shift per day'): <timefold.solver.score._score_analysis.ConstraintAnalysis object at 0x17eddc200>, ConstraintRef(package_name='org.jpyinterpreter.user.employee_scheduling.domain', constraint_name='Missing required skill'): <timefold.solver.score._score_analysis.ConstraintAnalysis object at 0x17eddc350>, ConstraintRef(package_name='org.jpyinterpreter.user.employee_scheduling.domain', constraint_name='Overlapping shift'): <timefold.solver.score._score_analysis.ConstraintAnalysis object at 0x17eddc380>, ConstraintRef(package_name='org.jpyinterpreter.user.employee_scheduling.domain', constraint_name='Unavailable employee'): <timefold.solver.score._score_analysis.ConstraintAnalysis object at 0x17eddc2f0>}

Desired: I want to know how many overlapping shifts there are, at which impact weight. Pretty printed (see ScoreExplanation docs)

@ge0ffrey
Copy link
Contributor Author

Also MatchAnalysis should have good toString()

print(f'      {match}')

INFO:app:    16 matches: At least 10 hours between 2 shifts = -9600hard/0soft
INFO:app:      <timefold.solver.score._score_analysis.MatchAnalysis object at 0x17731ddc0>
INFO:app:      <timefold.solver.score._score_analysis.MatchAnalysis object at 0x1023597f0>

@ge0ffrey
Copy link
Contributor Author

Probably needs an upstream fix?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants