From ba117b2a7d73eae16ad76edf42ebf7e7c93f282a Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 4 Oct 2009 22:46:08 +0100 Subject: [PATCH] Show expected profit in voyage trading plan --- yarrg/web/routetrade | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/yarrg/web/routetrade b/yarrg/web/routetrade index d7679f8..f9ebfea 100644 --- a/yarrg/web/routetrade +++ b/yarrg/web/routetrade @@ -57,6 +57,7 @@ my $now= time; my @flow_conds; my @query_params; my %dists; +my $expected_total_profit; my $sd_condition= sub { my ($bs, $ix) = @_; @@ -526,6 +527,9 @@ if ($qa->{'debug'}) { $found_section= 1; next; } + if (m/^Objective:\s+totalprofit = (\d+\.\d*) /) { + $expected_total_profit= $1; + } next unless $found_section==1; if (!length $continuation) { next if !$continuation && m/^[- ]+$/; @@ -876,6 +880,9 @@ $addcols->({ Total => 0, DoReverse => 1, TotalSubflows => 1 }, qw( %> <& query_age:dataages, id2age => \%da_ages &> +Expected average profit: + approx. <% sprintf "%d", $expected_total_profit %> poe + (considering expected losses, but ignoring rum consumed) % % } # ========== TRADING PLAN ========== -- 2.30.2