JaroslawWiosna / regionalizer

How to choose the best capital of a state and regions? Divider into regions, especially for administrative purposes
Mozilla Public License 2.0
2 stars 2 forks source link
c-plus-plus

Licence Release GitHub contributors Pull Requests Travis status Coverage Status Codacy Badge

regionalizer Watchers Star Fork

regionalizer /ˈriːdʒ(ə)n(ə)lʌɪzə/ - the one who regionalizes.

to regionalize /ˈriːdʒ(ə)n(ə)lʌɪz/ - to divide into regions, especially for administrative purposes. based on thefreedictionary

How to choose the best capital of a state and regions?


This version of readme is outdated. Please, stay tuned for a upgraded version


Overview

image image image image

How could we know what is the best city to locate the headquaters of our company?

There is neither happiness nor misery in the world; there is only the comparison of one state with another, nothing more.

This line from The Count of Monte Cristo ending gave us a clue about happiness. Every City wants to be the capital. Only then the happiness would be max. The worst case for a specific city would occur when the capital is in the middle of nowhere. Only then the happiness would be min. When the capital is somewhere in between, the happiness would be somewhere in between as well.

Here is an example:


When we have a capital canditate, let's find out what other cities think about it.


With that being said the algorithm is quite obvious:

The objectives of the project


How to build?

mkdir build
cd build
cmake ..
make
make test
./regionalizer --list ../database/cities_data

How to contribute?

Please, have a look here


How to generate doxygen documentation?

doxygen doxygenConfigurationFile

...then please find index.html in html directory.


Creating database using city_update_tool

Run in java eclipse: file city_update tool to get text file cities_data_pre_parsed with cites name, area(km^2) and population
Now run in java eclipse: file city_update tool2 to get full city database text file cities_data containg data from cities_data_pre_parsed with additional cities longitude and latitude and remove polish letters from city's names. There are no cardinal directions like "E". The coordinates minutes are in form of decimal part of the degrees with a precision set to 4 digits after the comma.
Remember about the order of runing city_update_tool first. Otherwise you will get wrong results!!
Database final order is as following: City name|Area|Population|Latitude|Longitude


Algorithms

TBD


Clang format

As it is important for us to keep common rules of clean code for the repository we introduce the clang-format. It uses file .clang-format. In order to run it you have to download the tool with the instructions provided by us on our wiki page: https://github.com/JaroslawWiosna/regionalizer/wiki/Clang .

The rule is that you have to run it before each commit you make to the repository so we could keep consistency. In order to run it you have to be one folder up(over) the repository file and you have to run exacly the following command in the console:

find regionalizer -iname *.hpp -o -iname *.cpp | xargs clang-format -i -style=file

Coding style

In our repository we use style defined by LLVM modified by additional flags that can be seen in: https://github.com/JaroslawWiosna/regionalizer/blob/master/.clang-format. They flags are further discussed in here: http://clang.llvm.org/docs/ClangFormatStyleOptions.html. Because we use that file each contributor resposibility in case of clean code is only using clang-format as it is described above. You can find more about LLVM on the following page: http://llvm.org/docs/CodingStandards.html.


Project wiki

We encourage you to visit our project wiki Page where you can find all knowledge base about our project, methods and alghoritms we use, project meetings and more. Here is the link to our wiki: https://github.com/JaroslawWiosna/regionalizer/wiki.


Special thanks to

https://gronlier.fr/blog/2015/01/adding-code-coverage-to-your-c-project/