Skip to contents

Analyse a model.

Usage

analyse_model(
  model,
  type = "",
  stage = "",
  hazard_range = getOption("floodam_building_hazard_range"),
  path = getOption("floodam_building_path"),
  file_name = getOption("floodam_building_file_name"),
  type_building = getOption("floodam_building_type_building"),
  version_building = NULL,
  verbose = getOption("floodam_building_verbose"),
  dam_by_room = FALSE
)

Arguments

model

either a character, name given to the model or an object of class model

type

character, type of model that is loaded, default to ""

stage

character, what are the stages that should be done, default to nothing.

hazard_range

if damaging are calculated, gives the range for hazard, default to getOption("floodam_building_hazard_range")

path

list of useful paths, default to getOption("floodam_building_path")

file_name,

list of useful file names, default to getOption("floodam_building_file_name")

type_building

character, type of building file (building or yaml)

version_building

character, version of building model to be used

verbose

boolean, will floodam tells what it is doing, default to getOption("floodam_building_verbose")

dam_by_room

logical. Should the damage functions be computed by room? Default to FALSE

Value

an object of class model

Examples


# Example 1
# declaring input and output paths
  model_path = list(
    data = system.file("extdata", package = "floodam.building"),
    output = tempdir()
  )

# analyzing model 'adu_t' of type 'adu' using the sequential steps *load* 
# (load model data), *extract* (extract model data) and *damaging* (calculate 
# damage function)
  analyse_model(
    model = "adu_t", 
    type = "adu", 
    stage = c("load", "extract", "damaging"), 
    path = model_path
  )
#> Loading model 'adu_t'...
#> 	- Structure of building.xml of 'adu_t' has been successfully checked
#> 	... successful
#> Extracting building information for 'adu_t'...
#> 	- extracted:
#>  		- parameter
#>  		- storey
#>  		- room
#>  		- wall
#>  		- opening
#>  		- coating
#>  		- furniture
#> 	- missing (not found):
#>  	... Informations successfully extracted for 'adu_t'
#> Computing some values for 'adu_t'...
#> 	... Informations successfully extracted for 'adu_t'
#> Computing damage for 'adu_t'...
#> 	... Damaging successfully computed for 'adu_t'
#> End of analysis for 'adu_t'. Total elapsed time 3.62 secs
#> More information availabe at /tmp/RtmpZhomgU/model/adu/adu_t/adu_t.log
#> 

# Example 2
# using already loaded library model 'dwelling' 
model = dwelling

# extracting model data
model = analyse_model(model = model, stage = "extract")
#> Extracting building information for 'adu_t'...
#> 	- extracted:
#>  		- parameter
#>  		- storey
#>  		- room
#>  		- wall
#>  		- opening
#>  		- coating
#>  		- furniture
#> 	- missing (not found):
#>  	... Informations successfully extracted for 'adu_t'
#> Computing some values for 'adu_t'...
#> 	... Informations successfully extracted for 'adu_t'
#> End of analysis for 'adu_t'. Total elapsed time 0.20 secs
#> More information availabe at /tmp/RtmpBUioc4/model/adu/adu_t/adu_t.log
#> 

# calculating damage function
model = analyse_model(model = model, stage = "damaging")
#> Computing damage for 'adu_t'...
#> 	... Damaging successfully computed for 'adu_t'
#> End of analysis for 'adu_t'. Total elapsed time 1.93 secs
#> More information availabe at /tmp/RtmpBUioc4/model/adu/adu_t/adu_t.log
#> 

# calculating hydraulic inputs
model = analyse_model(model = model, stage = "hydraulic")
#> Extracting input data for hydraulic model for 'adu_t'...
#> 	... converting hydraulic input data in 'adu_t' to meters
#> 	... hydraulic input data in 'adu_t' succesfully converted to meters
#> 	... hydraulic input data successfully extracted for 'adu_t'
#> End of analysis for 'adu_t'. Total elapsed time 0.02 secs
#> More information availabe at /tmp/RtmpBUioc4/model/adu/adu_t/adu_t.log
#>