Agents Module Documentation

Occupant

Fire

class projects.seba.fire.Fire(model, pos)[source]

This class enables to create fire object on a position. The objects of this class are controlled by one FireControl object.

Attributes:
grade: Intensity level of the fire. pos: Fire position.
class projects.seba.fire.FireControl(unique_id, model, posInit, expansionRate=0.7, growthRate=0.7)[source]

This class enables to create agents that control the fire expansión, representing the emergency threat.

Attributes:
fireExpansion: Set of Fire objects belonging to this FireControl. limitFire: Fire objects that are in the limit to make the expansion. expansionRate: Rate of expansion of the threat. growthRate: Value of growth in intensity of the fire.
Methods:
createFirePos: Create a Fire object in a given position. getFirePos: Get a Fire object in a position given. expansionFire: Make the expansion of fire limits. growthFire: Make the growth in intensity of the fire. step: Method invoked by the Model scheduler in each step.
createFirePos(pos)[source]
Create a Fire object in a given position.
Args:
pos: Position to put the Fire object as (x, y)
expansionFire()[source]

Make the expansion of fire limits.

getFirePos(pos)[source]
Get a Fire object in a position given.
Args:
pos: Position to be checked.

Return: Fire object or False

growthFire()[source]

Make the growth in intensity of the fire.

step()[source]

Method invoked by the Model scheduler in each step.

Avatar

class projects.seba.avatar.EmergencyAvatar(unique_id, model, initial_pos, color='red', initial_state='walking')[source]

This class enables to create avatars that represent virtual occupants, that is, they are not controlled by the simulation but by an API Rest. This class inherits from the avatar class of SOBA.

Attributes:
Those Inherited from the Avatar class of SOBA. alive: Current state of an avatar, live or not. life: Number of remaining life points of the avatar.
Methods:
getExitGate: Obtain the optimal way to evacuate the building according to an evacuation strategy. getPosFireFOV: Obtain the positions in the avatar’s field of vision where there is fire. makeEmergencyAction: Method that is invoked when initiating an emergency to make the decision of response.
getExitGate()[source]
Obtain the optimal way to evacuate the building according to an evacuation strategy.
Return: List of positions (x, y)
getPosFireFOV()[source]
Check if the position is in my field of vision
Return: List of positions (x, y)
makeEmergencyAction()[source]

Method that is invoked when initiating an emergency to make the decision of response.

step()[source]

Method invoked by the Model scheduler in each step. Step common to all occupants.