diff --git a/src/Floorplan.hs b/src/Floorplan.hs index 6ac5237..e2d5be2 100644 --- a/src/Floorplan.hs +++ b/src/Floorplan.hs @@ -56,14 +56,17 @@ placeHalls rng fc input = where doHalls rand bs cross wmax mat = foldl (\(agen, amat) b -> - let (row, g1) = randomR (fst (matmin b), fst (matmax b)) agen - (col, g2) = randomR (snd (matmin b), snd (matmax b)) g1 - (nw, g3) = randomR (2, wmax) g2 - (nbs, nmat) = buildHall cross nw b amat + let (row, g1) = randomR + (fst (matmin b) + 10, fst (matmax b) - 10) agen + (col, g2) = randomR + (snd (matmin b) + 10, snd (matmax b) - 10) g1 + -- (nw, g3) = randomR (2, wmax) g2 + (nbs, nmat) = buildHall cross 3 b amat in - if hallRatio nmat < 0.25 && wmax - 1 > 2 - then doHalls g3 nbs (row, col) (wmax -1) nmat - else (g3, nmat) + -- if hallRatio nmat < 0.33 && wmax - 1 >= 2 + if wmax - 1 >= 3 + then doHalls g2 nbs (row, col) (wmax -1) nmat + else (g2, nmat) ) (rand, mat) bs boundSize :: Boundaries Int -> Int