├── ecosystem ├── 2dvis │ ├── images │ │ ├── street.jpg │ │ └── license.txt │ ├── documentation │ │ ├── 2dvis.png │ │ └── 2dvis_metrics.png │ ├── 2dvis.qrc │ ├── mainwindow.h │ ├── metricsfield.h │ ├── metricswidget.h │ ├── chartswidget.h │ ├── chartsfield.h │ ├── globals.cpp │ ├── agent.h │ ├── obstacle.h │ ├── waypoint.h │ ├── mygraphicsview.h │ ├── receiver.h │ ├── globals.h │ ├── messageparser.h │ ├── metricsfield.cpp │ ├── chartswidget.cpp │ ├── item.h │ ├── metricswidget.cpp │ ├── itemcontainer.h │ ├── mygraphicsview.cpp │ ├── receiver.cpp │ ├── item.cpp │ ├── waypoint.cpp │ ├── chartsfield.cpp │ ├── obstacle.cpp │ ├── 2dvis.pro │ ├── itemcontainer.cpp │ ├── agent.cpp │ ├── mainwindow.cpp │ ├── main.cpp │ └── README.md ├── demoapp │ ├── src │ │ ├── images │ │ │ ├── cut.png │ │ │ ├── new.png │ │ │ ├── copy.png │ │ │ ├── open.png │ │ │ ├── paste.png │ │ │ ├── pause.png │ │ │ ├── save.png │ │ │ ├── start.png │ │ │ ├── stop.png │ │ │ ├── zoomin.png │ │ │ ├── backward.png │ │ │ ├── forward.png │ │ │ └── zoomout.png │ │ ├── application.qrc │ │ ├── cell.h │ │ ├── style.h │ │ ├── obstacle.h │ │ ├── cell.cpp │ │ ├── grid.h │ │ ├── config.h │ │ ├── obstacle.cpp │ │ ├── tree.h │ │ ├── loadscene.h │ │ ├── control.h │ │ ├── scene.h │ │ ├── waypoint.h │ │ ├── config.cpp │ │ ├── mainwindow.h │ │ ├── agent.h │ │ ├── waypoint.cpp │ │ ├── src.pro │ │ ├── scene.cpp │ │ ├── grid.cpp │ │ ├── tree.cpp │ │ ├── main.cpp │ │ ├── style.cpp │ │ ├── control.cpp │ │ ├── loadscene.cpp │ │ ├── mainwindow.cpp │ │ └── agent.cpp │ ├── pedsim.pro │ ├── documentation │ │ ├── screenshot.png │ │ ├── 20120204-screenshot-v2-2.png │ │ ├── footer.html │ │ ├── header.html │ │ ├── scenario.dox │ │ └── gui.dox │ ├── scene2.xml │ ├── pedsim.sln │ ├── README.md │ └── scene.xml └── 3dvis │ ├── documentation │ └── 3dvis.png │ ├── 3dvis.pro │ ├── itemagent.h │ ├── itemobstacle.h │ ├── receiver.h │ ├── item.h │ ├── messageparser.h │ ├── item.cpp │ ├── itemcontainer.h │ ├── 3dvis.sln │ ├── itemagent.cpp │ ├── itemobstacle.cpp │ ├── receiver.cpp │ ├── itemcontainer.cpp │ ├── README.md │ ├── main.cpp │ └── 3dvis.vcxproj.filters ├── libpedsim ├── documentation │ ├── title.png │ ├── pedsim-2dvis-example05.png │ ├── pedsim-2dvis-example05-900.png │ ├── 98-contributors.md │ ├── footer.html │ ├── 95-setup.md │ ├── header.html │ ├── xx-examples.dox │ ├── title.tex │ └── 96-windows.md ├── tests │ ├── test_main.cpp │ └── unit │ │ ├── test_Tagent.cpp │ │ └── test_Tvector.cpp ├── ped_includes.h ├── examples │ ├── Example03 │ │ ├── Example03.vcxproj.filters │ │ └── Example03.sln │ ├── example01.cpp │ ├── example02.cpp │ ├── example04.cpp │ ├── example03.cpp │ └── example05.cpp ├── msvc15 │ ├── libpedsim.sln │ └── libpedsim.vcxproj.filters ├── Makefile ├── ped_obstacle.h ├── ped_waypoint.h ├── ped_tree.h ├── ped_vector.h ├── README.md ├── ped_scene.h ├── ped_obstacle.cpp ├── ped_agent.h ├── ped_waypoint.cpp └── ped_outputwriter.h └── README.md /ecosystem/2dvis/images/street.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chgloor/pedsim/HEAD/ecosystem/2dvis/images/street.jpg -------------------------------------------------------------------------------- /libpedsim/documentation/title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chgloor/pedsim/HEAD/libpedsim/documentation/title.png -------------------------------------------------------------------------------- /ecosystem/demoapp/src/images/cut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chgloor/pedsim/HEAD/ecosystem/demoapp/src/images/cut.png -------------------------------------------------------------------------------- /ecosystem/demoapp/src/images/new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chgloor/pedsim/HEAD/ecosystem/demoapp/src/images/new.png -------------------------------------------------------------------------------- /ecosystem/2dvis/documentation/2dvis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chgloor/pedsim/HEAD/ecosystem/2dvis/documentation/2dvis.png -------------------------------------------------------------------------------- /ecosystem/3dvis/documentation/3dvis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chgloor/pedsim/HEAD/ecosystem/3dvis/documentation/3dvis.png -------------------------------------------------------------------------------- /ecosystem/demoapp/src/images/copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chgloor/pedsim/HEAD/ecosystem/demoapp/src/images/copy.png -------------------------------------------------------------------------------- /ecosystem/demoapp/src/images/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chgloor/pedsim/HEAD/ecosystem/demoapp/src/images/open.png -------------------------------------------------------------------------------- /ecosystem/demoapp/src/images/paste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chgloor/pedsim/HEAD/ecosystem/demoapp/src/images/paste.png -------------------------------------------------------------------------------- /ecosystem/demoapp/src/images/pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chgloor/pedsim/HEAD/ecosystem/demoapp/src/images/pause.png -------------------------------------------------------------------------------- /ecosystem/demoapp/src/images/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chgloor/pedsim/HEAD/ecosystem/demoapp/src/images/save.png -------------------------------------------------------------------------------- /ecosystem/demoapp/src/images/start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chgloor/pedsim/HEAD/ecosystem/demoapp/src/images/start.png -------------------------------------------------------------------------------- /ecosystem/demoapp/src/images/stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chgloor/pedsim/HEAD/ecosystem/demoapp/src/images/stop.png -------------------------------------------------------------------------------- /ecosystem/demoapp/src/images/zoomin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chgloor/pedsim/HEAD/ecosystem/demoapp/src/images/zoomin.png -------------------------------------------------------------------------------- /ecosystem/demoapp/src/images/backward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chgloor/pedsim/HEAD/ecosystem/demoapp/src/images/backward.png -------------------------------------------------------------------------------- /ecosystem/demoapp/src/images/forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chgloor/pedsim/HEAD/ecosystem/demoapp/src/images/forward.png -------------------------------------------------------------------------------- /ecosystem/demoapp/src/images/zoomout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chgloor/pedsim/HEAD/ecosystem/demoapp/src/images/zoomout.png -------------------------------------------------------------------------------- /ecosystem/demoapp/pedsim.pro: -------------------------------------------------------------------------------- 1 | 2 | TEMPLATE = subdirs 3 | SUBDIRS = src 4 | 5 | 6 | #CONFIG += ordered 7 | 8 | CONFIG += release 9 | -------------------------------------------------------------------------------- /ecosystem/demoapp/documentation/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chgloor/pedsim/HEAD/ecosystem/demoapp/documentation/screenshot.png -------------------------------------------------------------------------------- /ecosystem/2dvis/documentation/2dvis_metrics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chgloor/pedsim/HEAD/ecosystem/2dvis/documentation/2dvis_metrics.png -------------------------------------------------------------------------------- /libpedsim/documentation/pedsim-2dvis-example05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chgloor/pedsim/HEAD/libpedsim/documentation/pedsim-2dvis-example05.png -------------------------------------------------------------------------------- /ecosystem/2dvis/2dvis.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | images/street.jpg 5 | 6 | -------------------------------------------------------------------------------- /libpedsim/documentation/pedsim-2dvis-example05-900.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chgloor/pedsim/HEAD/libpedsim/documentation/pedsim-2dvis-example05-900.png -------------------------------------------------------------------------------- /ecosystem/2dvis/images/license.txt: -------------------------------------------------------------------------------- 1 | Recource Licenses: 2 | 3 | street.jpg 4 | http://www.123rf.com/stock-photo/asphalt_paving.html 5 | ROYALTY FREE STOCK PHOTOS 6 | 7 | -------------------------------------------------------------------------------- /ecosystem/demoapp/documentation/20120204-screenshot-v2-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chgloor/pedsim/HEAD/ecosystem/demoapp/documentation/20120204-screenshot-v2-2.png -------------------------------------------------------------------------------- /libpedsim/tests/test_main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "gtest/gtest.h" 4 | 5 | GTEST_API_ int main(int argc, char **argv) { 6 | printf("Running main() from gtest_main.cc\n"); 7 | testing::InitGoogleTest(&argc, argv); 8 | return RUN_ALL_TESTS(); 9 | } 10 | -------------------------------------------------------------------------------- /ecosystem/2dvis/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | #include "mygraphicsview.h" 6 | 7 | 8 | class MainWindow : public QMainWindow { 9 | Q_OBJECT 10 | 11 | public: 12 | MainWindow(); 13 | MyGraphicsView *view; 14 | 15 | }; 16 | 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /ecosystem/2dvis/metricsfield.h: -------------------------------------------------------------------------------- 1 | #ifndef METRICSFIELD_H 2 | #define METRICSFIELD_H 3 | 4 | #include 5 | 6 | class MetricsField : public QWidget { 7 | Q_OBJECT 8 | 9 | public: 10 | MetricsField(QString name); 11 | 12 | void update(double value); 13 | 14 | private: 15 | double value; 16 | QLabel *label; 17 | }; 18 | 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /ecosystem/3dvis/3dvis.pro: -------------------------------------------------------------------------------- 1 | 2 | TEMPLATE = app 3 | 4 | QT += 3dcore 3drender 3dinput 3dextras xml network 5 | 6 | SOURCES += \ 7 | main.cpp \ 8 | item.cpp \ 9 | itemagent.cpp \ 10 | itemcontainer.cpp \ 11 | itemobstacle.cpp \ 12 | messageparser.cpp \ 13 | receiver.cpp 14 | 15 | HEADERS += \ 16 | item.h \ 17 | itemagent.h \ 18 | itemcontainer.h \ 19 | itemobstacle.h \ 20 | messageparser.h \ 21 | receiver.h 22 | 23 | -------------------------------------------------------------------------------- /ecosystem/2dvis/metricswidget.h: -------------------------------------------------------------------------------- 1 | #ifndef METRICSWIDGET_H 2 | #define METRICSWIDGET_H 3 | 4 | #include 5 | 6 | class MetricsField; 7 | 8 | class MetricsWidget : public QWidget { 9 | Q_OBJECT 10 | 11 | public: 12 | MetricsWidget(); 13 | 14 | void update(QString name, double value); 15 | void clear(); 16 | 17 | private: 18 | QHash metrics; 19 | QVBoxLayout *layout; 20 | 21 | }; 22 | 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /ecosystem/2dvis/chartswidget.h: -------------------------------------------------------------------------------- 1 | #ifndef CHARTSWIDGET_H 2 | #define CHARTSWIDGET_H 3 | 4 | #include 5 | 6 | class ChartsField; 7 | 8 | class ChartsWidget : public QWidget { 9 | Q_OBJECT 10 | 11 | public: 12 | ChartsWidget(); 13 | 14 | void update(long timestep, QString name, double value); 15 | void clear(); 16 | 17 | private: 18 | QHash charts; 19 | QHBoxLayout *layout; 20 | 21 | }; 22 | 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /libpedsim/ped_includes.h: -------------------------------------------------------------------------------- 1 | // 2 | // pedsim - A microscopic pedestrian simulation system. 3 | // Copyright (c) by Christian Gloor 4 | // 5 | 6 | #ifndef _ped_includes_h_ 7 | #define _ped_includes_h_ 1 8 | 9 | #include "ped_agent.h" 10 | #include "ped_obstacle.h" 11 | #include "ped_waypoint.h" 12 | #include "ped_scene.h" 13 | #include "ped_outputwriter.h" 14 | 15 | namespace Ped { 16 | const double LIBEXPORT LIBPEDSIM_VERSION = 2.4; 17 | } 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /ecosystem/2dvis/chartsfield.h: -------------------------------------------------------------------------------- 1 | #ifndef CHARTSFIELD_H 2 | #define CHARTSFIELD_H 3 | 4 | #include 5 | #include 6 | using namespace QtCharts; 7 | 8 | class ChartsField : public QWidget { 9 | Q_OBJECT 10 | 11 | public: 12 | ChartsField(QString name); 13 | 14 | void update(long timestep, double value); 15 | 16 | private: 17 | double value; 18 | QLineSeries *series; 19 | QChart *chart; 20 | QChartView *chartView; 21 | }; 22 | 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /ecosystem/demoapp/src/application.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/copy.png 4 | images/cut.png 5 | images/new.png 6 | images/open.png 7 | images/paste.png 8 | images/save.png 9 | images/zoomin.png 10 | images/zoomout.png 11 | images/backward.png 12 | images/start.png 13 | 14 | -------------------------------------------------------------------------------- /ecosystem/3dvis/itemagent.h: -------------------------------------------------------------------------------- 1 | // 2 | // pedsim - A microscopic pedestrian simulation system. 3 | // Copyright (c) by Christian Gloor 4 | // 5 | 6 | #ifndef ITEMAGENT_H 7 | #define ITEMAGENT_H 8 | 9 | #include 10 | #include 11 | 12 | #include "item.h" 13 | 14 | //class Item : public QGraphicsItem { 15 | class ItemAgent : public Item { 16 | public: 17 | ItemAgent(Qt3DCore::QEntity *rootEntity); 18 | virtual void updateComponents(); 19 | 20 | 21 | }; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /ecosystem/3dvis/itemobstacle.h: -------------------------------------------------------------------------------- 1 | // 2 | // pedsim - A microscopic pedestrian simulation system. 3 | // Copyright (c) by Christian Gloor 4 | // 5 | 6 | #ifndef ITEMOBSTACLE_H 7 | #define ITEMOBSTACLE_H 8 | 9 | #include 10 | #include 11 | 12 | #include "item.h" 13 | 14 | class ItemObstacle : public Item { 15 | public: 16 | ItemObstacle(Qt3DCore::QEntity *rootEntity, double l); 17 | virtual void updateComponents(); 18 | 19 | private: 20 | double l; 21 | }; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /ecosystem/3dvis/receiver.h: -------------------------------------------------------------------------------- 1 | // 2 | // pedsim - A microscopic pedestrian simulation system. 3 | // Copyright (c) by Christian Gloor 4 | // 5 | 6 | #ifndef RECEIVER_H 7 | #define RECEIVER_H 8 | 9 | #include 10 | 11 | class QLabel; 12 | class QPushButton; 13 | class QUdpSocket; 14 | class QAction; 15 | 16 | class Receiver : public QObject { 17 | Q_OBJECT 18 | 19 | public: 20 | Receiver(int port); 21 | 22 | private slots: 23 | void processPendingDatagrams(); 24 | 25 | private: 26 | QUdpSocket *udpSocket; 27 | }; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /ecosystem/3dvis/item.h: -------------------------------------------------------------------------------- 1 | // 2 | // pedsim - A microscopic pedestrian simulation system. 3 | // Copyright (c) by Christian Gloor 4 | // 5 | 6 | #ifndef ITEM_H 7 | #define ITEM_H 8 | 9 | #include 10 | #include 11 | 12 | class Item : public Qt3DCore::QEntity { 13 | public: 14 | Item(Qt3DCore::QEntity *rootEntity); 15 | virtual void updateComponents(); 16 | 17 | double x; 18 | double y; 19 | double z; 20 | double r; // rotation 21 | 22 | 23 | protected: 24 | Qt3DCore::QTransform *transform; 25 | 26 | }; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /ecosystem/2dvis/globals.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // pedsim - A microscopic pedestrian simulation system. 3 | // Copyright (c) by Christian Gloor 4 | // 5 | 6 | #include "globals.h" 7 | #include 8 | 9 | // ALL THE GLOBAL DEFINITIONS 10 | 11 | 12 | bool g_option_writefile = false; 13 | QString g_option_writefile_directory = "/tmp/"; 14 | 15 | bool g_option_network = false; 16 | int g_option_network_port = 2222; 17 | 18 | bool g_option_file = false; 19 | QString g_option_file_name = "pedsim_out.txt"; 20 | 21 | bool g_option_charts = false; 22 | bool g_option_metrics = false; 23 | -------------------------------------------------------------------------------- /ecosystem/demoapp/src/cell.h: -------------------------------------------------------------------------------- 1 | // 2 | // pedsim - A microscopic pedestrian simulation system. 3 | // Copyright (c) 2003 - 2012 by Christian Gloor 4 | // 5 | 6 | #ifndef _cell_h_ 7 | #define _cell_h_ 1 8 | 9 | #include 10 | 11 | #include 12 | 13 | using namespace std; 14 | 15 | /// \author chgloor 16 | /// \date 2012-02-17 17 | class Cell { 18 | private: 19 | 20 | public: 21 | Cell(double x, double y, double w, double h, QGraphicsScene *l); 22 | QGraphicsScene *graphicsscene; 23 | 24 | vector values; 25 | }; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /ecosystem/2dvis/agent.h: -------------------------------------------------------------------------------- 1 | // 2 | // pedsim - A microscopic pedestrian simulation system. 3 | // Copyright (c) by Christian Gloor 4 | // 5 | 6 | #ifndef AGENT_H 7 | #define AGENT_H 8 | 9 | #include "item.h" 10 | 11 | #include 12 | 13 | class Agent : public Item { 14 | 15 | public: 16 | Agent(); 17 | 18 | QRectF boundingRect() const; 19 | QPainterPath shape() const; 20 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); 21 | 22 | protected: 23 | void advance(int step); 24 | 25 | private: 26 | QColor color; 27 | }; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /ecosystem/demoapp/src/style.h: -------------------------------------------------------------------------------- 1 | // 2 | // pedsim - A microscopic pedestrian simulation system. 3 | // Copyright (c) 2003 - 2012 by Christian Gloor 4 | // 5 | 6 | #ifndef _style_h_ 7 | #define _style_h_ 8 | 9 | #include 10 | #include 11 | 12 | class Style : public QPlastiqueStyle { 13 | Q_OBJECT 14 | 15 | public: 16 | Style(); 17 | ~Style() {}; 18 | 19 | void polish(QPalette &palette); 20 | void drawPrimitive(PrimitiveElement element, const QStyleOption *option, 21 | QPainter *painter, const QWidget *widget) const; 22 | }; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /ecosystem/2dvis/obstacle.h: -------------------------------------------------------------------------------- 1 | // 2 | // pedsim - A microscopic pedestrian simulation system. 3 | // Copyright (c) by Christian Gloor 4 | // 5 | 6 | #ifndef OBSTACLE_H 7 | #define OBSTACLE_H 8 | 9 | #include "item.h" 10 | 11 | #include 12 | 13 | class Obstacle : public Item { 14 | 15 | public: 16 | Obstacle(); 17 | 18 | QRectF boundingRect() const; 19 | QPainterPath shape() const; 20 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); 21 | 22 | protected: 23 | void advance(int step); 24 | 25 | private: 26 | QColor color; 27 | }; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /ecosystem/2dvis/waypoint.h: -------------------------------------------------------------------------------- 1 | // 2 | // pedsim - A microscopic pedestrian simulation system. 3 | // Copyright (c) by Christian Gloor 4 | // 5 | 6 | #ifndef WAYPOINT_H 7 | #define WAYPOINT_H 8 | 9 | #include "item.h" 10 | 11 | #include 12 | 13 | class Waypoint : public Item { 14 | 15 | public: 16 | Waypoint(); 17 | 18 | QRectF boundingRect() const; 19 | QPainterPath shape() const; 20 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); 21 | 22 | protected: 23 | void advance(int step); 24 | 25 | private: 26 | QColor color; 27 | }; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /ecosystem/2dvis/mygraphicsview.h: -------------------------------------------------------------------------------- 1 | // 2 | // pedsim - A microscopic pedestrian simulation system. 3 | // Copyright (c) by Christian Gloor 4 | // 5 | 6 | // inherited from http://www.qtcentre.org/wiki/index.php?title=QGraphicsView:_Smooth_Panning_and_Zooming 7 | 8 | #ifndef MYGRAPHICSVIEW_H 9 | #define MYGRAPHICSVIEW_H 10 | 11 | #include 12 | #include 13 | 14 | class MyGraphicsView : public QGraphicsView { 15 | public: 16 | MyGraphicsView(QGraphicsScene *scene, QWidget* parent = NULL); 17 | 18 | protected: 19 | virtual void wheelEvent(QWheelEvent* event); 20 | 21 | }; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /ecosystem/2dvis/receiver.h: -------------------------------------------------------------------------------- 1 | // 2 | // pedsim - A microscopic pedestrian simulation system. 3 | // Copyright (c) by Christian Gloor 4 | // 5 | 6 | #ifndef RECEIVER_H 7 | #define RECEIVER_H 8 | 9 | #include 10 | 11 | class QLabel; 12 | class QPushButton; 13 | class QUdpSocket; 14 | class QAction; 15 | 16 | class Receiver : public QWidget { 17 | Q_OBJECT 18 | 19 | public: 20 | Receiver(int port, QWidget *parent = 0); 21 | 22 | private slots: 23 | void processPendingDatagrams(); 24 | 25 | private: 26 | QLabel *statusLabel; 27 | QPushButton *quitButton; 28 | QUdpSocket *udpSocket; 29 | }; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /ecosystem/2dvis/globals.h: -------------------------------------------------------------------------------- 1 | // 2 | // pedsim - A microscopic pedestrian simulation system. 3 | // Copyright (c) by Christian Gloor 4 | // 5 | 6 | #ifndef GLOBALS_H 7 | #define GLOBALS_H 8 | 9 | // ALL THE GLOBAL DECLARATIONS 10 | 11 | class QString; 12 | 13 | //extern QString g_some_string; 14 | 15 | extern bool g_option_writefile; 16 | extern QString g_option_writefile_directory; 17 | 18 | extern bool g_option_network; 19 | extern int g_option_network_port; 20 | 21 | extern bool g_option_file; 22 | extern QString g_option_file_name; 23 | 24 | extern bool g_option_charts; 25 | extern bool g_option_metrics; 26 | 27 | 28 | #endif // GLOBALS_H 29 | -------------------------------------------------------------------------------- /ecosystem/2dvis/messageparser.h: -------------------------------------------------------------------------------- 1 | // 2 | // pedsim - A microscopic pedestrian simulation system. 3 | // Copyright (c) by Christian Gloor 4 | // 5 | 6 | #ifndef MESSAGEPARSER_H 7 | #define MESSAGEPARSER_H 8 | 9 | #include 10 | #include 11 | 12 | class MessageParser : public QObject { 13 | Q_OBJECT 14 | 15 | public: 16 | MessageParser(QByteArray datagram); 17 | 18 | public: 19 | void parse(); 20 | 21 | signals: 22 | void updateAgentPosition(int id, double x, double y); 23 | void updateObstaclePosition(int id, double x, double y); 24 | 25 | private: 26 | QDomDocument doc; 27 | 28 | 29 | }; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /ecosystem/3dvis/messageparser.h: -------------------------------------------------------------------------------- 1 | // 2 | // pedsim - A microscopic pedestrian simulation system. 3 | // Copyright (c) by Christian Gloor 4 | // 5 | 6 | #ifndef MESSAGEPARSER_H 7 | #define MESSAGEPARSER_H 8 | 9 | #include 10 | #include 11 | 12 | class MessageParser : public QObject { 13 | Q_OBJECT 14 | 15 | public: 16 | MessageParser(QByteArray datagram); 17 | 18 | public: 19 | void parse(); 20 | 21 | signals: 22 | void updateAgentPosition(int id, double x, double y); 23 | void updateObstaclePosition(int id, double x, double y); 24 | 25 | private: 26 | QDomDocument doc; 27 | 28 | 29 | }; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /ecosystem/2dvis/metricsfield.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "metricsfield.h" 4 | 5 | 6 | MetricsField::MetricsField(QString name) { 7 | value = 0.0; 8 | 9 | 10 | QGroupBox *groupbox = new QGroupBox(name); 11 | label = new QLabel(QString::number(value)); 12 | 13 | QVBoxLayout *vbox = new QVBoxLayout; 14 | vbox->addWidget(label); 15 | groupbox->setLayout(vbox); 16 | 17 | QVBoxLayout *layout; 18 | layout = new QVBoxLayout(); 19 | 20 | layout->addWidget(groupbox); 21 | 22 | setLayout(layout); 23 | 24 | 25 | } 26 | 27 | void MetricsField::update(double pvalue) { 28 | value = pvalue; 29 | label->setText(QString::number(value)); 30 | } 31 | -------------------------------------------------------------------------------- /ecosystem/2dvis/chartswidget.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "chartswidget.h" 4 | #include "chartsfield.h" 5 | 6 | 7 | ChartsWidget::ChartsWidget() { 8 | layout = new QHBoxLayout; 9 | setLayout(layout); 10 | }; 11 | 12 | void ChartsWidget::update(long timestep, QString name, double value) { 13 | if (charts.contains(name)) { 14 | charts[name]->update(timestep, value); 15 | } else { 16 | charts[name] = new ChartsField(name); 17 | layout->addWidget(charts[name]); 18 | } 19 | } 20 | 21 | void ChartsWidget::clear() { 22 | foreach (QWidget* value, charts) { 23 | layout->removeWidget(value); 24 | delete value; 25 | } 26 | charts.clear(); 27 | } 28 | -------------------------------------------------------------------------------- /ecosystem/demoapp/src/obstacle.h: -------------------------------------------------------------------------------- 1 | // 2 | // pedsim - A microscopic pedestrian simulation system. 3 | // Copyright (c) 2003 - 2012 by Christian Gloor 4 | // 5 | 6 | #ifndef _obstacle_h_ 7 | #define _obstacle_h_ 1 8 | 9 | #include 10 | 11 | #include "ped_obstacle.h" 12 | 13 | using namespace std; 14 | 15 | /// \author chgloor 16 | /// \date 2012-01-17 17 | class Obstacle: public Ped::Tobstacle { 18 | private: 19 | 20 | public: 21 | Obstacle(double ax, double ay, double bx, double by, QGraphicsLineItem *l); 22 | QGraphicsLineItem *line; 23 | 24 | void setPosition(double ax, double ay, double bx, double by); 25 | }; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /libpedsim/documentation/98-contributors.md: -------------------------------------------------------------------------------- 1 | PEDSIM Contributors 2 | =================== 3 | 4 | PEDSIM was written mostly by Christian Gloor. But there have been a lot of people helping with writing the code and providing feedback! Thanks! 5 | 6 | ## Initial Package 7 | 8 | The Multi-Agent Sim Team @ ETH Zürich and TU Berlin: 9 | 10 | - Kai Nagel 11 | - Duncan Cavens 12 | - Nurhan Cetin 13 | - Bryan Raney 14 | - Michael Balmer 15 | - David Charypar 16 | - Fabrice Marchal 17 | 18 | 19 | ## Notable Contributions 20 | 21 | *Sven Wehner* provided an extremly comprehensive patch fixing many mistakes. 22 | 23 | *Max Küng* has built the initial server-side git repository and the Nginx setup. He also wrote some patches. -------------------------------------------------------------------------------- /ecosystem/2dvis/item.h: -------------------------------------------------------------------------------- 1 | // 2 | // pedsim - A microscopic pedestrian simulation system. 3 | // Copyright (c) by Christian Gloor 4 | // 5 | 6 | #ifndef ITEM_H 7 | #define ITEM_H 8 | 9 | #include 10 | 11 | class Item : public QGraphicsItem { 12 | 13 | public: 14 | Item(); 15 | 16 | QRectF boundingRect() const; 17 | QPainterPath shape() const; 18 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); 19 | double x; 20 | double y; 21 | double r; // rotation 22 | double dx; 23 | double dy; 24 | double radius; 25 | 26 | protected: 27 | void advance(int step); 28 | 29 | private: 30 | QColor color; 31 | }; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /ecosystem/3dvis/item.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // pedsim - A microscopic pedestrian simulation system. 3 | // Copyright (c) by Christian Gloor 4 | // 5 | 6 | #include "item.h" 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | Item::Item(Qt3DCore::QEntity *rootEntity) : Qt3DCore::QEntity(rootEntity), transform(new Qt3DCore::QTransform), r(0) { 15 | // does basically nothing for the time being. 16 | } 17 | 18 | void Item::updateComponents() { 19 | transform->setTranslation(QVector3D(x, z, y)); 20 | //transform->setRotation(QQuaternion::fromAxisAndAngle(QVector3D(0, 1, 0), r)); 21 | }; 22 | 23 | -------------------------------------------------------------------------------- /ecosystem/demoapp/src/cell.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // pedsim - A microscopic pedestrian simulation system. 3 | // Copyright (c) 2003 - 2012 by Christian Gloor 4 | // 5 | 6 | #include "cell.h" 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | Cell::Cell(double x, double y, double w, double h, QGraphicsScene *gs) { 13 | graphicsscene = gs; 14 | 15 | 16 | QPen p = QPen(QColor(55,55,55), 1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin); 17 | p.setCosmetic(true); 18 | QGraphicsRectItem *rect = graphicsscene->addRect(x, y, w, h, p); 19 | rect->setVisible(true); 20 | rect->setZValue(-200); 21 | double v = 1; 22 | // if ((int)(x/10) % 2 == 0) v = 3; 23 | values.push_back(v); 24 | } 25 | -------------------------------------------------------------------------------- /ecosystem/demoapp/src/grid.h: -------------------------------------------------------------------------------- 1 | // 2 | // pedsim - A microscopic pedestrian simulation system. 3 | // Copyright (c) 2003 - 2012 by Christian Gloor 4 | // 5 | 6 | #ifndef _grid_h_ 7 | #define _grid_h_ 1 8 | 9 | #include "cell.h" 10 | 11 | #include 12 | 13 | #include 14 | 15 | using namespace std; 16 | 17 | /// \author chgloor 18 | /// \date 2012-02-17 19 | class Grid { 20 | private: 21 | 22 | double minx; 23 | double miny; 24 | 25 | vector< vector > cells; 26 | 27 | public: 28 | Grid(double x, double y, double w, double h, QGraphicsScene *l); 29 | QGraphicsScene *graphicsscene; 30 | QGraphicsRectItem *rect; 31 | 32 | double getValue(double x, double y, int value); 33 | 34 | 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /ecosystem/demoapp/src/config.h: -------------------------------------------------------------------------------- 1 | // (c) 2011 by Christian Gloor 2 | // See main.cpp for more information 3 | 4 | #ifndef _config_h_ 5 | #define _config_h_ 6 | 7 | #include 8 | 9 | class Config : public QObject { 10 | Q_OBJECT 11 | 12 | public: 13 | Config(); 14 | 15 | bool guiShowWaypoints; 16 | double simWallForce; 17 | double simPedForce; 18 | int simSpeed; 19 | bool mlTendency; 20 | bool mlLookAhead; 21 | bool showForces; 22 | bool showDirection; 23 | double simh; 24 | bool showTree; 25 | bool followAgent; 26 | 27 | public slots: 28 | void setGuiShowWaypoints(bool value); 29 | void setSimWallForce(double value); 30 | void setSimPedForce(double value); 31 | void setSimSpeed(int value); 32 | }; 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /ecosystem/demoapp/src/obstacle.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // pedsim - A microscopic pedestrian simulation system. 3 | // Copyright (c) 2003 - 2012 by Christian Gloor 4 | // 5 | 6 | #include "obstacle.h" 7 | 8 | #include 9 | 10 | using namespace std; 11 | 12 | 13 | /// Description: set intial values 14 | /// \date 2012-01-07 15 | Obstacle::Obstacle(double pax, double pay, double pbx, double pby, QGraphicsLineItem *pl) : Tobstacle(pax, pay, pbx, pby) { 16 | line = pl; 17 | line->setLine(pax, pay, pbx, pby); 18 | }; 19 | 20 | 21 | /// moves the obstacle ot a new position 22 | /// \date 2012-01-07 23 | void Obstacle::setPosition(double pax, double pay, double pbx, double pby) { 24 | line->setLine(pax, pay, pbx, pby); 25 | Tobstacle::setPosition(pax, pay, pbx, pby); 26 | }; 27 | 28 | -------------------------------------------------------------------------------- /ecosystem/demoapp/src/tree.h: -------------------------------------------------------------------------------- 1 | // 2 | // pedsim - A microscopic pedestrian simulation system. 3 | // Copyright (c) 2003 - 2012 by Christian Gloor 4 | // 5 | 6 | #ifndef _tree_h_ 7 | #define _tree_h_ 1 8 | 9 | #include 10 | #include 11 | 12 | #include 13 | #include 14 | 15 | #include "ped_tree.h" 16 | 17 | class Scene; 18 | 19 | using namespace std; 20 | 21 | 22 | class Tree : public Ped::Ttree { 23 | private: 24 | QGraphicsScene *graphicsscene; 25 | QGraphicsRectItem *rect; 26 | Scene *scene; 27 | 28 | public: 29 | 30 | Tree(QGraphicsScene *graphicsscene, Scene *pedscene, int depth, double x, double y, double w, double h); 31 | virtual ~Tree(); 32 | 33 | virtual void addChildren(); 34 | 35 | int cut(); 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /libpedsim/documentation/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | (c) by Christian Gloor 23 | 24 | 25 | 26 | 27 |