Genetic algorithm that should produce floor plans and arrangements. Probably will never work properly.
The main idea is
- generate random genomes (generation)
- score them according to soft constraints (fitness)
- choose genomes with probability proportional to its scores
- combine chosen genomes into a new population (crossover)
- mutate some genes (mutation)
- repeat from 2
g++ -o ga.o main.cpp -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_imgcodecs
- Genome: The representation of the floor plan in memory. Consists of many genes
- Gene: The representation of a space(room/walkway etc) in the genome.
- Score: How good a genome is according to the soft constraints. Bigger is better (or so I've heard).
- Soft constraints: The things that are used to score a genome. For example
- Distance between room and bathroom
- Distance between kitchen and living room
- Wasted area for walkways
- etc.
- Hard constraints: The things that make a genome acceptable or not. Failing to pass a hard constraint implies a score of 0.
- Plot limits
- Access to rooms
- Minimum dimensions
- haha yes
OpenCV > 2.0