ModuleEntry("CSVSampling","Generate sampling using CSV files",components(org.openmole.plugin.sampling.csv.CSVSampling),sampling),
ModuleEntry("LHS","Generate Latin Hypercube Sampling",components(org.openmole.plugin.sampling.lhs.LHS),sampling),
ModuleEntry("QuasiRandom","Generate sampling using low-discrepency sequences",components(org.openmole.plugin.sampling.quasirandom.SobolSampling),sampling),
lazyvaladvancedSampling=DocumentationPage.fromScalatex(name="Operations on Samplings",content=scalatex.documentation.explore.sampling.AdvancedSampling,title=Some("Advanced Operations on Samplings"))
lazyvaldispatch=DocumentationPage.fromScalatex(name="Dispatch",content=scalatex.documentation.scale.Dispatch,title=Some("Dispatch Jobs on Multiple Environments"))
@@ -15,9 +15,9 @@ More generally, the @aa("spatial data library", href:= "https://github.com/openm
@br
Some of the corresponding spatial generators are included in OpenMOLE as @i{Spatial Samplings}.
Some of the corresponding spatial generators are included in OpenMOLE as @i{Task}.
In the current development version, only some grid generators are included, for a reason of types for output prototypes (synthetic networks are difficult to represent as simple types and to feed as inputs to models).
All generators output the generated grids in a provided prototype, along with the generation parameters for the generators taking factors as arguments.
All generators output the generated grids in a provided @code{Val[Array[Array[Double]}, along with the generation parameters for the generators taken as arguments.
...
...
@@ -25,19 +25,24 @@ All generators output the generated grids in a provided prototype, along with th
sampling = (myDensity in (0.0 to 1.0 by 0.1)) x (myGrid is RandomSpatialSampling(gridSize = 10, density = myDensity)),
evaluation = myModel
sampling = myDensity in (0.0 to 1.0 by 0.1),
evaluation = myGenerator -- myModel
)""", name= "random grid sampling")
@br
...
...
@@ -52,14 +57,22 @@ where
A binary grid with random blocks (random size and position). With the same arguments as before, except the factors for the generator parameters: @code{blocksNumber} is the number of blocks positioned, @code{blocksMinSize}/@code{blocksMaxSize} minimal/maximal (exchanged if needed) width/height of blocks, each being uniformly drawn for each block.
@br@br
@hl.openmole("""
val myGrid = Val[Array[Array[Double]]]
val myBlocksNumber = Val[Int]
val myBlocksMinSize = Val[Int]
val myBlocksMaxSize = Val[Int]
val myGenerator =
RandomSpatialSamplingTask(
grid = myGrid,
gridSize = 10,
number = myBlocksNumber,
minSize = myBlocksMinSize,
maxSize = myBlocksMaxSize
)
val myModel =
ScalaTask("println(myGrid.size)") set (
(inputs, outputs) += myGrid
...
...
@@ -69,17 +82,14 @@ DirectSampling(
sampling =
(myBlocksNumber in (10 to 15)) x
(myBlocksMinSize in (1 to 3)) x
(myBlocksMaxSize in RangeDomain[Int]("myBlocksMinSize + 3", "myBlocksMinSize + 5")) x
(myGrid is BlocksGridSpatialSampling(gridSize = 10, number = myBlocksNumber, minSize = myBlocksMinSize, maxSize = myBlocksMaxSize)),
evaluation = myModel
(myBlocksMaxSize in RangeDomain[Int]("myBlocksMinSize + 3", "myBlocksMinSize + 5")),
evaluation = myGenerator -- myModel
)""", name="block grid sampling")
@h2{Thresholded exponential mixture sampling}
A binary grid created with an exponential mixture, with kernels of the form @code{exp(-r/r0)}. A threshold parameter is applied to produce the binary grid.
@br@br
@hl.openmole("""
val myGrid = Val[Array[Array[Double]]]
...
...
@@ -87,6 +97,15 @@ val myCenter = Val[Int]
val myRadius = Val[Double]
val myThreshold = Val[Double]
val myGenerator =
ExpMixtureThresholdSpatialSamplingTask(
grid = myGrid,
gridSize = 10,
center = myCenter,
radius = myRadius,
threshold = myThreshold
)
val myModel =
ScalaTask("println(myGrid.size)") set (
(inputs, outputs) += myGrid
...
...
@@ -96,9 +115,8 @@ DirectSampling(
sampling =
(myCenter in (1 to 20)) x
(myRadius in (1.0 to 20.0)) x
(myThreshold in (2.0 to 30.0)) x
(myGrid is ExpMixtureThresholdSpatialSampling(gridSize = 10, center = myCenter, radius = myRadius, threshold = myThreshold)),
evaluation = myModel
(myThreshold in (2.0 to 30.0)),
evaluation = myGenerator -- myModel
)""", name="block grid sampling")
@br
...
...
@@ -120,14 +138,20 @@ A binary grid resembling a labyrinthine building organisation, obtained by perco
It percolates a grid network until a fixed number of points on the boundaries of the world are linked through the giant cluster.
The resulting network is transposed to a building configuration by assimilating each link to a street with a given width as a parameter.