小编Gho*_*ost的帖子

Unicode和Ascii字符是否相同?

什么是unicode字符代码?它们与ascii字符有什么不同?

unicode ascii

35
推荐指数
2
解决办法
5万
查看次数

8拼图有多少种可能的状态?

经典的8拼图属于滑块系列.我的书(人工智能Stuart Russell和peter Norwig的现代方法)说8-puzzle有9个/ 2个可能的状态.但为什么/ 2?你怎么得到这个?

algorithm artificial-intelligence sliding-tile-puzzle

19
推荐指数
1
解决办法
2万
查看次数

分辨率算法如何用于命题逻辑?

我无法理解命题逻辑中的解析规则是什么.解决方案是否只是简单地说明了一个句子可以扩展和以另一种形式书写的规则?
以下是命题逻辑的简单分辨率算法.该函数返回通过解析它的2输入获得的所有可能子句的集合.我无法理解算法的工作原理,有人可以向我解释一下吗?

  function PL-RESOLUTION(KB,?) returns true or false
     inputs: KB, the knowledge base, a sentence ? in propositional logic, the query, a
             sentence in propositional logic 
     clauses <--- the set of clauses in the CNF representation of KB ? ¬?
     new <--- {}
     loop do
        for each Ci, Cj in clauses do
            resolvents <----- PL-RESOLVE(Ci, Cj)
            if resolvents contains the empty clause then return true
            new <--- new ? resolvents
        if new ? clauses then return false
        clauses <---- clauses …
Run Code Online (Sandbox Code Playgroud)

algorithm logic artificial-intelligence

9
推荐指数
1
解决办法
1万
查看次数

DPLL算法如何工作?

我无法理解DPLL算法来检查命题逻辑中句子的可满足性. http://books.google.co.in/books?id=4fyShrIFXg4C&pg=PA250&lpg=PA250&dq=DPLL+algorithm+from+artificial+intelligence+A+modern+approach&source=bl&ots=oOoZsT8KFd&sig=pdmyUsQZZWw76guWY9eFJKyNsH0&hl=en&sa=X&ei=vBFeUOf1EMLrrQeanoG4DQ&ved= 0CD0Q6AEwAw#v = onepage&q&F =假
在此输入图像描述

该算法取自人工智能现代方法.我发现这很多功能递归真的很混乱.特别是,EXTEND()函数做了什么,递归调用的目的是DPLL()什么?

algorithm logic artificial-intelligence

9
推荐指数
2
解决办法
2万
查看次数

Windows API函数声明中的"CALLBACK"是什么意思?

可能重复:
C中的"CALLBACK"声明有什么作用?

WindowProc()函数的原型就是这个

      LRESULT CALLBACK WindowProc(HWND hWnd,UINT message , WPARAM wParan, LPARAM lParam);
Run Code Online (Sandbox Code Playgroud)

但是我从来没有遇到过CALLBACK关键字,我只知道回调函数是你将指针传递给另一个函数的函数,那么这个CALLBACK到底是什么?它做了什么?

windows winapi

8
推荐指数
1
解决办法
9497
查看次数

命题逻辑算法中的混淆

我无法理解以下关于命题逻辑和蕴涵的算法,取自人工智能现代方法一书.

一种用于确定命题蕴涵的真值表枚举算法.TT代表真值表.PL-TRUE?如果句子在模型中保存,则返回true.变量模型仅代表某些变量的部分模型分配.函数调用EXTEND(P,true,model)返回一个新的部分模型,其中P的值为true.

function  TT-ENTAILS? (KB,?) returns  true  or  false
  inputs: KB, the knowledge base, a sentence in propositional logic
           ?, the query, a sentence in propositional logic

symbols <--- a list of the propositional symbols in KB and ?
return TT-CHECK-ALL(KB,?,symbols,[])
Run Code Online (Sandbox Code Playgroud)
function TT-CHECK-ALL(KB,?,symbols,model ) returns true or false
   if EMPTY?(symbols) then
       if PL-TRUE?(KB, model) then return PL-TRUE?(?,model)
       else return true

   else do
       P <---FIRST(symbols); rest <--- REST(symbols)
       return TT-CHECK-ALL(KB,?,rest,EXTEND(P,true,model) and
              TT-CHECK-ALL(KB, ?, rest, EXTEND(P,false,model)
Run Code Online (Sandbox Code Playgroud)

algorithm logic artificial-intelligence

5
推荐指数
1
解决办法
3072
查看次数

Backward Chaining算法如何在一阶逻辑中工作?

在此输入图像描述

我可以得到for each循环的解释,因为它对我没有多大意义.特别是,STANDARDIZE-APART()和第二个最后一行做什么?

是的 FOL_BC_ASK(KB,[p1...,pn|REST(goals)],COMPOSE(@',@)) U ans

algorithm logic

4
推荐指数
1
解决办法
3887
查看次数

如何在C++/CLI中定义字符串数组?

这有什么不对:

我收到所有5个定义的错误:

 error C3698: 'System::String ^' : cannot use this type as argument of 'gcnew'
 error C2512: 'System::String::String' : no appropriate default constructor available    



array<String^>^ arr = gcnew array<String^>
{
    gcnew String^ "Madam I'm Adam.",    
    gcnew String^ "Don't cry for me,Marge and Tina.",   //error C2143: syntax error : missing '}' before 'string'   AND error C2143: syntax error : missing ';' before 'string'
    gcnew String^ "Lid off a daffodil.",
    gcnew String^ "Red lost Soldier.",
    gcnew String^ "Cigar? Toss it in a …
Run Code Online (Sandbox Code Playgroud)

c++-cli visual-studio-2010

3
推荐指数
1
解决办法
4232
查看次数

使用指针功能有什么好处?

使用函数指针而不是函数本身的真正好处是什么?它会使执行更快吗?或者当它传递给另一个函数时它是否提供了便利?

c++ function-pointers visual-c++

3
推荐指数
1
解决办法
4666
查看次数

如何在MFC应用程序中放置一个按钮?

我的mfc程序在客户区域中绘制了以下形状 - 现在我想在其旁边放置一个按钮以重新排列形状.

在此输入图像描述

我知道我可以使用工具栏或菜单按钮,但有没有办法可以在框旁边放置一个按钮?这样的事情:

在此输入图像描述

mfc button visual-c++

2
推荐指数
1
解决办法
1万
查看次数

基类中的私有元素是否会增加派生类的大小?

// inheritence experiment

#include"stdafx.h"
#include<iostream> 

using namespace std;

class base
{
private:
    int i;
};

class derived: public base
{
private:
    int j;
};

int main()
{
    cout << endl << sizeof(derived) << endl << sizeof(base);
    derived o1;
    base o2;
    cout << endl << sizeof(o1) << endl << sizeof(o2); 
}
Run Code Online (Sandbox Code Playgroud)

我得到这个输出:

8
4
8
4

为什么会这样?基类的私有数据成员不会继承到派生类中,那么为什么我得到8个字节,派生的大小和o1?

c++ inheritance

1
推荐指数
1
解决办法
830
查看次数

为什么我不能为基类的成员赋值?

我有一个CPolygon 派生自班级的班级CElement.[我在这里利用多态].

 class CElement : public CObject
 {
 public:
virtual ~CElement();
virtual void Draw(CDC* pDC){};
CPoint vertices[11];

 protected:

CElement();

 };
Run Code Online (Sandbox Code Playgroud)
 class CPolygon : public CElement
 {
 public:
CPolygon(CPoint mFirstPoint,CPoint mSecondPoint);
~CPolygon(void);
 virtual void Draw(CDC* pDC);                 


 protected:
CPoint mStartPoint;
CPoint mEndPoint;
CPolygon(void);


 };
Run Code Online (Sandbox Code Playgroud)

当我尝试将数组分配给verticesCElement对象的成员时,我收到错误:expression must be a modifiable Lvalue

 CElement* a = new CPolygon(mFirstPoint,mSecondPoint);
  a->vertices=vertices;        //here!!
Run Code Online (Sandbox Code Playgroud)

为什么不工作?

c++ polymorphism

1
推荐指数
1
解决办法
88
查看次数