示例#1
0
    def optimizeWallBF(self, wall, val):

        self.init()
        utils.resetProgress(self.__scene, 5)

        step = abs(wall.planeEquation[3]) / 10
        step = step if val >= 0 else -step
        valList = [step * (i + 1) for i in range(5)]
        moveVal = self.bruteForceSearch(wall, valList)
        self.__scene.label.moveWallByNormal(wall, moveVal)
示例#2
0
    def optimizeWallGS(self, wall, val):

        self.init()
        if not self.__isAvailable:
            print('PushPred not available')
            return
        utils.resetProgress(self.__scene, 3)

        step = abs(wall.planeEquation[3])
        step = step if val >= 0 else -step
        a = min(step / 10, step)
        b = max(step / 10, step)
        moveVal = self.goldenSectionSearch(wall, a, b, 3)
        self.__scene.label.moveWallByNormal(wall, moveVal)
示例#3
0
    def optimizeLayoutGS(self):

        self.init()
        if not self.__isAvailable:
            print('PushPred not available')
            return
        utils.resetTimer()

        label = self.__scene.label
        walls = label.getLayoutWalls()
        utils.resetProgress(self.__scene, 6)

        floor = label.getLayoutFloor()
        moveVal = self.goldenSectionSearch(floor, 0, 1.0, 3)
        label.moveFloor(moveVal)

        ceiling = label.getLayoutCeiling()
        moveVal = self.goldenSectionSearch(floor, 0, 1.0, 3)
        label.moveCeiling(moveVal)
示例#4
0
    def optimizeLayoutBF(self):

        self.init()
        label = self.__scene.label
        walls = label.getLayoutWalls()
        utils.resetProgress(self.__scene, 12 + len(walls) * 5)

        floor = label.getLayoutFloor()
        valList = [0, 0.1, 0.2, 0.3, 0.4, 0.5]
        moveVal = self.bruteForceSearch(floor, valList)
        label.moveFloor(moveVal)

        ceiling = label.getLayoutCeiling()
        valList = [0, 0.1, 0.2, 0.3, 0.4, 0.5]
        moveVal = self.bruteForceSearch(ceiling, valList)
        label.moveCeiling(moveVal)

        for wall in walls:
            step = abs(wall.planeEquation[3]) / 10
            valList = [0, 1 * step, 2 * step, 3 * step]
            moveVal = self.bruteForceSearch(wall, valList)
            label.moveWallByNormal(wall, moveVal)