📄 learnview.h
字号:
// LearnView.h : interface of the CLearnView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_LEARNVIEW_H__4C6E8BFF_CD01_4D96_B485_C41415180135__INCLUDED_)
#define AFX_LEARNVIEW_H__4C6E8BFF_CD01_4D96_B485_C41415180135__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CLearnView : public CView
{
protected: // create from serialization only
CLearnView();
DECLARE_DYNCREATE(CLearnView)
// Attributes
public:
CLearnDoc* GetDocument();
struct QValue
{
double Q[17][6];
};
int trd_numB,trd_numG,trd_numR;
double Qsa[17][6];
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CLearnView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual void OnInitialUpdate();
protected:
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
//}}AFX_VIRTUAL
// Implementation
public:
int Blzm(double all,double qf);
void StopTest();
void Robot();
void OnWall(int wall);
void OnRead();
void OnSave();
double reward(double rwd);
void Action(int A_num);
void Sta2Action(int n);
// CClientDC dc(this);
double Qvamax;
int qq;
double Q[100];
int test1,test2,test3,Bit_color,num0,flag0,flag1,first,flag_dis,flag_num,flag_Timer;
unsigned int bushu0;
double x,x0,xp1,xp2,yp1,yp2,y0,y,y2,R_Angle,x1,y1,x2,di,Pi,buchang;
double Ang1,Ang2,R_z,R_k,R_s; //R_z:机器人运动斜率,,R_k://斜率弧度值
double MidValue,dis2;
COLORREF color1,color2,trd0,trd1,trd2,trd3,trd4,trd5,trd6;
CString str,str_all;
double sta[16][6];//状态存储
int mapnum;//地图编号
int ydsign;//向左向右障碍物的标志,1-按下向左按钮,2-按下向右按钮,3-向左移动定时器4-向右定时器
CPoint ydGPoint1[50],ydGPoint2[50],ydRPoint1[50],ydRPoint2[50];//运动障碍物的对角点
int ydGnum,ydRnum;
int Robotvelocity;//机器人运动速度
int ydvelocity; //运动障碍物运动速度
int ColorSignB,ColorSignR,ColorSignG;//检测到的不同颜色的障碍物的标志
int RedColor,GreenColor;
int MouseDown;
bool LeftEnable,RightEnable,StartEnable,PauseEnable;
void DrawPath();
virtual ~CLearnView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CLearnView)
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnMap1();
afx_msg void OnSP();
afx_msg void OnButtonStart();
afx_msg void OnButtonOk();
afx_msg void OnButtonPause();
afx_msg void OnButtonLeft();
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnButtonRight();
afx_msg void OnReleasedcaptureSliderYdvelocity(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnReleasedcaptureSliderRobotvelocity(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnSelchangeComboMap();
afx_msg void OnChangeEditInitx();
afx_msg void OnChangeEditInity();
afx_msg void OnChangeEditGoalx();
afx_msg void OnChangeEditGoaly();
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnupdataLeftButton(CCmdUI *pCmdUI);
afx_msg void OnupdataRightButton(CCmdUI *pCmdUI);
afx_msg void OnupdataStartButton(CCmdUI *pCmdUI);
afx_msg void OnupdataPauseButton(CCmdUI *pCmdUI);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in LearnView.cpp
inline CLearnDoc* CLearnView::GetDocument()
{ return (CLearnDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_LEARNVIEW_H__4C6E8BFF_CD01_4D96_B485_C41415180135__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -