agent.h

来自「行人模拟」· C头文件 代码 · 共 47 行

H
47
字号
//// pedsim - A microscopic pedestrian simulation system. // Copyright (c) 2003 - 2004 by Christian Gloor//                              // You can redistribute and/or modify this program under the terms of// the GNU General Public License.  See copying.txt for details.// #include <iostream>#include <vector>class Tagent { private:  double x,y;  int id;  double vx,vy;  int type;  double energy;  bool dead;
  std::vector<Tagent>::iterator enemynearest;  double enemydist;  double color;  double direction;  double sword;  double swordini; public:  Tagent();  void move(long systemtime);  void setPosition(double px, double py);  void setType(int t) {type = t; };  int getid() { return id; };  int gettype() { return type; };  double getx() { return x; };  double gety() { return y; };  double getdirection() { return direction; };  double getsword() { return sword; };  double getcolor() { return color; };  bool isalive() { return !dead; };  void hit();  void print() {std::cout << "agent " << id << ": " << x << "/" << y << std::endl; };};#define AgentContainer std::vector<Tagent>#define AgentIterator std::vector<Tagent>::iterator

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?