66 5. Implementationaccessing Python primitives like Lists or Dicts is out of the question anyway. Releas-ing the global interpreter lock makes Python based threading efficient. For example,4 instances of an algorithm can be started simultaneously from the Python VM andexecute their binary code in parallel. Even more fine grained threading control canbe reached by using the support for OpenMP instructions that are available in pureC space. By only using a slightly modified syntax for loop control, the loop becomesinstrumented by the OpenMP backend compiler support(GCC or MSVC) and willbe executed on multiple automatically spawned threads.The localization algorithms have therefore been implemented by applying the sameprocedure: prototype the algorithm in pure Python on smallish datasets with ndar-rays. Move the Python code to Cython and make the algorithm fast by applyingtype annotations. If the algorithm is then only composed as a sequence of GIL-freeC loops over ndarrays, it can already be executed in parallel. Tuning the multi-corecapabilities even more with OpenMP has only been done for the HMM implementa-tion as the"magic" of OpenMP imposes some constraints on the algorithm. Theseconstraints relate to sharing of variables over different scopes which would invali-date some assumptions of the Particle Filter implementation. Although this is nota surprise, as efficient parallel algorithms are often difficult to implement.CherryPyCherryPy is a light-weight HTTP-Server implemented in pure Python . The Servercomponent of the framework is designed as a CherryPy application. A central con-cept of a HTTP -Server, the URL-routing is defined by exposing functions of theapplication to act as URL-handlers returning some mime-type encoded string. Pro-viding a new service behind an url is therefore cheap and has made the prototyping ofthe different communication channels between the information producers/consumersan easy task. Although CherryPy acts as a standalone HTTP -Server it would makesense to run the service behind an Apache proxy server in the future.PygeneThe Pygene library was used for the implementation of the optimization processfor the radio propagation models. It provides a set genetic algorithms that aremodelled around the concepts of population, organism and gene. Organisms are acompound data structure for genes and populations hold a number of organisms.Genes represent parameter values of an optimization and have a type correspondingto the primitive Python types like floats. Furthermore, genes can define upper andlower boundaries for their values. An organism holds a collection of genes withvalues and represents a solution in the search space of the optimizer. The searchspace is explored by crossing the genes of selected organisms from a population.This crossing leads to a new population of organisms and represents a new set ofsolutions.It is an exotic library with respect to the GPL license and the small algorithmiccore. It would not be that hard to implement a comparable set of features, but theinner workings of genetic algorithms were of minor concern in this thesis.
Diplomarbeit
Indoor Localization of Mobile Devices Based on Wi-Fi Signals Using Raytracing Supported Algorithms
Einzelbild herunterladen
verfügbare Breiten