Surfaces arrangement in grid


I would like to generate the base area and placement of apartments according to certain conditions.
My idea is to use the Galapagos or Opossum plugin to achieve a fitness of 0(best value) after adding all conditions.
I have created a script that allows to arrange the footprints of the flats on a grid. But I don’t know how to add more conditions (see the attached Grasshopper script).
It might be possible to fulfill the conditions by packing. For example, the areas could be opened up to create a corridor. The areas that do not have to be used for the corridor would then be used as living space again.

Necessary conditions:

  1. each apartment must have a view outside or to the atrium
  2. each apartment must be connected to the corridor
  3. The corridor must overlap at one point to allow stairs to the next floor
  4. On the next floor the apartments can be rearranged, but should have at least one equal wall position for the kitchen and the bathroom.

I would be very grateful for helpful approaches or solutions.
Have a nice day


principle of (50.2 KB)

Please don’t duplicate posts:

Hello again Michael Pryor. I deleted a lot of the other post to make it more understandable and less complex. Maybe someone has now an idea. If there is a problem with that, im going to delete this post of course.