走迷宫机器人程序之1--无智能随机机器人

本文介绍了一个简单的走迷宫程序,该程序采用无智能的随机策略,通过在common.h头文件中定义相关函数和数据结构,并在neural.c文件中实现算法,让机器人在未知环境中随机探索路径。
摘要由CSDN通过智能技术生成

common.h

#ifndef MY_COMMON_H_DEF
#define MY_COMMON_H_DEF

#include <windows.h>
#include<time.h>
#define MAX_COL_WIDTH 10      // the max width of one column
#define DEBUG_MSG 1

typedef struct input_data_tag
{
	unsigned int row_num;
	unsigned int col_num;
	unsigned int col_width;
	char *data_p;
} input_data_t;


void error_output( char *msg );
input_data_t initInputData(char * fname, unsigned int col_width);
void freeInputData(input_data_t *indata_p);

char *getAddress(input_data_t *indata_p, unsigned int col, unsigned int row);

double getActivation( double * xList, unsigned int xCount, double *wList, unsigned int wCount );
double getOutput( const double activation );

int getRand(int mod);

void debug_output( char *msg );

#endif



input.c

#include "common.h"
#includ
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值