This repo is the program part of my masters diploma. Full theme sounds like "Creation of fuzzy Voronoi diagrams with optimal generator points placing by applying the optimal partition theory".
- Application using
- Used math
- Used technologies
- Project structure
- How to build
- Auto build
- Manual build
- Supported languages
- Used packages
This program is appliable in situations when you have a space where consumers of some resource are distributed, and a finite set of some suppliers that you need to place in optimal way. Optimal way is such placing that sum of all distances from consumers to their suppliers will be minimal.
Typical examples of resource suppliers are:
- stores
- cell stations
- power stations
- schools/parks/gas stations etc.
Typical example of resource consumer are people. In this case power of resource consuming in a particular point of space is a population density.
In the first window you change settings of partition:
In the second window you can see the result of the partition creation process:
From the second window you can explore the partition info, such as centers positions, gradient direction, partition quality estimation etc:
Partition view features:
- interactive exploring partition result
- draw partition in grayscale
- change the mistrust coefficient of the shown partition without re-creating it.
- save partition image
- Fuzzy logic
- Optimal partition theory
- Calculus (integrals and derivatives)
- WPF
- Unity Engine
- Compute shaders (HLSL)
- Win32
There are a .NET solution and Unity project. .NET Solution contains algorithms base, tests and WPF app. Unity project is used for creating and showing partition images. WPF app is used for settings.
The Unity player is built into the WPF window, so we can set up, create and view partitions in one app.
In order to build program, you need:
- Visual Studio
- .NET Framework 4.8
- .NET 5
- Unity Engine
To run the automatic release build process, execute the Powershell script "BuildRelease.ps1" in the root of the repo.
Since the project consists of two executables - unity player for calculations and WPF app for managing - we build it in several steps.
- Build the "OptimalFuzzyPartitionAlgorithm" in "OptimalFuzzyPartition" solution (you can just build all solution).
- Build Unity player. It can be done from Unity Editor via "Build->Build to debug/release folder" menu. The executable will be built to the build folder of the WPF app, so we won't have to copy it manually.
- Build and run project "OptimalFuzzyPartition" in "OptimalFuzzyPartition" solution. You can just run it if it's already built.
Since WPF only supports Windows, whole program is tied to Windows. But in the case of need, the View part can be ported to Avalonia framework, which is crossplatform, without changing the ViewModel.
Also, since Unity is crossplatform, you can run program from Unity on other platforms, such as Linux or MacOS, without any changes. In this case you will use Unity UI, which is less convenient.
At the current moment GUI supports next languages:
- English
- Russian
- Ukrainian
- MathNet.Numerics
- NLog
- SimpleTCP
- Newtonsoft.Json
- NaughtyAttributes
- NUnit
- NuGet for Unity
- IngameDebugConsole
This project is available under the MIT license.