From 137b49c2b0f47e594c54f79388c837d799ec0960 Mon Sep 17 00:00:00 2001 From: Christos Date: Fri, 9 Oct 2015 15:00:24 +0100 Subject: [PATCH] created simple user interface and json input file --- buildingParameters/__init__.pyc | Bin 208 -> 0 bytes mathlib/__init__.pyc | Bin 186 -> 0 bytes spawners/__init__.pyc | Bin 188 -> 0 bytes src/UserInterface/testInput.json | 30 +++++++++++++++++ src/forces.pyc | Bin 2217 -> 0 bytes src/parameters.pyc | Bin 680 -> 0 bytes src/userInterface.py | 56 +++++++++++++++++++++++++++++++ src/vectors.pyc | Bin 1667 -> 0 bytes world/__init__.pyc | Bin 182 -> 0 bytes 9 files changed, 86 insertions(+) delete mode 100644 buildingParameters/__init__.pyc delete mode 100644 mathlib/__init__.pyc delete mode 100644 spawners/__init__.pyc create mode 100644 src/UserInterface/testInput.json delete mode 100644 src/forces.pyc delete mode 100644 src/parameters.pyc create mode 100644 src/userInterface.py delete mode 100644 src/vectors.pyc delete mode 100644 world/__init__.pyc diff --git a/buildingParameters/__init__.pyc b/buildingParameters/__init__.pyc deleted file mode 100644 index 81dba8a4526c9eb2313e7b46cef469f17735a159..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 208 zcmZSn%*(}aP&h1^0ScIav;z?GlDfhvYG#Zz)yn_$Se^85=o_* zIVqWW=>dsFiMgpIsYS&aKv4z+Q5*>5I$Onr76avCg7R|`^HSVPGm|qCi&A3B^NX^J z3lfu4V}kROGZS;%@{5vFee+XNb7C+Jj){-Y%*!l^kJl@xEa3o}YLlCvQks)$2Xag? H5HkP(-SIcF diff --git a/mathlib/__init__.pyc b/mathlib/__init__.pyc deleted file mode 100644 index 43c10fbe759805dea1e9bf31f02e430c78a049b2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 186 zcmZSn%*(ZVmvC4z0~9a;X$K%K761|{K*Y$9!@v*)W&~@1WHbK*fu9B=kXgbGBytl= zGIBDLG=NM71X1h;?GlDfhvYG#Zz)yn_$SmOisVqn= z&r2;T)&Q~@5Ja&%kn3y}6Iu+EiwVllNz6-eFU?HONGwW;DbFv;2I@;rjS0?A&P>d4 s%P&e!_03O7&53~-7ZV?!nU`4-AFo$X3AV>3H$SB`C)EyQaWTj)0A;o?6aWAK diff --git a/src/UserInterface/testInput.json b/src/UserInterface/testInput.json new file mode 100644 index 0000000..5b9223a --- /dev/null +++ b/src/UserInterface/testInput.json @@ -0,0 +1,30 @@ +{ + "PedestrianSimulator":{ + "version":0.1, + "date":{ + "day":9, + "month":10, + "year":2015 + }, + "data":{ + "timePropagationParameters":{ + "description":"", + "dt":{ + "value":0.001, + "description":"Time spacing [s]" + }, + "tmax":{ + "description":"Maximum propagation time [s]", + "value":10.0 + }, + "t":{ + "value":0.0, + "description":"Initial timing [s]" + } + } + + } + + } + +} \ No newline at end of file diff --git a/src/forces.pyc b/src/forces.pyc deleted file mode 100644 index 1f47ea1efe944ff65472d3622001f7972be60e7f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2217 zcmbtV%WfP+6us5+^7Po_JVwF60U8ORQ4sjCVi5rXlpR^L2}qWp)$Xntm+4o!Y9>z9 zBNpbD_>+79|G{RWL*YYn8j>d|UM4t<-EE00#& zRq|-ls>;KBphqL+rQ3K;phvN}Wu*@Z27v2tw@^ zbzuW{u7g@vi_Ds(4rXPY=-^Dd=UNv*rBiKPZQ{ZjW(!^u#g{+`H3@zIfT*b8E740` zmlpRW%5)(;bzID~yN4c~Wu~$^vN|`pDatzHecWvf;S5vjG)hq>4&cic`m&PRF7hdZ zkE;{?5FH&yhqARb^E{T*QzsqENMAa~l-2Fo(q?b!=oeXy`g+P^H^e}kSDA5(RLe3W z<(ZsX938t6X26Rwn#GAL+f4IkmoUKWGgBZU{22x)Zp8+n zTy<#GBix}C4GRWp5s~e$1}s9{?4nB-*RtA!ghr5{NC~n*zsP0M^l1VypGXiqnKJP1 z0SZtVC0S{qiKr?~;UZUp(0LBFLk^CR9Sj+A!8JrjT9NY%mVY&i^1|a((t2H0+_@vY({xs9oi&57h>K zra|EU6-JBh9>Xr#;Nm(P0C`-3i9pDq+>|I3p)CasYz@&csOHpbD7dRRFoi zm^0KMhG-9n@1IOL-Puo3yq-T}=W67Ln*{30AO^bDAp$s~-5|$m7O1A|hRAv;a4gq) z4>=_|9@J5sRp+sU$g;H$C2hHQ(Kg>6BsakUl5;qQU-R@K`YlsQ-CfW3`d*uSIU1s9 zw!k+-M^VV*!ZlLxxn$d7kykI;&}VVj#30)VSd}DsOsulfW#$ZNkS*bQZ895G=H%8( zd;`kbhMXzGkGWthLjGpmTvx3BoP7COkMc5IWcmwnjkS0S@x6^7-*z}24u+$D00tb{ A$N&HU diff --git a/src/parameters.pyc b/src/parameters.pyc deleted file mode 100644 index 8ed52bcbbc4c1a04beade949a9955940ee9e2383..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 680 zcmYLGv2N5r5PfUkT`tZgIUpwrB!m=-69rD7MffVZAe0a!wy`$e#W7mjCwniDI$uHl zAT=LAjRXz+0G|*%2pdB7pnH&g=sx5CdH}fsy#hIe9zw1{uR=yJJ-l9HZ0L-AzvKq=Cgc`RbTA#$+{GWVsUYNryhd?S zv_)P0W0=18G$&8?Gs!=HV#6$d=B|qx`~OUm zpTA@Km`o>B;UaQr`fA}8jY-pe%HVqBO687SpFp)J=cg`UG*{ij&aoc3^Ts3s< lOw-<{HM#$zvepZ09`icwZE|A~iBUKZSI>4pIGBhD#lISki~Rrq diff --git a/src/userInterface.py b/src/userInterface.py new file mode 100644 index 0000000..1bc223c --- /dev/null +++ b/src/userInterface.py @@ -0,0 +1,56 @@ +#!/usr/bin/python + +import json +from pprint import pprint +import os +from msilib import Control +import numpy as np + + +class Reader(object): + + def setTimePropagationParameters(self): + tmax = self.__allData["PedestrianSimulator"][ + "data"]["timePropagationParameters"]["tmax"]["value"] + dt = self.__allData["PedestrianSimulator"][ + "data"]["timePropagationParameters"]["dt"]["value"] + time = np.linspace(0., tmax, int(tmax / dt) + 1) + self.__allData["PedestrianSimulator"]["data"][ + "timePropagationParameters"]["time"] = {} + self.__allData["PedestrianSimulator"]["data"][ + "timePropagationParameters"]["time"]["value"] = time + self.__allData["PedestrianSimulator"]["data"][ + "timePropagationParameters"]["time"]["description"] = "time grid" + + def Model(self): + self.readData() + self.setTimePropagationParameters() + + def Control(self): + pass + + def View(self): + print "so far:" + pprint(self.__allData) + + def __init__(self, inputFilename="UserInterface/testInput.json"): + print "Pedestrian Simulator started at", os.getcwd() + if inputFilename == None: + raise SystemExit("Not input file was specified!") + + self.__inputFilename = inputFilename + + self.Model() + self.View() + + def readData(self): + print "Reading input file ", self.__inputFilename + with open(self.__inputFilename) as data_file: + data = json.load(data_file) + + self.__allData = data + + +if __name__ == "__main__": + + R1 = Reader() diff --git a/src/vectors.pyc b/src/vectors.pyc deleted file mode 100644 index 756bfa99344b140265292990b5a89cbf12cc243d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1667 zcmbtU!EVz)5S?|LrU@-AD2R&ouyCjhDnxKWLI^5V;zkb+a7cwL*WR>F*51gwNn1!y z<;H<;;TQNKByL<_W}G%~C=#lhoqe+&@9vwK*V>Qe*4J-8-zG47Je;>BfE^=9@h3n7 z=!7N22+pR zwNoFQfB`x_Ol$Ox+!_qf6&!IUVEwdCbfEGll&O#nWi_Pa1ax%RAVckUg(QTu(=8m9 z0C<-WV{U76VwF!#IV1KIKmIqdzA3qpQf0GJr7}gEI1RX;0KRGl;v?Oj~A#1OoDB3QxMwa`RSe~kY$R1}5ujxUnO?$A-A7UO($!hOrG zO)``mk+hZg?TO`z;0GgZoX+-9lZ2S)3{q>1v&?b*H3??a diff --git a/world/__init__.pyc b/world/__init__.pyc deleted file mode 100644 index a1057c672126364b7d769a06db613dff7c4718fa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 182 zcmZSn%*z$9PdF@@0ScIav;z?GlDfhvYG#Zz)yn_$Sh$666N_t zIVl=I1_Od9b^&sotztrpQ;UjYg7R|`^HSVPGm|qCi&A2M8nTNE5|dM7g7cFz6LZ}1 ui;`1)^HWlDKvFp=G4b)4d6^~g@p=W7B^*G5Y;yBcN^?@}Kvot5F#`Ytye)A6