chiark / gitweb /
Fix up so hold status report still works if no capacity limit
[ypp-sc-tools.web-live.git] / yarrg / web / routetrade
index 05294b5503ce8bbd8d81319451b686e38f1e1304..ee1141a3965c73d2672c81ff9c93cd3f4bb0bb00 100644 (file)
@@ -324,7 +324,7 @@ foreach my $f (@flows) {
                my $first= $base;
                do {
                        my $this= $uue % $base;
-print STDERR "uue=$uue this=$this ";
+#print STDERR "uue=$uue this=$this ";
                        $uue -= $this;
                        $uue /= $base;
                        $this += $first;
@@ -332,8 +332,8 @@ print STDERR "uue=$uue this=$this ";
                        $cmpu .= chr($this + ($this < 26 ? ord('a') :
                                              $this < 52 ? ord('A')-26
                                                         : ord('0')-52));
-print STDERR " uue=$uue this=$this cmpu=$cmpu\n";
-die "$cmpu $uue ?" if length $cmpu > 20;
+#print STDERR " uue=$uue this=$this cmpu=$cmpu\n";
+                       die "$cmpu $uue ?" if length $cmpu > 20;
                } while ($uue);
                $cmpu;
        } @uid;
@@ -450,9 +450,9 @@ foreach my $ci (0..($#islandids-1)) {
                next unless @relsubflow;
                die unless @relsubflow == 1;
                push @rel_subflows, @relsubflow;
-print " RELEVANT $ci $relsubflow[0]->{Var} ";
+#print " RELEVANT $ci $relsubflow[0]->{Var} ";
        }
-print " RELEVANT $ci COUNT ".scalar(@rel_subflows)."  ";
+#print " RELEVANT $ci COUNT ".scalar(@rel_subflows)."  ";
        if (!@rel_subflows) {
                foreach my $mv (qw(mass volume)) {
                        $sail_total[$ci]{$mv}= 0;
@@ -462,12 +462,12 @@ print " RELEVANT $ci COUNT ".scalar(@rel_subflows)."  ";
 
        my $applylimit= sub {
                my ($mv, $max, $f2val) = @_;
-               return unless defined $max;
-print " DEFINED MAX $mv $max ";
+               $max= 1e9 unless defined $max;
+#print " DEFINED MAX $mv $max ";
                $cplex .= "
    ". sprintf("%-10s","${mv}_$ci:")." ".
                join(" + ", map {
-print " PART MAX $_->{Var} $_->{Flow}{Ix} ";
+#print " PART MAX $_->{Var} $_->{Flow}{Ix} ";
                        $f2val->($_->{Flow}) .' '. $_->{Var};
                } @rel_subflows).
                " <= $max";