Bugzilla – Attachment 164968 Details for
Bug 35826
Optimize building of holds queue based on transport cost matrix
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35826: Make copy of cost matrix when substituting inf
Bug-35826-Make-copy-of-cost-matrix-when-substituti.patch (text/plain), 1.90 KB, created by
Andreas Jonsson
on 2024-04-16 21:22:53 UTC
(
hide
)
Description:
Bug 35826: Make copy of cost matrix when substituting inf
Filename:
MIME Type:
Creator:
Andreas Jonsson
Created:
2024-04-16 21:22:53 UTC
Size:
1.90 KB
patch
obsolete
>From 5a1e58432d1f4a2b224480b88f0937f17919e79a Mon Sep 17 00:00:00 2001 >From: Andreas Jonsson <andreas.jonsson@kreablo.se> >Date: Wed, 13 Mar 2024 12:09:39 +0100 >Subject: [PATCH] Bug 35826: Make copy of cost matrix when substituting inf > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > C4/HoldsQueue.pm | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > >diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm >index 10f4509166..e1d44ecf0f 100644 >--- a/C4/HoldsQueue.pm >+++ b/C4/HoldsQueue.pm >@@ -556,22 +556,24 @@ RETRY: > # end. > $inf = $max * $num_tasks + 1; > >+ my @m0 = map {[(undef) x $num_tasks]} (1..$num_agents); > for ( my $i = 0 ; $i < $num_agents ; $i++ ) { > for ( my $j = 0 ; $j < $num_tasks ; $j++ ) { > if ( $m[$i][$j] < 0 ) { >- > # Bias towards not allocating items to holds closer to > # the end of the queue in the queue if not all holds > # can be filled by representing infinity with > # different values. >- $m[$i][$j] = $inf + ( $num_tasks - $j ); >+ $m0[$i][$j] = $inf + ( $num_tasks - $j ); >+ } else { >+ $m0[$i][$j] = $m[$i][$j]; > } > } > } > > my $res = [ (undef) x $num_agents ]; > >- Algorithm::Munkres::assign( \@m, $res ); >+ Algorithm::Munkres::assign( \@m0, $res ); > > my @unallocated = (); > @allocated = (); >@@ -584,7 +586,7 @@ RETRY: > # allocated to nonexisting items ($j >= 0). We just ignore these. > next; > } >- if ( $m[$i][$j] > $max ) { >+ if ( $m0[$i][$j] > $max ) { > > # No finite cost item was assigned to this hold. > push @unallocated, $j; >-- >2.39.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35826
:
161373
|
161956
|
163017
|
163018
|
163107
|
163641
|
163642
|
163643
|
163644
|
163645
|
164501
|
164502
|
164503
|
164504
|
164505
|
164964
|
164965
|
164966
|
164967
| 164968