X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=yarrg%2Fweb%2Froutetrade;h=9660094532aa1544fb5db23092546991c098ee75;hb=c98eb3b0720f8194a116aea338fd2d3caa8c7538;hp=72e9bf7a8a96cf706e4557d6fd26cadfb2dfd2e2;hpb=9c3c0cfe4257a1365c8d82ff6f9b7908a4eb74a1;p=ypp-sc-tools.main.git diff --git a/yarrg/web/routetrade b/yarrg/web/routetrade index 72e9bf7..9660094 100644 --- a/yarrg/web/routetrade +++ b/yarrg/web/routetrade @@ -410,11 +410,17 @@ Maximize totalprofit: "; +my %stall_poe_limits; + foreach my $sf (@subflows) { my $eup= $sf->{Flow}{ExpectedUnitProfit}; $eup *= (1.0-$loss_per_delay_slot) ** $sf->{Org}; $cplex .= sprintf " %+.20f %s", $eup, $sf->{Var}; + if ($qa->{ShowStalls}>=2) { + my $stall= $sf->{Flow}{'dst_stallid'}; + push @{ $stall_poe_limits{$stall} }, $sf; + } } $cplex .= " @@ -488,6 +494,24 @@ foreach my $ci (0..($#islandids-1)) { $cplex.= "\n"; } +if ($qa->{ShowStalls}>=2) { + my $stallpoe= $dbh->prepare(< $b } keys %stall_poe_limits) { + $stallpoe->execute($stallid); + my ($lim)= $stallpoe->fetchrow_array(); + $stallpoe->finish(); + $cplex.= " + ". sprintf("%-15s","poe_$stallid:")." ". + join(" + ", map { + sprintf "%d %s", $_->{Flow}{'dst_price'}, $_->{Var}; + } @{ $stall_poe_limits{$stallid} }). + " <= $lim"; + } + $cplex.= "\n"; +} + $cplex.= " Bounds ".(join " @@ -515,7 +539,7 @@ if ($qa->{'debug'}) { my $input= pipethrough_prep(); print $input $cplex or die $!; my $output= pipethrough_run_along($input, undef, 'glpsol', - qw(glpsol --tmlim 2 --memlim 5 --intopt --cuts --bfs + qw(glpsol --tmlim 5 --memlim 5 --intopt --cuts --bfs --cpxlp /dev/stdin -o /dev/stdout)); print "
\n" if $qa->{'debug'};
 	my $found_section= 0;
@@ -644,8 +668,8 @@ Generated by YARRG at <%
 %	if (!$i) {
 
 Start at <% $islandname |h %>
-[?]
-
+[what are these codes?]
+
 %	} else {
 %		my $this_dist= $distance->($islandids[$i-1],$islandids[$i]);
 %		$total_dist += $this_dist;
@@ -710,9 +734,9 @@ END
 				$desc.= (sprintf ", commodity %d of %d",
 					$incl, $maxpic);
 				if ($classinfo->{'maxposinclass'} >= 8) {
-					my @tmbs= qw(tt t m b bb);
+					my @tmbs= qw(0 1 2 3 4 5 6 7 8 9);
 					my $tmbi= ($incl+0.5)*$#tmbs/$maxpic;
-					$abbrev.= " ".$tmbs[$tmbi];
+					$abbrev.= " ".$tmbs[$tmbi]." ";
 				}
 			}
 			$$todo->{'posinclass'}=