Exemplo n.º 1
0
 def testBuildingTypeForAWall(self):
     corner1 = np.array([-5., -2., 0.])
     corner2 = np.array([2., 5., 0.])
     wallCoordinates = np.array([corner1, corner2])   
     returnedWall = buildingType('wall', *wallCoordinates)
     errorMessage = "Wrong input value for corner1"
     self.assertEqual(returnedWall.endPoint1.all(), corner1.all(), errorMessage)
     errorMessage = "Wrong input value for corner2"
     self.assertEqual(returnedWall.endPoint2.all(), corner2.all(), errorMessage)
     pass
Exemplo n.º 2
0
 def testBuildingTypeForAWall(self):
     corner1 = np.array([-5., -2., 0.])
     corner2 = np.array([2., 5., 0.])
     wallCoordinates = np.array([corner1, corner2])
     returnedWall = buildingType('wall', *wallCoordinates)
     errorMessage = "Wrong input value for corner1"
     self.assertEqual(returnedWall.endPoint1.all(), corner1.all(),
                      errorMessage)
     errorMessage = "Wrong input value for corner2"
     self.assertEqual(returnedWall.endPoint2.all(), corner2.all(),
                      errorMessage)
     pass
Exemplo n.º 3
0
 def testBuildingTypeForAnOffice(self):
     corner1 = np.array([20., 20., 0.])
     corner2 = np.array([20., 40., 0.])
     corner3 = np.array([40., 40., 0.])
     corner4 = np.array([40., 20., 0.])
     OfficesCoordinates = np.array([corner1, corner2, corner3, corner4])   
     returnedOffice = buildingType('office', *OfficesCoordinates)
     errorMessage = "Wrong input value for corner1"
     self.assertEqual(returnedOffice.corner1.all(), corner1.all(), errorMessage)
     errorMessage = "Wrong input value for corner2"
     self.assertEqual(returnedOffice.corner2.all(), corner2.all(), errorMessage)
     errorMessage = "Wrong input value for corner3"
     self.assertEqual(returnedOffice.corner3.all(), corner3.all(), errorMessage)
     errorMessage = "Wrong input value for corner4"
     self.assertEqual(returnedOffice.corner4.all(), corner4.all(), errorMessage)
     pass
Exemplo n.º 4
0
 def testBuildingTypeForAnOffice(self):
     corner1 = np.array([20., 20., 0.])
     corner2 = np.array([20., 40., 0.])
     corner3 = np.array([40., 40., 0.])
     corner4 = np.array([40., 20., 0.])
     OfficesCoordinates = np.array([corner1, corner2, corner3, corner4])
     returnedOffice = buildingType('office', *OfficesCoordinates)
     errorMessage = "Wrong input value for corner1"
     self.assertEqual(returnedOffice.corner1.all(), corner1.all(),
                      errorMessage)
     errorMessage = "Wrong input value for corner2"
     self.assertEqual(returnedOffice.corner2.all(), corner2.all(),
                      errorMessage)
     errorMessage = "Wrong input value for corner3"
     self.assertEqual(returnedOffice.corner3.all(), corner3.all(),
                      errorMessage)
     errorMessage = "Wrong input value for corner4"
     self.assertEqual(returnedOffice.corner4.all(), corner4.all(),
                      errorMessage)
     pass
Exemplo n.º 5
0
def spawnWalls():
	walls = [None] * nbWalls
	for i in range(nbWalls):
		walls[i] = buildingType('wall', *wallCoordinates)
	return walls
Exemplo n.º 6
0
def spawnBuilding():
	buildings = [None] * nbBuildings
	for i in range(nbBuildings):
		buildings[i] = buildingType('office', *buildingCoordinates)
	return buildings
Exemplo n.º 7
0
def spawnWalls():
	walls = [None] * nbWalls
	for i in range(nbWalls):
		walls[i] = buildingType('wall', np.array([wallsCoordinates[2*i], wallsCoordinates[2*i+1]]))
	return walls
Exemplo n.º 8
0
def spawnBuilding():
	buildings = [None] * nbBuildings
	for i in range(nbBuildings):
		buildings[i] = buildingType('office', np.array([buildingCoordinates[4*i], buildingCoordinates[4*i+1],
												buildingCoordinates[4*i+2], buildingCoordinates[4*i+3]]))
	return buildings