Space Module Documentation¶
Items in continuous modeling¶
In the file continuousItems.py four classes are defined to implement the elements of the physical space in a continuous model:
-GeneralItem: Class that implements generic elements positioned on the map with the effect of being impenetrable. -Door: Class that implements bulding plane doors. -Wall: Class that implements building walls. -Poi: Class that implements points of interest where Occupancy objects perform certain actions.
-
class
soba.space.continuousElements.
Door
(model, pos1, pos2, rot, state=True)[source]¶ - Class that implements bulding plane doors.
- Attributes:
- state: Door status, open (True) or closed (False). pos1: First position to access to the door. pos2: Second position to access to the door. rot: Door orientation in the grid (‘x’ or ‘y’).
- Methods:
- open: Change the status of the door to open. close: Change the status of the door to close.
-
class
soba.space.continuousElements.
GeneralItem
(model, pos, color=None)[source]¶ - Class that implements generic elements positioned on the map with the effect of being impenetrable.
- Attributes:
- pos: Position where the object is located. color: Color with which the object will be represented in the visualization.
-
class
soba.space.continuousElements.
Poi
(model, pos, ide, share=True, color=None)[source]¶ - Class that implements relevant elements in the simulations: points of interest where Occupancy objects perform certain actions by associating these points with certain states.
- Attributes:
- pos: Position where the object is located. ide: Unique identifier associated with the point of interest. share: Define if the poi can be shared by more than one occupant. color: Color with which the object will be represented in the visualization.
-
class
soba.space.continuousElements.
Wall
(block1, block2, block3, color=None)[source]¶ - Class that implements building walls.
- Attributes:
- block1, block2, block3: lists of positions that contain positions between which an
- occupant can move obeying with the impenetrability of the wall.
color: Color with which the object will be represented in the visualization.
Items in simplified modeling¶
- In the file continuousItems.py three classes are defined to implement the elements
of the physical space in a simplified model based on a room distribution:
-Room: Class that implements the rooms through which the Agent/Ocupant objects are located, move and where activities are carried out. -Door: Class that implements bulding plane doors. -Wall: Class that implements building walls.
-
class
soba.space.roomsElements.
Door
(room1=False, room2=False, state=False)[source]¶ - Class that implements bulding plane doors.
- Attributes:
- state: Door status, open (True) or closed (False). room1: First room to croos the door. room2: Second room to croos the door.
- Methods:
- open: Change the status of the door to open. close: Change the status of the door to close.
-
class
soba.space.roomsElements.
Room
(name, conectedTo, dx, dy, pos=(0, 0))[source]¶ - Class that implements the rooms through which the Agent/Ocupant objects are located, move and where activities are carried out.
- Attributes:
- name: Unique name of the room. roomsConected: List of accessible rooms from this room. dx: Size in the ordinate x (meters). dy: Size in the ordinate y (meters). pos: Position of the room (x, y). agentsInRoom: List of agent objects in the room walls: List of Wall objects of the room. doors: List of Doors objects of the room.