$f->{"Max$v"}= sprintf "%.1f", $f->{"Max${v}SortKey"} * 1e-6;
}
- my $sfis= $ipair2subflowinfs{$f->{'org_id'},$f->{'dst_id'}};
- foreach my $sfi (@$sfis) {
- my $subflow= {
- Flow => $f,
- Org => $sfi->[0],
- Dst => $sfi->[1],
- Var => sprintf "f%ss%s_c%d_p%d_%d_p%d_%d",
- $f->{Ix}, $sfi->[0],
- $f->{'commodid'},
- $sfi->[0], $f->{'org_price'},
- $sfi->[1], $f->{'dst_price'}
- };
- push @{ $f->{Subflows} }, $subflow;
- push @subflows, $subflow;
- }
-
$f->{MarginSortKey}= sprintf "%d",
$f->{'dst_price'} * 10000 / $f->{'org_price'};
$f->{Margin}= sprintf "%3.1f%%",
if (defined $qa->{"R$f->{UidShort}"} &&
!defined $qa->{"T$f->{UidShort}"}) {
$f->{Suppress}= 1;
+ } else {
+ my $sfis= $ipair2subflowinfs{$f->{'org_id'},$f->{'dst_id'}};
+ foreach my $sfi (@$sfis) {
+ my $subflow= {
+ Flow => $f,
+ Org => $sfi->[0],
+ Dst => $sfi->[1],
+ Var => sprintf "f%ss%s_c%d_p%d_%d_p%d_%d",
+ $f->{Ix}, $sfi->[0],
+ $f->{'commodid'},
+ $sfi->[0], $f->{'org_price'},
+ $sfi->[1], $f->{'dst_price'}
+ };
+ push @{ $f->{Subflows} }, $subflow;
+ push @subflows, $subflow;
+ }
}
-
}
</%perl>
my %avail_lims;
foreach my $flow (@flows) {
- if ($flow->{Suppress}) {
- foreach my $sf (@{ $flow->{Subflows} }) {
- $cplex .= "
- $sf->{Var} = 0";
- }
- next;
- }
+ next if $flow->{Suppress};
foreach my $od (qw(org dst)) {
my $limname= join '_', (
$od,
\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;
%
<h2><a name="plan">Voyage trading plan</a></h2>
-<table rules=groups <% printable($m) ? 'width=100%' : '' %> >
+<table class="data" rules=groups <% printable($m) ? 'width=100%' : '' %> >
% my $tbody= sub {
% if (!printable($m)) { return '<tbody>'; }
%# return "<tr><td colspan=7><hr>";
#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'};
% my $cdspan= $qa->{ShowStalls} ? ' colspan=2' : '';
% my $cdstall= $qa->{ShowStalls} ? '<th>Stall</th>' : '';
<h2><a name="trades">Relevant trades</a></h2>
-<table id="trades" rules=groups>
+<table class="data" id="trades" rules=groups>
<colgroup span=1>
<colgroup span=2>
<% $qa->{ShowStalls} ? '<colgroup span=2>' : '' %>
throw => 'trades_sort', tbrow => 'trades_total' &>
ts_sortkeys= <% to_json_protecttags(\%ts_sortkeys) %>;
</&tabsort>
-
+<p>
<input type=submit name=update value="Update">
% } # !printable