\n" if $qa->{'debug'}; my $found_section= 0; @@ -526,7 +553,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 +573,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 +594,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 +615,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,17 +652,28 @@ $addcols->({ Total => 0, DoReverse => 1, TotalSubflows => 1 }, qw( %
"; +% my ($c)= qw(40 00)[$_[0]]; +% return " | ||||||||||||||||||||||||||||||||
"; +% }; +% % foreach my $i (0..$#islandids) { - | ||||||||||||||||||||||||||||||||
+<% $tbody->(1) %> + | ||||||||||||||||||||||||||||||||
Start at <% $islandname |h %> + | [what are these codes?] + | % } else { % my $this_dist= $distance->($islandids[$i-1],$islandids[$i]); % $total_dist += $this_dist; + | <%perl> my $total_value= 0; foreach my $sf (@subflows) { @@ -635,12 +690,11 @@ $addcols->({ Total => 0, DoReverse => 1, TotalSubflows => 1 }, qw( <%perl> my $age_reported= 0; my %flowlists; - #print " | |||||||||||||||||||||||||||||
" if $qa->{'debug'}; + #print " | ||||||||||||||||||||||||||||||||
" if $qa->{'debug'};
foreach my $od (qw(org dst)) {
#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'};
@@ -650,6 +704,7 @@ $addcols->({ Total => 0, DoReverse => 1, TotalSubflows => 1 }, qw(
my $price= $f->{"${od}_price"};
my $stallname= $f->{"${od}_stallname"};
my $todo= \$flowlists{$od}{
+ (sprintf "%010d", $f->{'ordval'}),
$f->{'commodname'},
(sprintf "%07d", ($od eq 'dst' ?
9999999-$price : $price)),
@@ -661,6 +716,33 @@ $addcols->({ Total => 0, DoReverse => 1, TotalSubflows => 1 }, qw(
dstArbitrage => 0,
} unless $$todo;
$$todo->{'commodname'}= $f->{'commodname'};
+ $$todo->{'posinclass'}= '';
+ my $incl= $f->{'posinclass'};
+
+ my $findclass= $dbh->prepare(< "
+ .$abbrev." ";
+ }
$$todo->{'stallname'}= $stallname;
$$todo->{Price}= $price;
$$todo->{Timestamp}= $f->{"${od}_timestamp"};
@@ -692,7 +774,7 @@ $addcols->({ Total => 0, DoReverse => 1, TotalSubflows => 1 }, qw(
%perl>
- | <% $xinfo %>
+ | <% $xinfo %>
| <% $totaldesc %>
| <% $totalwas |h %> total
<%perl>
@@ -715,14 +797,15 @@ $addcols->({ Total => 0, DoReverse => 1, TotalSubflows => 1 }, qw(
(Data age: <% prettyprint_age($age) %>)
% } elsif (!defined $total) {
% $total= 0;
- | Total distance: <% $total_dist %> leagues.
+<% $tbody->(1) %> | Total distance: <% $total_dist %> leagues.
| Overall net cash flow
| <%
$total_total < 0 ? -$total_total." loss" : $total_total." gain"
@@ -782,12 +865,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; |