I have rule:
best_fit(Team, Enemies, Result, List) :-
findall((H, E), score(H, Enemies, Team, E), List),
where score definition is:
score(Hero, Enemies, Team, Result) :-
hero(Hero),
...
I would like to find only that (H,E) where H is not in Enemies or Team. I tried to later exclude but the results are tuples and it is kind of complicated to make it work. Is there a way to filter it out in findall method? How can I approach this?
You can enforce that in the goal:
So here we modified the goal such that it is satisfied if
score(H, Enemies, Team, E)andHis not a member ofEnemies, andHis not a member ofTeam.