\n" if $qa->{'debug'}; my $found_section= 0; @@ -526,7 +550,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; @@ -546,8 +570,8 @@ if ($qa->{'debug'}) { my ($varname, $qty) = m/^ \s* \d+ \s+ (\w+) \s+ (?: [A-Z*]+ \s+ )? - ([0-9.]+) \s - /x or die "$_ ?"; + ([+-e0-9.]+) \s + /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; @@ -567,6 +591,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 { @@ -587,16 +612,32 @@ $addcols->({ Total => 0, DoReverse => 1, TotalSubflows => 1 }, qw( % } # ========== OPTIMISATION ========== +% if (!printable($m)) {Contents
+Generated by YARRG at <% + sprintf "%04d-%02d-%02d %02d:%02d:%02d UTC", + $tl[5]+1900, @tl[4,3,2,1,0] + |h %>. +% } % if ($optimise) { # ========== TRADING PLAN ========== % @@ -608,9 +649,16 @@ $addcols->({ Total => 0, DoReverse => 1, TotalSubflows => 1 }, qw( %
"; +% my ($c)= qw(40 00)[$_[0]]; +% return " | |||||||||||||
"; +% }; +% % foreach my $i (0..$#islandids) { - | |||||||||||||
% $iquery->execute($islandids[$i]); % my ($islandname) = $iquery->fetchrow_array(); @@ -640,7 +688,6 @@ $addcols->({ Total => 0, DoReverse => 1, TotalSubflows => 1 }, qw( #print " [[ i $i od $od " if $qa->{'debug'}; foreach my $sf (@subflows) { my $f= $sf->{Flow}; - next if $f->{Suppress}; next unless $sf->{ucfirst $od} == $i; #print " FLOW $f->{Ix} SUB #$sf->{Org}..$sf->{Dst} " # if $qa->{'debug'}; @@ -715,12 +762,12 @@ $addcols->({ Total => 0, DoReverse => 1, TotalSubflows => 1 }, qw( (Data age: <% prettyprint_age($age) %>) % } elsif (!defined $total) { % $total= 0; - | |||||||||||||
Total distance: <% $total_dist %> leagues. | Overall net cash flow | <%
@@ -782,12 +829,59 @@ Expected average profit:
%
% } # ========== TRADING PLAN ==========
-% my %ts_sortkeys;
-% {
+% if (!printable($m)) {
+Data age summary+<%perl> + my $sth_i= $dbh->prepare(<+&> +% } + +% if (!printable($m)) { +% my %ts_sortkeys; +% { % my $cdspan= $qa->{ShowStalls} ? ' colspan=2' : ''; % my $cdstall= $qa->{ShowStalls} ? ' Stall | ' : '';
Relevant trades-
+% } # !printable + <%init> use CommodsWeb; use Commods; |