chiark / gitweb /
WIP routesearch; change LP variable names in routetrade to be more like those in...
authorIan Jackson <ian@liberator.(none)>
Sat, 3 Oct 2009 20:38:21 +0000 (21:38 +0100)
committerIan Jackson <ian@liberator.(none)>
Sat, 3 Oct 2009 20:38:21 +0000 (21:38 +0100)
yarrg/web/routetrade

index d90bf40..d7679f8 100644 (file)
@@ -292,7 +292,11 @@ foreach my $f (@flows) {
                        Flow => $f,
                        Org => $sfi->[0],
                        Dst => $sfi->[1],
-                       Var => sprintf "f%ss%s", $f->{Ix}, $sfi->[0]
+                       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;
@@ -420,10 +424,9 @@ foreach my $flow (@flows) {
        }
        foreach my $od (qw(org dst)) {
                my $limname= join '_', (
-                       'avail',
-                       $flow->{'commodid'},
                        $od,
-                       $flow->{"${od}_id"},
+                       'i'.$flow->{"${od}_id"},
+                       'c'.$flow->{'commodid'},
                        $flow->{"${od}_price"},
                        $flow->{"${od}_stallid"},
                );
@@ -542,7 +545,7 @@ if ($qa->{'debug'}) {
                        (\w+) \s+ (?: [A-Z*]+ \s+ )?
                        ([0-9.]+) \s
                        /x or die "$_ ?";
-               if ($varname =~ m/^f(\d+)s(\d+)$/) {
+               if ($varname =~ m/^f(\d+)s(\d+)_/) {
                        my ($ix,$orgix) = ($1,$2);
                        my $flow= $flows[$ix] or die;
                        my @relsubflow= grep { $_->{Org} == $orgix }