You can find a good understatement of the mountain climbing algorithm in this book. Artificial Intelligence - A Modern Approach . This book also has a code repository, here you can find it.
And here is the implementation of HillClimbing (HillclimbingSearch.java) in java. But for this java file you need to import another source file. This is better if you look at the code repository. In this class, you have a public search () method -
public List<Action> search(Problem p){}
From the signature of the method, you can see that this method requires Problem p and returns a List of Action . To get these Problem and Action , you must use aima .
You can find some more explanations about stochastic hill climbing here.
Hope this helps.
Many thanks.
Razib source share