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

Bugfix/matrix utilization #7

Merged
merged 27 commits into from
Oct 24, 2024
Merged

Bugfix/matrix utilization #7

merged 27 commits into from
Oct 24, 2024

Conversation

mjducut-oe
Copy link
Collaborator

PR Overview

Contains fix necessary for the scheduler to be able to read and fetch resource intervals even if they are not continuous.

Summary of updates (per function)

  • TaskAllocator.allocate_task - The original implementation didn’t account for the scenario where both assignments and constraints matrices are present. It only solved the first available matrix (either assignments or constraints) using the or condition. The changes processes both constraints AND assignment matrices before constraints matrix gets trimmed so the values are much closer and will not throw a mismatch error.
  • TaskAllocator._get_resource_intervals - The updated version is more flexible and comprehensive, as it can handle multiple non-contiguous intervals per resource.
  • TaskAllocator._find_indexes - Uses vectorized operations on masked arrays to efficiently detect where the resource becomes available. Now detects both starts and ends of multiple windows using transition logic between masked and unmasked values and comparisons between consecutive values.
  • Matrix.trim_end - Allows differences within an absolute tolerance (atol=1e-8) to enable a more laid-back comparison.
  • HeuristicSolver.solve - Improved flexibility in the second version to handle multiple intervals per resource.

@mjducut-oe mjducut-oe requested a review from Yacobolo October 23, 2024 06:39
@mjducut-oe mjducut-oe merged commit dca690b into main Oct 24, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant