chiark / gitweb /
routetrade: WIP fix unticked trades
[ypp-sc-tools.main.git] / yarrg / web / routetrade
index 68f9d2703bd4c97ab8d4bd115a01be6ffae1bd9f..5dc5e774a40f8c839a26ef28c75d8c6b9bc7b31a 100644 (file)
@@ -424,7 +424,7 @@ foreach my $flow (@flows) {
        if ($flow->{Suppress}) {
                foreach my $sf (@{ $flow->{Subflows} }) {
                        $cplex .= "
-   $sf->{Var} = 0";
+   $sf->{Var} = 0\n";
                }
                next;
        }
@@ -533,7 +533,7 @@ if ($qa->{'debug'}) {
                        $found_section= 1;
                        next;
                }
-               if (m/^Objective:\s+totalprofit = (\d+\.\d*) /) {
+               if (m/^Objective:\s+totalprofit = (\d+(?:\.\d*)?) /) {
                        $expected_total_profit= $1;
                }
                next unless $found_section==1;
@@ -554,7 +554,7 @@ if ($qa->{'debug'}) {
                        \s* \d+ \s+
                        (\w+) \s+ (?: [A-Z*]+ \s+ )?
                        ([0-9.]+) \s
-                       /x or die "$_ ?";
+                       /x or die "$cplex \n==\n $glpsol_out $_ ?";
                if ($varname =~ m/^f(\d+)s(\d+)_/) {
                        my ($ix,$orgix) = ($1,$2);
                        my $flow= $flows[$ix] or die;
@@ -574,6 +574,7 @@ if ($qa->{'debug'}) {
        my $prerr= "\n=====\n$cplex\n=====\n$glpsol_out\n=====\n ";
        pipethrough_run_finish($output,$prerr);
        map { defined $_->{OptQty} or die "$prerr $_->{Flow}{Ix}" } @subflows;
+       defined $expected_total_profit or die "$prerr ?";
 };
 
 $addcols->({ DoReverse => 1, TotalSubflows => 1, Special => sub {