Exemplo n.º 1
0
 def living_space(self):
     used_area = self._basic_bidg.used_area
     if used_area:
         return number2xml(used_area)
     return number2xml(
         round(
             random.uniform(0.55, 0.62) *
             round(self._basic_bidg.total_area), 1))
Exemplo n.º 2
0
 def split_rooms(self):
     if self._basic_bidg:
         rooms = self._basic_bidg.room_count
         total_area = float(self._basic_bidg.total_area)
         rooms_areas = []
         room_area = int(total_area / rooms)
         remain_area = total_area
         for room in range(rooms - 1):
             cur_area = room_area + room_area * randrange(25) * 1.0 / 100
             cur_area = round(cur_area, 0)
             rooms_areas.append(number2xml(cur_area))
             remain_area -= cur_area
         rooms_areas.append(number2xml(remain_area))
         shuffle(rooms_areas)
         return '+'.join(rooms_areas)
Exemplo n.º 3
0
 def split_rooms(self):
     if self._basic_bidg:
         rooms = self._basic_bidg.room_count
         total_area = float(self._basic_bidg.total_area)
         rooms_areas = []
         room_area = int(total_area / rooms)
         remain_area = total_area
         for room in range(rooms-1):
             cur_area = room_area + room_area * randrange(25) * 1.0 / 100
             cur_area = round(cur_area,0) 
             rooms_areas.append(number2xml(cur_area))
             remain_area -= cur_area
         rooms_areas.append(number2xml(remain_area))
         shuffle(rooms_areas)
         return '+'.join(rooms_areas)             
Exemplo n.º 4
0
 def kuhnya_area(self):
     if self._basic_bidg:         
         kuhnya_area = self._basic_bidg.get_kuhnya_area()
         result = kuhnya_area if kuhnya_area else None
     return number2xml(result)    
Exemplo n.º 5
0
 def format_int_result(self, value, if_none='0'):
     return number2xml(value) if value else if_none
Exemplo n.º 6
0
 def kuhnya_area(self):
     KUHNYA_AREA_DEFAULT = round(random.uniform(9, 12), 1)
     kuhnya_area = self._basic_bidg.get_kuhnya_area()
     result = kuhnya_area if kuhnya_area else KUHNYA_AREA_DEFAULT
     return number2xml(result)
Exemplo n.º 7
0
 def kuhnya_area(self):
     if self._basic_bidg:
         kuhnya_area = self._basic_bidg.get_kuhnya_area()
         result = kuhnya_area if kuhnya_area else None
     return number2xml(result)
Exemplo n.º 8
0
 def living_space(self):
     used_area = self._basic_bidg.used_area
     if used_area:
         return number2xml(used_area)        
     return number2xml(round(random.uniform(0.55, 0.62) * round(self._basic_bidg.total_area), 1))
Exemplo n.º 9
0
 def format_int_result(self, value, if_none='0'):
     return number2xml(value) if value else if_none
Exemplo n.º 10
0
 def kuhnya_area(self):
     KUHNYA_AREA_DEFAULT = round(random.uniform(9, 12), 1)        
     kuhnya_area = self._basic_bidg.get_kuhnya_area()
     result = kuhnya_area if kuhnya_area else KUHNYA_AREA_DEFAULT
     return number2xml(result)