Towards topological representation of smart cities environment: a Putback BX approach towards Bigraphs from CityGML. Powered by BiGUL.
Currently it is recommended to execute topocity
via Stack platform, since it is cross-platform, virtualizable, and takes care of all dependencies automatically.
After cloning/downloading this repository go to its directory and launch it via command line:
stack ghci src/Lib.hs
To experiment with topocity
, you can execute the following commands in the REPL. Note that input files are taken from the in
directory while output files are generated into the out
directory. To change this, change the paths in Settings.hs
variables.
The following commands use some demo files provided with this repository, however other input can be used, despite currently there is a very limited support of CityGML features related to the current state of development of the citygml4hs library.
source = load "in.gml" "topo.gml"
view = get source -- performs the forward BX: CityGML -> Bigraph
display view -- prints in stdout the internal representation of the graph
Wrappers to simulate changes in the bigraph
view' = addBuilding "demo1" view
view'' = removeBuilding "bc8a0f2b5-031b-11e6-b420-2bdcc4ab5d7f" view'
display view'' -- prints in stdout the internal representation of the graph
source' = put source view'' -- performs the putback BX: CityGML <- Bigraph
store source' "out.gml" "tout.gml" -- Stores the new CityGML and ADE files
To run the code coverage of the testing platform run in your OS's CLI:
stack test --ghc-options "-fforce-recomp" --coverage
and of course to just run the tests you can skip the --coverage
flag.
It requires to build the tool with profiling flag enabled, therefore:
stack build --profile
After the build completes, the program can be run in the following way to collect profiling data:
stack exec --profile topocity-exe -- +RTS -h -p
The h
flag is used to generate a heap profile, while the p
flag is used to generate the classical cpu profile.
To visualize them (provided they have been installed them before), one can use:
stack exec hp2pretty topocity-exe.EXE.hp
for memory graph (svg image) and
stack exec profiteur topocity-exe.EXE.prof
for CPU interactive graph (html).
In order to generate the dependency graph (in this case the trivial dependency on the base
package has been excluded):
stack dot --no-include-base --external | dot -Tpng -o out/wreq.png
To generate the updated documentation, you can write in the same way:
stack haddock
While to generate the report of the Lines of Code (Windows-only), open a terminal at the tools
directory and execute:
cloc.exe ../src ../test --report-file=reports/cloc_%DATE%.txt