Closed felix91gr closed 4 years ago
Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details.
Hi @felix91gr !
They are FnMut
because you might want to keep a state. For example, you might want to limit the search to a given number of steps, in which case you would make such a test in successors
or success
. You might also want to tweak heuristic
in order to influence the search less and less as it advances if it has not proven to be successful so far.
I hope this answers your question.
@samueltardieu I see, that makes a lot of sense!
And well, since Fn : FnMut
, I guess if one wanted to limit the input functions to be read-only, there is the option to do so, with a wrapper function over astar
that received Fn
types instead of FnMut
. That's actually super nice :)
Thank you, and take care :slightly_smiling_face:
Hi @samueltardieu, long time no see ^^ I hope the global situation is treating you as well as it can. :heart:
I was taking a peek at the docs once again, and the fact that
FnMut
is used inastar
grabbed my attention. Why is it thatsuccessors
,heuristic
andsuccess
have to beFnMut
? Couldn't they be justFn
?Thanks in advance :)