ADGN stands for Adhoc Dynamic Geometric Network.
This library uses a genetic algorithm to optimize a spatially embedded
network where every vertex has a geometric constraint.
- --interest-areas (required): the path to the json file containing the interest areas
- --fitness-function (required): the fitness function for the GA.
- 1: sum of the connectivity componenets squared - optimum is max
- 3: harmonic average of all path length - optimum is min
- --output-base-dir (required): the directory for the GA to output its results including statistics and process visualization
- --initial-population (optional. default 10): the size of the initial population generated by the optimization process
- --iterations (optional. default 300): how many iterations should the optimization process iterate over
- --mutation-factor (optional. default 1): the probability [0,1] of mutation in the GA process. 0 will never mutate, 1 will always mutate.
- --visualize (optional. defatul false): if the optimization process should output visualizations of the optimization process and its statistics
- --parallel (optional. default false): should the GA use multiple processes to parallelize computation
- --optimization-method (optional. default ga) what optimization method should be used.
- ga - use the genetic algorithm process
- sgd - use the stochastic gradient decent process
python adgn.py --interest-areas=/tmp/interest_areas.json --fitness-function=3 --output-base-dir=simulations --iterations=500 --parallel=false --visualize=true --optimization-method=ga T.B.D
To generate a interest areas json file with random interest areas, please use the following command
python ia_generator.py --amount=170 --xlim=8 --ylim=8 --output=/tmp/interest_areas.json
- --amount (required): the amount of interest areas to generate
- --xlim (required): the absolute value of the limit of the x axis on the [xy] plane
- --ylim (required): the absolute value of the limit of the y axis on the [xy] plane
- --output (required): the file name (with path) to output the generated interest areas json file
- --allow-overlap (optional. default false): can the interest areas overlap
- --show (optional. default true): if set to true, at the end of the process, will show the generated interst areas on the [xy] plane