📄 zone.h
字号:
/* YAKS, a Khepera simulator including a separate GA and ANN (Genetic Algoritm, Artificial Neural Net). Copyright (C) 2000 Johan Carlsson (johanc@ida.his.se) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */#ifndef ZONE_H#define ZONE_H#include <stdio.h>#include "param.h"#include "geom.h"/** * \class Zone zone.h * @brief Implements round zones that can detect if a robot is in them. * * The Zone keeps count of the number of visits that a robot does. * A Zone is round and thus has a center and a radius, zones can have different * radius. Each zone is uique in that way - if specified the environment can * emulate a ground sensor that detects if the robot is in a zone. The sensor * is binary in that sense that it will return 1.0 if the robot is in a zone * otherwise zero. The definition of where in the input array you can find * the groundsensor is defined in param.h . * @see param.h */class Zone{ public: Zone(FILE *fp); Zone(char *str); ~Zone(); /** The \a x coordinate of the zones center */ float x; /** The \a y coordinate of the zones center */ float y; /** The radius of the zone. */ float r; int inZone(float xp, float yp,int robotNr); void clearVisit(); int visits(int robotNr); private: /** The internal record of the number of visits a robot has done. */ int *visit; };#endif /* ZONE_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -