Notebook 9 - Generative Relations mcda
For the generation of the agent based design the following matrix has been made based on the agent criterias, this has been used in the definitive script. As you can see, we have focused on the following aspects: the connection between the spaces and the different entrances, the sun access, Roof access, the silent level active (which means how little noise the facilities produce) and the noise sensitivity (which we will use for both the internal and external noise). Space area means the estimated amount of voxels (3,6m x 3,6m x 3,6m) each function needs and with the column initial location we manually indicate the specific position for the entrances.
The entrances that we have determined are shown in Figure 53. The most public entrances have been placed on the most busy road (Vijverhofstraat). These are the entrances for the atrium, supermarket and cinema, arcade and café/restaurant/pub. The entrances to the courtyard and the atrium carry contrasting functions of public and private. Nevertheless, we want these spaces to have a strong connection which is simulated by placing them opposite of each other, whereby the entrance of the courtyard is situated at the more peaceful side, namely the north east side along the Schoterbosstraat. Subsequently the public library is situated at Teilingerstraat and the car parking at Zomerhofstraat. Both streets that are less busy than Vijverhofstraat, but are situated close to other the public entrances that have been appointed above. And lastly, the trash room is placed on the Teilingerstraat. In addition, sound pollution, produced by the internal spaces inside the building as well as the sound pollution produced by the outdoors traffic, has been taken into account when the entrances were placed. The placement of the entrances divide the building into a sound producing side and a more quiet side.
Flowchart
In Figure 54 the flowchart of notebook generative relations mcda is shown, in which the global steps that have been executed are presented. In the following diagrams we will zoom in on each criteria where the main steps have been visualized and are explained.
Additional diagrams
In the following diagrams we will zoom in on each criteria where the main steps have been visualized and are explained.
Diagram Closeness: The location of the seed agents is calculated randomly. When the initial location has been determined the different seed agents will be attracted to each other, based on the closeness matrix. The seed agents will eventually grow towards the attracted seed.
Diagram Entrances: The specific initial location of the entrances have been chosen manually, based on the entrance map. When the initial location is calculated randomly and is placed it will grow towards the attracted entrance seed, based on entrance accessibility matrix.
Diagram Floor preference: A column of the building will be cut out and will get a range of distance values. When the initial location has been determined the different seed agents will be attracted to their desired floor preference, based on the floor preference matrix. The only floors that are preferred are 1 and 0 or nothing. The seed agents will grow towards the attracted floor preference.
Diagram Internal noise: The location of the seed agents is calculated randomly. The amount of silence the agents produce will be calculated and will be compared to the noise sensitivity property. The agents that are sensitive for noise will grow away from the agents that create a lot of noise.
Diagram External noise: The amount of external noise around the building will be determined.The location of the seed agents is calculated randomly. When the initial location has been determined the noise sensitivity property, from the matrix will be compared to the external noise values. The agents that are sensitive to noise will grow away from the noisy facades.
Diagram Sun access: The amount of sun access of the building will be determined. The location of the seed agents is calculated randomly. When the initial location has been determined the different seed agents will be attracted to an amount of sun access, based on the sun access matrix. The seed agents will eventually grow towards the facade with the prefered amount of sun access.
Diagram Roof access: The amount of Roof access of the building will be determined.The location of the seed agents is calculated randomly. When the initial location has been determined the different seed agents will be attracted to an amount of Roof access, based on the Roof access matrix. The seed agents will eventually grow towards the prefered amount of Roof access access.
Pseudo code
For a better understanding of the code, we wrote a pseudo code. The notebook, and the other notebooks, can be found here.
#Load in the envelope growing_lattice_7_2.csv
#Load in agent information from thematrix_1.csv
Extract agent ids
Extract agent preferences
Extract agent space area
Extract agent initial location
#Initialize environment information layers from Sun Access lattice, Roof access lattice, Noise lattice
Load the lattice from csv
List the environment information layers (lattices)
Put it into a dictionary
#Initialize the agents
Initialize the occupation lattice
Finding the index of the available voxels in availability lattice
Count the number of spaces (rows) and intitialize an agent for each space
Adding the origins to the agents locations
For each agent origin
If initial location from agent is -1
Determine location randomly
else
Give the agent the location that has been assigned in the matrix
#Initialize floor level lattice
Initialize the floor lattice
Cut out a single column
Specify a range array based on the number of voxels in the column
Compute the distances based on the range column
Compute the floor lattice
Return the floor lattice
Define the ground floor lattice
Define the first floor lattice
Add the floor lattices in the dictionary
#Initialize dynamic floor lattice
Define noise range
Initialize noise sources
For each agent
Extract agent location
Retrieve the silent level of the agent
Mapping the [0,1] values to noise level (db)
For each agent location:
Append the noise source information
Convert noise source information to numpy
Create full lattice
Extract the coordinates of the centroid of all voxels
Extract voxel indices of all voxels
Initializing the sum lattice of noise
For each source of noise
Create distance lattice
For every centroid
Compute the euclidean distance
Compute the noise lattice from distance lattice
Summing the amount of noise
Normalizing the noise values
#Running the simulation
Make a dictionary with noise sensitivity of the matrix as key and the dynamic noise lattice as function
Make a deep copy of the occupation lattice
Initialize the list of frames
Set the time variable to 0
Make the amount of frames the maximum agent space area from the matrix
While time variable < frames
Update the information lattices
Itterate over dynamic lattices
For each agent
Retrieve the list of the locations of the current agent
If the number of agent locations < agent space area
Initialize the list of free neighbours
For each location of the agent
Retrieve the list of neigbhours of the agent based on the stencil
For each neigbhour
Compute 3D index of neighbour
If the neigbhour is available
Add the neighbour to the list of free neighbours
If the number of free neigbhours > 0
Convert free neighbours to numpy array
Retrieving the entrance access value of the free neighbours
Retrieve agent preferences
For every neigbhour in free neigbhour
neighbour value = 1
For every lattice in the environment informations
Compare different layers of environmental information and evaluate the voxel for the agent
Add the neigbhour value to the list
Convert to numpy array
Select the neigbhour with highest value
Find the 3D integer index of selected neigbhour
Find the location of the newly selected neigbhour
Add the newly selected neigbhour location to agent locations
Set the newly selected neigbhour as unavailable in the availability lattice
Set the newly selected neigbhour as occupied by current agent
Construct the new lattice
Add the new lattice to the list of frames
Add +1 to the time counter
Visualisations of the result
Last but not least: the results. The results are visualized in a video and in a voxel cloud.
Growing video
GIF
Voxel cloud
Reflexion
The end result of the growing model is not exactly the desired building configuration. The building is quite wide and as a consequence, a lot of spaces experience little light. In addition, many spaces have been placed in unsuitable positions, as for example the supermarket that has a height of five floors. Furthermore, some functions even got sliced into multiple clusters, for instance, the cinema was split into three separate parts on some floors. In all probability, these mistakes happened due to a few oversights that went unsolved owing to a lack of time.
First of all, an implementation that would help to solve these problems, is the optimized choice of initial locations. The current script defines the initial location of the agents randomly, therefore agents can end up in wrong positions far away from their desired location. Secondly, the criteria squareness can be implemented, which will ensure agents grow into their desired shape. This could be rectangular or free form. And lastly, if the growing model would have fewer voxels to grow, the agents could fulfill their preferences more. As a result, the building would not be as wide and the spaces would receive more sunlight.