
From the furniture list to the input file
David Nortes Martínez
furniture_to_input_file.Rmd
Before starting
We assume that you have read and successfully model the single-storey building in our vignette From the architect’s plan to the input file of floodam.building. If you have not yet done it, now it is the best time to do so.
The floodam.building library not only takes into account the structure of a building to calculate its damage function. It also considers its contents when provided. This contents should be listed in the furniture file. To add this file to the inputs files of your building follow the following instructions. We will use the building in our vignette From the architect’s plan to the input file of floodam.building as reference.
Step 1: create your furniture file
The first thing you need to do is to create your own
furniture file. To do so, we recommend you to use the dedicated
function of floodam.building new_model()
. The
new_model()
function creates a template of the
furniture file in the path of your choice (or in a temporary
folder if path is not specified) and will launch your default text
editor to open it, so you can start right away. You can also specify the
text editor in which you wish to work as long as it is installed in your
system (This functionality is provided by the
utils::file.edit()
function. Please visit its documentation
page for more details)
library(floodam.building)
#> XML version of the building file using default text editor
create_new_model(input_file = "furniture")
#> YAML version of the building file using Visual Studio Code as text editor
create_new_model(input_file = "furniture", editor = "code")
#> YAML version of the building file using RStudio as text editor
create_new_model(input_file = "furniture", editor = "rstudio")
Step 2: fill your csv file
Now suppose that the building in our vignette From the architect’s plan to the input file of floodam.building has the following contents:
- 3 armchairs (250€ each), a wooden coffee table (100€) and a wooden shelf (250€) in room 1
- A wooden table (300€), 6 wooden chairs (100€ each) and 2 wooden shelves (250€ each) in room 3
- 6 wooden kitchen cabinets (150€ each), 2 wooden shelves (250€ each), an oven (600€), a fridge (1000€), a dish-washer (1000€), a washing machine (1000€) and tableware (200€ the whole set) in room 4
- A set of 6 plastic chairs (200 each) and a plastic table (200€) outside the house.
Also, we know that all furniture and equipment is located at floor level.
As you have seen in the vignette The structure of the input file of floodam.building, the furniture file should include the following field:
- component_elementary: name of the type of elementary component
- room_name: name of the room where the elementary component is located
- wall_name: name of the wall where the elementary component is located
- relative_height: height in cm at which the elementary component is located, relative to the floor of the room where the component is located
- dilapidation: own dilapidation factor to be used for the elementary component (overwrites the one defined at the level of the building)
- quantity: quantity in which the elementary component is present
- v_min: own min value of replacement (overwrites the one defined by default for the type of elementary component)
- v_max: own max value of replacement (overwrites the one defined by default for the type of elementary component)
The available elementary components are listed in vignettes List of building elementary components and List of furniture, equipment and stock elementary components. The following table summarizes the information we have, using the structure above:
component_elementary | room_name | wall_name | relative_height | dilapidation | quantity | v_min | v_max | details |
---|---|---|---|---|---|---|---|---|
armchair | room_1 | NA | 0 | 0 | 3 | 250 | 250 | fauteuil |
chipboard_coffee_table | room_1 | NA | 0 | 0 | 2 | 100 | 100 | table basse |
chipboard_shelf | room_1 | NA | 0 | 0 | 1 | 250 | 250 | étagère |
chipboard_shelf | room_3 | NA | 0 | 0 | 2 | 250 | 250 | étagère |
chipboard_table | room_3 | NA | 0 | 0 | 1 | 300 | 300 | table |
chipboard_chair | room_3 | NA | 0 | 0 | 6 | 100 | 100 | chaise |
solid_wood_furniture | room_4 | NA | 0 | 0 | 6 | 150 | 150 | furniture |
chipboard_shelf | room_4 | NA | 0 | 0 | 2 | 250 | 250 | étagère |
oven | room_4 | NA | 0 | 0 | 1 | 600 | 600 | four |
fridge | room_4 | NA | 0 | 0 | 1 | 1000 | 1000 | frigo |
dish_washer | room_4 | NA | 0 | 0 | 1 | 1000 | 1000 | lave vaisselle |
washing_machine | room_4 | NA | 0 | 0 | 1 | 1000 | 1000 | lave-linge |
tableware | room_4 | NA | 0 | 0 | 1 | 200 | 200 | vaisselle |
plastic_table | external_wall | NA | 0 | 0 | 1 | 200 | 200 | table |
plastic_chair | external_wall | NA | 0 | 0 | 6 | 200 | 200 | chair |
The way we should introduce these elements in CSV format is detailed below:
CSV
component_elementary,room_name,wall_name,relative_height,dilapidation,quantity,v_min,v_max,details
armchair,room_1,NA,0,0,3,250,250,fauteuil
chipboard_coffee_table,room_1,NA,0,0,2,100,100,table basse
chipboard_shelf,room_1,NA,0,0,1,250,250,étagère
chipboard_shelf,room_3,NA,0,0,2,250,250,étagère
chipboard_table,room_3,NA,0,0,1,300,300,table
chipboard_chair,room_3,NA,0,0,6,100,100,chaise
solid_wood_furniture,room_4,NA,0,0,6,150,150,furniture
chipboard_shelf,room_4,NA,0,0,2,250,250,étagère
oven,room_4,NA,0,0,1,600,600,four
fridge,room_4,NA,0,0,1,1000,1000,frigo
dish_washer,room_4,NA,0,0,1,1000,1000,lave vaisselle
washing_machine,room_4,NA,0,0,1,1000,1000,lave-linge
tableware,room_4,NA,0,0,1,200,200,vaisselle
plastic_table,external_wall,NA,0,0,1,200,200,table
plastic_chair,external_wall,NA,0,0,6,200,200,chair
You should now be able to create your own furniture file for this building.