Question on the EfficientIngredientStrategy.java
Hello @martinezmatias.
When we are using a default setting of jgenprog, the default IngredientSearchStrategy is EfficientIngredientStrategy. I have a question on the algorithm of the EfficientIngredientStrategy.
An EfficientIngredientStrategy's main purpose is to cache previously used ingredient w.r.t. the modification point and the operator.
A field appliedCache is a map whose key is a unique string of (modification point, operator) tuple and the value is ingredient code. It stores previously used ingredient code on the specific (modification point, operator) tuple and prevents not to try that ingredient again.
Let's say an action A and B refers to:
A: try to use ingredient Ing1 on the modification point M1 with an operator O1,
B: try to use ingredient Ing2 on the modification point M2 with an operator O2.
Even though a program variant which applies an action A on the original program failed to fix, applying an action A may succeed to fix if it is applied after action B applied to the original program.
- original program --applyA--> program variant1 (failed)
- original program --applyB--> --applyA--> program variant2 (may succeed)
However, it seems that the current implementation of the EfficientIngredientStrategy doesn't give a next chance to an action to be applied which has been previously failed. It's because the appliedCache only concerns the current modification point and the operator but not the change of the context of other modification point the program variant has.
Do I understand the algoirhtm of EfficientIngredientStrategy correctly? Is the problem I proposed is real? Or do I misunderstand sth?
- Sincerely, Seongmin Lee