inst/extdata/scripts/visualise-constant-arrays.R

# Analyse the Abimo input data -------------------------------------------------
if (FALSE)
{
  df <- foreign::read.dbf("~/qt-projects/abimo/data/abimo_2019_mitstrassen.dbf")

  dim(df)

  # What combinations of NUTZUNG and TYP occur?
  table(TYP = df$TYP, NUTZUNG = df$NUTZUNG)
}

# Analyse what the numeric arrays in the Abimo C++ code mean -------------------
if (FALSE)
{
  eka <- c(
    0.04176, -0.647 , 0.218  ,  0.01472, 0.0002089,
    0.04594, -0.314 , 0.417  ,  0.02463, 0.0001143,
    0.05177, -0.010 , 0.596  ,  0.02656, 0.0002786,
    0.05693,  0.033 , 0.676  ,  0.0279 , 0.00035  ,
    0.06162,  0.176 , 0.773  ,  0.02809, 0.0004695,
    0.06962,  0.24  , 0.904  ,  0.02562, 0.0007149,
    0.0796 ,  0.31  , 1.039  ,  0.0288 , 0.0008696,
    0.07998,  0.7603, 1.2    ,  0.0471 , 0.000293 ,
    0.08762,  1.019 , 1.373  ,  0.04099, 0.0014141,
    0.11833,  1.1334, 1.95   ,  0.0525 , 0.00125  ,
    0.155  ,  1.5   , 2.64999,  0.0725 , 0.001249 ,
    0.20041,  2.0918, 3.69999,  0.08   , 0.001999 ,
    0.33895,  3.721 , 6.69999, -0.07   , 0.013
  )

  ijkr <- c(
    7.0, 6.0, 5.0, 1.5, 0.5, 0.2, 0.1, 0.0, 0.0, 0.0,  0.0 , 0.0, 0.0 , 0.0, 0.0,
    7.0, 7.0, 6.0, 5.0, 3.0, 1.2, 0.5, 0.2, 0.1, 0.0,  0.0 , 0.0, 0.0 , 0.0, 0.0,
    7.0, 7.0, 6.0, 6.0, 5.0, 3.0, 1.5, 0.7, 0.3, 0.15, 0.1 , 0.0, 0.0 , 0.0, 0.0,
    7.0, 7.0, 6.0, 6.0, 5.0, 3.0, 2.0, 1.0, 0.7, 0.4,  0.15, 0.1, 0.0 , 0.0, 0.0,
    7.0, 7.0, 6.0, 6.0, 5.0, 4.5, 2.5, 1.5, 0.7, 0.4,  0.15, 0.1, 0.0 , 0.0, 0.0,
    7.0, 7.0, 6.0, 6.0, 5.0, 5.0, 3.5, 2.0, 1.5, 0.8,  0.3 , 0.1, 0.05, 0.0, 0.0,
    7.0, 7.0, 6.0, 6.0, 6.0, 5.0, 5.0, 5.0, 3.0, 2.0,  1.0 , 0.5, 0.15, 0.0, 0.0
  )

  plot(seq_along(eka), eka, type = "l")
  plot(seq_along(ijkr), ijkr, type = "l")
}
KWB-R/kwb.abimo documentation built on Feb. 14, 2024, 9:42 a.m.