91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 25KB
    文件類(lèi)型: .cpp
    金幣: 1
    下載: 1 次
    發(fā)布日期: 2021-08-04
  • 語(yǔ)言: C/C++
  • 標(biāo)簽: A*算法??

資源簡(jiǎn)介

A*算法用于動(dòng)態(tài)路徑規(guī)劃,實(shí)現(xiàn)功能:靜態(tài)復(fù)雜環(huán)境下路徑規(guī)劃;簡(jiǎn)單地對(duì)地圖分析并做出處理決策;動(dòng)態(tài)環(huán)境下路徑規(guī)劃

資源截圖

代碼片段和文件信息

#pragma?once
#include?
#include“resource.h“
#include?
#include?
using?namespace?std;
#define??TWO(ab)??(a<<16)+b
//////////////////////////////////////////
/******************公用數(shù)據(jù)*************/
HMENU?hMenu;
#define?BLACK?4
#define?RED???33
#define?WHITE?0
#define?GREEN?1
#define?BLUE??2
#define?NUM??100
#define?STEP?19?//STEP一點(diǎn)要大于3;
//#define?EDGE?(STEP/2-1)*2+1
struct?Pos
{
int?x;
int?y;
int?prex;
int?prey;
void?mem(){prex=x;prey=y;}
void?now(int?aint?b){x=a;y=b;}
Pos(){x=y=prex=prey=0;}
};
static?int?cxClientcyClientprexpreymap[NUM][NUM]randxrandy;
static?int?countblockxblockyMovePainposMmove[20000]Rmovestepm;
static?int?ijextraxextraydbclckseed;
static?HBRUSH?hBrushwhite_Brushred_Brushgreen_brushblack_Brushblue_Brushyellow_Brush;
static?HPEN?white_penf_pen;
static?char?bu[30]buffer[20000];
static?int?posMAmoveA[20000]RmoveAstepmA;
#define?MOVE?30
#define?RAND?10
#define?RANDA?11
CRITICAL_SECTION?me;
static?BOOL?find;
int?a[8][1];
static?int?Once;
static?int?prxpry;
static?Pos?RTRBLBLTCenterUp[STEP]Down[STEP]Right[STEP]Left[STEP];
///////////////////////////////////////////////////
static?int?x1y1x2y2;
///////////////////////////////////////////////
static?int?startxstartyendxendysavexsavey;
struct?spaylist????????????????
{
int?name_x;
int?name_y;
int?h;
int?g;
int?f;
spaylist?*?father;
spaylist?*?next;
};
static?spaylist?*spd_list;
static?spaylist?*open_list;
static?spaylist?*close_list;
static?spaylist?*temp;
static?spaylist?*ptemp;
static?spaylist?*pSpy;//初始化SPD表
static?spaylist?*pOpen;//初始化OPEN表
static?spaylist?*pClose;//初始化CLOSE表
static?int?klgtempoflagcflag;
/////////////////////////////////////////////////////////////

/*************引用函數(shù)**************************/
void?WINAPI?DrawR(HDC?hdcHBRUSH?hBrushint?aint?b)
{
if(a<0||a>=NUM||b<0||b>=NUM)return;
RECT?temp;
Selectobject(hdchBrush);
temp.left=a*blockx;
temp.top=(b+1)*blocky;
temp.right=(1+a)*blockx;
temp.bottom=b*blocky;
FillRect?(hdc?&temp?hBrush);
}
void?WINAPI?DrawL(HDC?hdcHPEN?hPenint?aint?b)
{
if(a<0||a>=NUM||b<0||b>=NUM)return;
Selectobject(hdchPen);
MoveToEx(hdca*blockx(b+1)*blockyNULL);
LineTo(hdca*blockxb*blocky);
LineTo(hdc(1+a)*blockxb*blocky);
LineTo(hdc(1+a)*blockx(b+1)*blocky);
LineTo(hdca*blockx(b+1)*blocky);
}
//////////////////////////////////////////////////////////////////////////////////////
int?judopen(int?nxint?ny)//判定點(diǎn)是否在OPEN表中
{
spaylist?*q1;
q1=open_list;
if(NULL==q1)return?0;
while((ny?!=?q1->name_y?||?nx?!=?q1->name_x?)&&?q1->next?!=?NULL)q1=q1->next;
if(nx?==?q1->name_x?&&?ny?==?q1->name_y)
{
ptemp=q1;return?1;
}
else
return?0;
}
int?judclose(int?nxint?ny)//判定點(diǎn)是否在CLOSE表中
{

spaylist?*q1;
q1?=?close_list;
while((ny?!=?q1->name_y?||nx?!=?q1->name_x?)&&?q1->next?!=?NULL)q1=q1->next;
if(nx?==?q1->name_x

評(píng)論

共有 條評(píng)論