Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue in __calc_paths and added __calc_path_preference() to the init #53

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

eminberker
Copy link

@eminberker eminberker commented Jun 19, 2024

My proposed changes are twofold:

(1) One line we have path = [] # start a new path, meaning the end of a path is reached and the list is reset. However this only gets implemented if the if statement on 291 is true. If this if statmenent is false, the recursive call gives us subpaths, and all the current path+subpaths are added. However, path = [] is never called, even though the for loop in line 287 is about to start a new iteration (to calculate paths through a new candidate). This results in incorrect paths (I have checked). Moving path = [] outside the if statement makes sure that the path is reset before every iteration of the for loop.

(2) __calc_path_preference function is defined but never ran in profile.py. Since this is a static function, it cannot be called from an instance of Profile. This results in profile. path_preference_graph to always be an empty list. We could just copy and paste the same method to our rule, but this would cause a lot of time (and would be repeated every time the method is called). It is much more efficient if this method is called upon initialization, as (I believe) originally intended.

My proposed changes are twofold:

(1) One line we have path = []  # start a new path, meaning the end of a path is reached and the list is reset. However this only gets implemented if the if statement on 291 is true. If this if statmenent is false, the recursive call gives us subpaths, and all the current path+subpaths are added. However, path = [] is never called, even though the for loop in line 287 is about to start a new iteration (to calculate paths through a new candidate). This results in incorrect paths (I have checked). Moving path = [] outside the if statement makes sure that the path is reset before every iteration of the for loop.

2) __calc_path_preference function is defined but never ran in profile.py. Since this is a static function, it cannot be called from an instance of Profile. This results in profile. path_preference_graph to always be an empty list. We could just copy and paste the same method to our rule, but this would cause a lot of time (and would be repeated every time the method is called). It is much more efficient if this method is called upon initialization, as (I believe) originally intended.
@eminberker eminberker changed the title Fixed issue __calc_paths and added __calc_path_preference() to the init Fixed issue in __calc_paths and added __calc_path_preference() to the init Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant