Skip to content

Commit

Permalink
Removed a 'preserved first attempt'; it's in the Version Control now
Browse files Browse the repository at this point in the history
  • Loading branch information
vanschelven committed Nov 1, 2017
1 parent b2c7eff commit ae54332
Showing 1 changed file with 0 additions and 47 deletions.
47 changes: 0 additions & 47 deletions dsn/form_analysis/loosely_coupled.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,50 +187,3 @@ def do_upwards_analysis(analysis, node, current_time, other_stuff_here_perhaps):
node.recursive_times[analysis.name] = current_time

return output, change_at_present_level, any_lower_level_change


# Below is preserved a first attempt, trying to do the 3 different directions in a single function. This creates a (too)
# great number of if-statements;

def do_some_analysis(analysis, node, current_time):
analysis # :: full analysis? why not :-D

# hmmm.... something about selectiveness?!
# such selectiveness is only relevant on the way down, but it's relevant for both algos
# what do I mean by that?

# For upwards analysis: on the way down (pre-analysis) we must go down only into relevant areas.
# For downwards analysis: to determine what points to start.
# For non-self-referential analysis: to determine which points to do at all.

# The marking of this information could be done "on the way back up", for _all_ of the 3 kinds of analyses.

# Shall I write it as a single thing straight away?

# TODO: make .name a property of analysis

dependencies_are_reason_to_descend = False
for a_name in analysis.dependencies:
if node.recursive_times[a_name] == current_time:
dependencies_are_reason_to_descend = True
break

dependencies_are_reason_for_work_at_this_level = False
for a_name in analysis.dependencies:
if node.analysed_stuff[a_name].time == current_time:
dependencies_are_reason_for_work_at_this_level = True
break

if analysis.direction in [DOWN, NONE]:
# NONE: arbitrarily chosen to be pre-order; we might just as well pick post-order, as long as we pick either.

if dependencies_are_reason_for_work_at_this_level:
output = analysis.f(fill_in_the_dots) # NOTE: this differs between (DOWN, NONE)

change_at_present_level = node.update(analysis.name, output, current_time)

for child in node.children:
if analysis.direction == DOWN:
asdf

recursive_result = do_some_analysis(analysis, child, current_time)

0 comments on commit ae54332

Please sign in to comment.