Skip to contents

This is the default generator used by blvim_initialise(). It samples initial attractivenesses from the weighted simplex $$ \sum_j \kappa_j Z_j = \sum_i X_i. $$

Usage

blvim_simplex_initialise(
  context,
  n = 10L,
  face_fraction = 0.5,
  points_per_face = 0L,
  max_partial_attempts = 1000000L,
  include_centre = TRUE
)

Arguments

context

A model context created internally by blvim().

n

Number of initial configurations to generate. The default is deliberately modest because blvim() performs one complete optimisation from each generated configuration.

face_fraction

Proportion of starting points generated on proper faces of the weighted simplex.

points_per_face

Parameter controlling the allocation of points among simplex faces. See sample_weighted_simplex().

max_partial_attempts

Maximum number of proposals used when selecting distinct faces in a partial codimension layer. See sample_weighted_simplex().

include_centre

Whether to include the centre of the weighted simplex as the first starting point. If TRUE, n - 1 points are sampled and the centre is prepended. Thus, the returned matrix always has n rows.

Value

a list containing:

  • Z: the matrix of initial attractivenesses;

  • sampling: diagnostics returned by sample_weighted_simplex(), or NULL when no random point is requested.

Examples

distances <- french_cities_distances[1:10, 1:10] / 1000
production <- rep(1, 10)
# Emphasise proper faces of the simplex
boundary_initialise <- blvim_initialise(
  generator = blvim_simplex_initialise,
  n = 100,
  face_fraction = 0.8,
  points_per_face = 5
)
multistart_flows <- blvim(
  distances, production, 1.5, 1 / 100,
  Z = boundary_initialise,
  algorithm = "gradient",
  keep_runs = TRUE
)
head(sim_logs(multistart_flows))
#>   run potential iterations converged    status          gap evaluations
#> 1   1 -8.431680         41      TRUE converged 1.908660e-06          55
#> 2   2 -8.431680         25      TRUE converged 4.539827e-06          36
#> 3   3 -9.193965         26      TRUE converged 5.766371e-06          37
#> 4   4 -8.505239         32      TRUE converged 8.621229e-06          44
#> 5   5 -8.561907         50      TRUE converged 9.338627e-06          66
#> 6   6 -8.607270         75      TRUE converged 7.404967e-06          97
#>   n_active configuration selected
#> 1        8             1     TRUE
#> 2        8             1    FALSE
#> 3        8            30    FALSE
#> 4        7             3    FALSE
#> 5        8             5    FALSE
#> 6        7             8    FALSE