Skip to content

Commit

Permalink
oops, don't automatically mixin path analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
palvaro committed Dec 4, 2011
1 parent 844302e commit 19badd9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
3 changes: 0 additions & 3 deletions lib/bud.rb
Expand Up @@ -74,9 +74,6 @@ module Bud
attr_accessor :stratum_collection_map, :rewritten_strata, :no_attr_rewrite_strata
attr_accessor :metrics

include MetaAlgebra
include MetaReports

# options to the Bud runtime are passed in a hash, with the following keys
# * network configuration
# * <tt>:ip</tt> IP address string for this instance
Expand Down
16 changes: 5 additions & 11 deletions lib/bud/viz_util.rb
Expand Up @@ -76,26 +76,19 @@ def graph_from_instance(bud_instance, viz_name, output_base, collapse=true, fmt=
tabinf[tab] = t[1].class.to_s
end

begins = {}
bud_instance.a_preds.each do |b|
begins[:start] ||= {}
begins[:start][b.path.split("|").last] = b.fullpath.split("|").last
begins[:finish] = {}
begins[:finish][b.fullpath.split("|").last] = true
end

begins = get_paths(bud_instance)
bit = bud_instance.builtin_tables
VizUtil.ma_tables.each_pair{|k, v| bit[k] = v}

write_graphs(tabinf, bit, bud_instance.t_cycle,
bud_instance.t_depends, bud_instance.t_rules, viz_name,
output_base, fmt, collapse, bud_instance.meta_parser.depanalysis, -1, nil,
get_labels(bud_instance), get_paths(bud_instance))

return begins
get_labels(bud_instance), begins)
begins
end

def get_paths(bud_instance)
return {} unless bud_instance.respond_to? :a_preds
begins = {}
bud_instance.a_preds.each do |b|
begins[:start] ||= {}
Expand All @@ -107,6 +100,7 @@ def get_paths(bud_instance)
end

def get_labels(bud_instance)
return {} unless bud_instance.respond_to? :lps
# sort the paths. sort the paths to the same destination by length.
aps = {}
ap_interm = bud_instance.lps.sort do |a, b|
Expand Down
5 changes: 4 additions & 1 deletion test/tc_meta.rb
Expand Up @@ -113,6 +113,9 @@ class TestStratTemporal

class Divergence
include Bud

include MetaAlgebra
include MetaReports

state do
interface input, :cli1, [:data]
Expand Down Expand Up @@ -281,7 +284,7 @@ def test_underspecified
def test_temporal_strat
t = TestStratTemporal.new

assert_equal(4, t.strata.length)
assert_equal(3, t.strata.length)
t.tick
assert_equal([["xyz", 1], ["xyz", 2], ["xyz", 3]], t.foo_persist.to_a.sort)
t.tick
Expand Down

0 comments on commit 19badd9

Please sign in to comment.