How to test/optimize the best tents layout in certain site/area?

I have a challenge to create a generative algorithm, that try options and optimize the best tent layout for a indoor market, in relation to the number of tents and space syntax analysis. I’m actually studying Grasshopper for almost a year, but I’m having trouble to create this algorithm strategy. In my mind the algorithm must create lines for the circulation/corridors, so I create them in a matrix/grid on my site shape, and they move and rotate between all points and angles. An then I set the corridors width, and cut the points in my corridor surface from my grid intersection points. In the remaining points I set my tents origin. I’m having trouble to create restrictions, like: there can`t be a situation where i have a 4 sided closed tent, cause i need the entering (acess from the circulation) in all tents. And i need the algorithm to test a different number of circulation lines, not only the three setted in the current code. Consider that after all, I’ll run galapagos or other multiobjective optimization plugin (like Discover or octopus) considering maximize the number of tents and some space syntax analysis of the circulation. Sorry for my bad english, I hope this is sufficient to understand my challenge here.


the complete code is attached on this post.
TentDispositionOnSite.gh (29.9 KB)