Skip to contents

Load furniture for a given model.

Usage

load_furniture(model_name, path, file_name)

Arguments

model_name

the name given to the model used to store log information

path

list of useful paths

file_name

list of useful file_names

Value

a data.frame of furniture present in the model. If the file furniture.csv does not yet exist, return NULL. Some tries are made on format. First, 'furniture.csv' is supposed to be readable by utils::read.csv2, if not it is supposed to be readable by utils::read.csv. If not, an error is returned. User is asked to manage format on his own. Some tries are made on encoding. First, 'furniture.csv' is supposed to be encoded in UTF-8. If this try makes some error, another try is made in ISO-8859-15. If this second try does not work, an error is returned. User is asked to manage encoding on his own.

Examples


  model = "simple_furniture"
  type = "simple"

  load_furniture(
    model_name = model, 
    path = update_path(
      model = model, 
      type = type, 
      path = list(
        data = system.file("extdata", package = "floodam.building"), 
        output = tempdir()
      )
    ),
    file_name = init_file_name()
  )
#>   component_elementary room_name wall_name relative_height dilapidation
#> 1             armchair    room_1        NA               0            0
#>   quantity v_min v_max  details
#> 1        1   250   250 fauteuil