请解释"爬山"和"贪婪"算法之间的区别.
看起来两者都很相似,我怀疑"爬山"是一种算法; 这似乎是一种优化.它是否正确?
我在C#中有这样的代码:
namespace WumpusWorld
{
class PlayerAI
{
//struct that simulates a cell in the AI replication of World Grid
struct cellCharacteristics
{
public int pitPercentage;
public int wumpusPercentage;
public bool isPit;
public bool neighborsMarked;
public int numTimesvisited;
}
private cellCharacteristics[,] AIGrid; //array that simulates World Grid for the AI
private enum Move { Up, Down, Right, Left, Enter, Escape }; //enum that represents integers that trigger movement in WumpusWorldForm class
Stack<int> returnPath; //keeps track of each move of AI to …Run Code Online (Sandbox Code Playgroud) 有人可以教我如何使用F#从给定数据制作树吗?例如:数字列表或城市名称列表等.我没有任何线索如何在F#中制作树,需要帮助:)
例如:输入来自运行时,假设它来自文本文件:城市的列表名称
输出结果:图形