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
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.
the farthest
city.a capital canditate
and A <-- first city of the vector(a.k.a. state, a.k.a. country)HI
which is Happiness Index
= 10 * (calculated distance between A and the candidate
/ distance to the farthest city)HL
which is Happiness Level
= HI * population of A
HL
of every single city is the value. It is like votes. Candidate with the greatest value of HL
would be elected as the new capital.With that being said the algorithm is quite obvious:
The objectives of the project
mkdir build
cd build
cmake ..
make
make test
./regionalizer --list ../database/cities_data
Please, have a look here
doxygen doxygenConfigurationFile
...then please find index.html
in html
directory.
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
TBD
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
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.
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.
https://gronlier.fr/blog/2015/01/adding-code-coverage-to-your-c-project/